upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr-util / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by GNU Autoconf 2.63.
4 #
5 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
6 # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9 ## --------------------- ##
10 ## M4sh Initialization.  ##
11 ## --------------------- ##
12
13 # Be more Bourne compatible
14 DUALCASE=1; export DUALCASE # for MKS sh
15 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16   emulate sh
17   NULLCMD=:
18   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
19   # is contrary to our usage.  Disable this feature.
20   alias -g '${1+"$@"}'='"$@"'
21   setopt NO_GLOB_SUBST
22 else
23   case `(set -o) 2>/dev/null` in
24   *posix*) set -o posix ;;
25 esac
26
27 fi
28
29
30
31
32 # PATH needs CR
33 # Avoid depending upon Character Ranges.
34 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
35 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
36 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
37 as_cr_digits='0123456789'
38 as_cr_alnum=$as_cr_Letters$as_cr_digits
39
40 as_nl='
41 '
42 export as_nl
43 # Printing a long string crashes Solaris 7 /usr/bin/printf.
44 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
45 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
46 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
47 if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
48   as_echo='printf %s\n'
49   as_echo_n='printf %s'
50 else
51   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
52     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
53     as_echo_n='/usr/ucb/echo -n'
54   else
55     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
56     as_echo_n_body='eval
57       arg=$1;
58       case $arg in
59       *"$as_nl"*)
60         expr "X$arg" : "X\\(.*\\)$as_nl";
61         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
62       esac;
63       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
64     '
65     export as_echo_n_body
66     as_echo_n='sh -c $as_echo_n_body as_echo'
67   fi
68   export as_echo_body
69   as_echo='sh -c $as_echo_body as_echo'
70 fi
71
72 # The user is always right.
73 if test "${PATH_SEPARATOR+set}" != set; then
74   PATH_SEPARATOR=:
75   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
76     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
77       PATH_SEPARATOR=';'
78   }
79 fi
80
81 # Support unset when possible.
82 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
83   as_unset=unset
84 else
85   as_unset=false
86 fi
87
88
89 # IFS
90 # We need space, tab and new line, in precisely that order.  Quoting is
91 # there to prevent editors from complaining about space-tab.
92 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
93 # splitting by setting IFS to empty value.)
94 IFS=" ""        $as_nl"
95
96 # Find who we are.  Look in the path if we contain no directory separator.
97 case $0 in
98   *[\\/]* ) as_myself=$0 ;;
99   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
100 for as_dir in $PATH
101 do
102   IFS=$as_save_IFS
103   test -z "$as_dir" && as_dir=.
104   test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
105 done
106 IFS=$as_save_IFS
107
108      ;;
109 esac
110 # We did not find ourselves, most probably we were run as `sh COMMAND'
111 # in which case we are not to be found in the path.
112 if test "x$as_myself" = x; then
113   as_myself=$0
114 fi
115 if test ! -f "$as_myself"; then
116   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
117   { (exit 1); exit 1; }
118 fi
119
120 # Work around bugs in pre-3.0 UWIN ksh.
121 for as_var in ENV MAIL MAILPATH
122 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
123 done
124 PS1='$ '
125 PS2='> '
126 PS4='+ '
127
128 # NLS nuisances.
129 LC_ALL=C
130 export LC_ALL
131 LANGUAGE=C
132 export LANGUAGE
133
134 # Required to use basename.
135 if expr a : '\(a\)' >/dev/null 2>&1 &&
136    test "X`expr 00001 : '.*\(...\)'`" = X001; then
137   as_expr=expr
138 else
139   as_expr=false
140 fi
141
142 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
143   as_basename=basename
144 else
145   as_basename=false
146 fi
147
148
149 # Name of the executable.
150 as_me=`$as_basename -- "$0" ||
151 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
152          X"$0" : 'X\(//\)$' \| \
153          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
154 $as_echo X/"$0" |
155     sed '/^.*\/\([^/][^/]*\)\/*$/{
156             s//\1/
157             q
158           }
159           /^X\/\(\/\/\)$/{
160             s//\1/
161             q
162           }
163           /^X\/\(\/\).*/{
164             s//\1/
165             q
166           }
167           s/.*/./; q'`
168
169 # CDPATH.
170 $as_unset CDPATH
171
172
173 if test "x$CONFIG_SHELL" = x; then
174   if (eval ":") 2>/dev/null; then
175   as_have_required=yes
176 else
177   as_have_required=no
178 fi
179
180   if test $as_have_required = yes &&     (eval ":
181 (as_func_return () {
182   (exit \$1)
183 }
184 as_func_success () {
185   as_func_return 0
186 }
187 as_func_failure () {
188   as_func_return 1
189 }
190 as_func_ret_success () {
191   return 0
192 }
193 as_func_ret_failure () {
194   return 1
195 }
196
197 exitcode=0
198 if as_func_success; then
199   :
200 else
201   exitcode=1
202   echo as_func_success failed.
203 fi
204
205 if as_func_failure; then
206   exitcode=1
207   echo as_func_failure succeeded.
208 fi
209
210 if as_func_ret_success; then
211   :
212 else
213   exitcode=1
214   echo as_func_ret_success failed.
215 fi
216
217 if as_func_ret_failure; then
218   exitcode=1
219   echo as_func_ret_failure succeeded.
220 fi
221
222 if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
223   :
224 else
225   exitcode=1
226   echo positional parameters were not saved.
227 fi
228
229 test \$exitcode = 0) || { (exit 1); exit 1; }
230
231 (
232   as_lineno_1=\$LINENO
233   as_lineno_2=\$LINENO
234   test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
235   test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
236 ") 2> /dev/null; then
237   :
238 else
239   as_candidate_shells=
240     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
241 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
242 do
243   IFS=$as_save_IFS
244   test -z "$as_dir" && as_dir=.
245   case $as_dir in
246          /*)
247            for as_base in sh bash ksh sh5; do
248              as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
249            done;;
250        esac
251 done
252 IFS=$as_save_IFS
253
254
255       for as_shell in $as_candidate_shells $SHELL; do
256          # Try only shells that exist, to save several forks.
257          if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
258                 { ("$as_shell") 2> /dev/null <<\_ASEOF
259 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
260   emulate sh
261   NULLCMD=:
262   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
263   # is contrary to our usage.  Disable this feature.
264   alias -g '${1+"$@"}'='"$@"'
265   setopt NO_GLOB_SUBST
266 else
267   case `(set -o) 2>/dev/null` in
268   *posix*) set -o posix ;;
269 esac
270
271 fi
272
273
274 :
275 _ASEOF
276 }; then
277   CONFIG_SHELL=$as_shell
278                as_have_required=yes
279                if { "$as_shell" 2> /dev/null <<\_ASEOF
280 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
281   emulate sh
282   NULLCMD=:
283   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
284   # is contrary to our usage.  Disable this feature.
285   alias -g '${1+"$@"}'='"$@"'
286   setopt NO_GLOB_SUBST
287 else
288   case `(set -o) 2>/dev/null` in
289   *posix*) set -o posix ;;
290 esac
291
292 fi
293
294
295 :
296 (as_func_return () {
297   (exit $1)
298 }
299 as_func_success () {
300   as_func_return 0
301 }
302 as_func_failure () {
303   as_func_return 1
304 }
305 as_func_ret_success () {
306   return 0
307 }
308 as_func_ret_failure () {
309   return 1
310 }
311
312 exitcode=0
313 if as_func_success; then
314   :
315 else
316   exitcode=1
317   echo as_func_success failed.
318 fi
319
320 if as_func_failure; then
321   exitcode=1
322   echo as_func_failure succeeded.
323 fi
324
325 if as_func_ret_success; then
326   :
327 else
328   exitcode=1
329   echo as_func_ret_success failed.
330 fi
331
332 if as_func_ret_failure; then
333   exitcode=1
334   echo as_func_ret_failure succeeded.
335 fi
336
337 if ( set x; as_func_ret_success y && test x = "$1" ); then
338   :
339 else
340   exitcode=1
341   echo positional parameters were not saved.
342 fi
343
344 test $exitcode = 0) || { (exit 1); exit 1; }
345
346 (
347   as_lineno_1=$LINENO
348   as_lineno_2=$LINENO
349   test "x$as_lineno_1" != "x$as_lineno_2" &&
350   test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
351
352 _ASEOF
353 }; then
354   break
355 fi
356
357 fi
358
359       done
360
361       if test "x$CONFIG_SHELL" != x; then
362   for as_var in BASH_ENV ENV
363         do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
364         done
365         export CONFIG_SHELL
366         exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
367 fi
368
369
370     if test $as_have_required = no; then
371   echo This script requires a shell more modern than all the
372       echo shells that I found on your system.  Please install a
373       echo modern shell, or manually run the script under such a
374       echo shell if you do have one.
375       { (exit 1); exit 1; }
376 fi
377
378
379 fi
380
381 fi
382
383
384
385 (eval "as_func_return () {
386   (exit \$1)
387 }
388 as_func_success () {
389   as_func_return 0
390 }
391 as_func_failure () {
392   as_func_return 1
393 }
394 as_func_ret_success () {
395   return 0
396 }
397 as_func_ret_failure () {
398   return 1
399 }
400
401 exitcode=0
402 if as_func_success; then
403   :
404 else
405   exitcode=1
406   echo as_func_success failed.
407 fi
408
409 if as_func_failure; then
410   exitcode=1
411   echo as_func_failure succeeded.
412 fi
413
414 if as_func_ret_success; then
415   :
416 else
417   exitcode=1
418   echo as_func_ret_success failed.
419 fi
420
421 if as_func_ret_failure; then
422   exitcode=1
423   echo as_func_ret_failure succeeded.
424 fi
425
426 if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
427   :
428 else
429   exitcode=1
430   echo positional parameters were not saved.
431 fi
432
433 test \$exitcode = 0") || {
434   echo No shell found that supports shell functions.
435   echo Please tell bug-autoconf@gnu.org about your system,
436   echo including any error possibly output before this message.
437   echo This can help us improve future autoconf versions.
438   echo Configuration will now proceed without shell functions.
439 }
440
441
442
443   as_lineno_1=$LINENO
444   as_lineno_2=$LINENO
445   test "x$as_lineno_1" != "x$as_lineno_2" &&
446   test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
447
448   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
449   # uniformly replaced by the line number.  The first 'sed' inserts a
450   # line-number line after each line using $LINENO; the second 'sed'
451   # does the real work.  The second script uses 'N' to pair each
452   # line-number line with the line containing $LINENO, and appends
453   # trailing '-' during substitution so that $LINENO is not a special
454   # case at line end.
455   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
456   # scripts with optimization help from Paolo Bonzini.  Blame Lee
457   # E. McMahon (1931-1989) for sed's syntax.  :-)
458   sed -n '
459     p
460     /[$]LINENO/=
461   ' <$as_myself |
462     sed '
463       s/[$]LINENO.*/&-/
464       t lineno
465       b
466       :lineno
467       N
468       :loop
469       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
470       t loop
471       s/-\n.*//
472     ' >$as_me.lineno &&
473   chmod +x "$as_me.lineno" ||
474     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
475    { (exit 1); exit 1; }; }
476
477   # Don't try to exec as it changes $[0], causing all sort of problems
478   # (the dirname of $[0] is not the place where we might find the
479   # original and so on.  Autoconf is especially sensitive to this).
480   . "./$as_me.lineno"
481   # Exit status is that of the last command.
482   exit
483 }
484
485
486 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
487   as_dirname=dirname
488 else
489   as_dirname=false
490 fi
491
492 ECHO_C= ECHO_N= ECHO_T=
493 case `echo -n x` in
494 -n*)
495   case `echo 'x\c'` in
496   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
497   *)   ECHO_C='\c';;
498   esac;;
499 *)
500   ECHO_N='-n';;
501 esac
502 if expr a : '\(a\)' >/dev/null 2>&1 &&
503    test "X`expr 00001 : '.*\(...\)'`" = X001; then
504   as_expr=expr
505 else
506   as_expr=false
507 fi
508
509 rm -f conf$$ conf$$.exe conf$$.file
510 if test -d conf$$.dir; then
511   rm -f conf$$.dir/conf$$.file
512 else
513   rm -f conf$$.dir
514   mkdir conf$$.dir 2>/dev/null
515 fi
516 if (echo >conf$$.file) 2>/dev/null; then
517   if ln -s conf$$.file conf$$ 2>/dev/null; then
518     as_ln_s='ln -s'
519     # ... but there are two gotchas:
520     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
521     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
522     # In both cases, we have to default to `cp -p'.
523     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
524       as_ln_s='cp -p'
525   elif ln conf$$.file conf$$ 2>/dev/null; then
526     as_ln_s=ln
527   else
528     as_ln_s='cp -p'
529   fi
530 else
531   as_ln_s='cp -p'
532 fi
533 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
534 rmdir conf$$.dir 2>/dev/null
535
536 if mkdir -p . 2>/dev/null; then
537   as_mkdir_p=:
538 else
539   test -d ./-p && rmdir ./-p
540   as_mkdir_p=false
541 fi
542
543 if test -x / >/dev/null 2>&1; then
544   as_test_x='test -x'
545 else
546   if ls -dL / >/dev/null 2>&1; then
547     as_ls_L_option=L
548   else
549     as_ls_L_option=
550   fi
551   as_test_x='
552     eval sh -c '\''
553       if test -d "$1"; then
554         test -d "$1/.";
555       else
556         case $1 in
557         -*)set "./$1";;
558         esac;
559         case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
560         ???[sx]*):;;*)false;;esac;fi
561     '\'' sh
562   '
563 fi
564 as_executable_p=$as_test_x
565
566 # Sed expression to map a string onto a valid CPP name.
567 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
568
569 # Sed expression to map a string onto a valid variable name.
570 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
571
572
573
574 exec 7<&0 </dev/null 6>&1
575
576 # Name of the host.
577 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
578 # so uname gets run too.
579 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
580
581 #
582 # Initializations.
583 #
584 ac_default_prefix=/usr/local
585 ac_clean_files=
586 ac_config_libobj_dir=.
587 LIBOBJS=
588 cross_compiling=no
589 subdirs=
590 MFLAGS=
591 MAKEFLAGS=
592 SHELL=${CONFIG_SHELL-/bin/sh}
593
594 # Identity of this package.
595 PACKAGE_NAME=
596 PACKAGE_TARNAME=
597 PACKAGE_VERSION=
598 PACKAGE_STRING=
599 PACKAGE_BUGREPORT=
600
601 ac_unique_file="export_vars.sh.in"
602 # Factoring default headers for most tests.
603 ac_includes_default="\
604 #include <stdio.h>
605 #ifdef HAVE_SYS_TYPES_H
606 # include <sys/types.h>
607 #endif
608 #ifdef HAVE_SYS_STAT_H
609 # include <sys/stat.h>
610 #endif
611 #ifdef STDC_HEADERS
612 # include <stdlib.h>
613 # include <stddef.h>
614 #else
615 # ifdef HAVE_STDLIB_H
616 #  include <stdlib.h>
617 # endif
618 #endif
619 #ifdef HAVE_STRING_H
620 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
621 #  include <memory.h>
622 # endif
623 # include <string.h>
624 #endif
625 #ifdef HAVE_STRINGS_H
626 # include <strings.h>
627 #endif
628 #ifdef HAVE_INTTYPES_H
629 # include <inttypes.h>
630 #endif
631 #ifdef HAVE_STDINT_H
632 # include <stdint.h>
633 #endif
634 #ifdef HAVE_UNISTD_H
635 # include <unistd.h>
636 #endif"
637
638 ac_subst_vars='LTLIBOBJS
639 LIBOBJS
640 INCLUDE_RULES
641 APRUTIL_LIBS
642 APRUTIL_LDFLAGS
643 APRUTIL_INCLUDES
644 APRUTIL_PRIV_INCLUDES
645 APRUTIL_EXPORT_LIBS
646 EXTRA_OS_LINK
647 LT_NO_INSTALL
648 APRUTIL_LIBNAME
649 lib_target
650 so_ext
651 have_iconv
652 APR_XML_EXPAT_OLD
653 APR_XML_DIR
654 APR_XML_SUBDIRS
655 apu_db_version
656 apu_db_header
657 apu_have_db
658 apu_have_ndbm
659 apu_have_gdbm
660 apu_have_sdbm
661 apu_use_db
662 apu_use_ndbm
663 apu_use_gdbm
664 apu_use_sdbm
665 apu_has_ldap
666 apu_has_ldap_starttls
667 apu_has_ldap_netscape_ssl
668 ldap_ssl_h
669 lber_h
670 ldap_h
671 EGREP
672 GREP
673 CPP
674 OBJEXT
675 EXEEXT
676 ac_ct_CC
677 CPPFLAGS
678 LDFLAGS
679 CFLAGS
680 CC
681 APR_BUILD_DIR
682 APR_LIBS
683 APR_INCLUDES
684 APRUTIL_MAJOR_VERSION
685 APRUTIL_DOTTED_VERSION
686 abs_builddir
687 abs_srcdir
688 top_builddir
689 target_os
690 target_vendor
691 target_cpu
692 target
693 host_os
694 host_vendor
695 host_cpu
696 host
697 build_os
698 build_vendor
699 build_cpu
700 build
701 APU_CONFIG_LOCATION
702 target_alias
703 host_alias
704 build_alias
705 LIBS
706 ECHO_T
707 ECHO_N
708 ECHO_C
709 DEFS
710 mandir
711 localedir
712 libdir
713 psdir
714 pdfdir
715 dvidir
716 htmldir
717 infodir
718 docdir
719 oldincludedir
720 includedir
721 localstatedir
722 sharedstatedir
723 sysconfdir
724 datadir
725 datarootdir
726 libexecdir
727 sbindir
728 bindir
729 program_transform_name
730 prefix
731 exec_prefix
732 PACKAGE_BUGREPORT
733 PACKAGE_STRING
734 PACKAGE_VERSION
735 PACKAGE_TARNAME
736 PACKAGE_NAME
737 PATH_SEPARATOR
738 SHELL'
739 ac_subst_files=''
740 ac_user_opts='
741 enable_option_checking
742 enable_layout
743 with_apr
744 with_ldap_include
745 with_ldap_lib
746 with_ldap
747 with_dbm
748 with_gdbm
749 with_ndbm
750 with_berkeley_db
751 with_expat
752 with_iconv
753 '
754       ac_precious_vars='build_alias
755 host_alias
756 target_alias
757 CC
758 CFLAGS
759 LDFLAGS
760 LIBS
761 CPPFLAGS
762 CPP'
763
764
765 # Initialize some variables set by options.
766 ac_init_help=
767 ac_init_version=false
768 ac_unrecognized_opts=
769 ac_unrecognized_sep=
770 # The variables have the same names as the options, with
771 # dashes changed to underlines.
772 cache_file=/dev/null
773 exec_prefix=NONE
774 no_create=
775 no_recursion=
776 prefix=NONE
777 program_prefix=NONE
778 program_suffix=NONE
779 program_transform_name=s,x,x,
780 silent=
781 site=
782 srcdir=
783 verbose=
784 x_includes=NONE
785 x_libraries=NONE
786
787 # Installation directory options.
788 # These are left unexpanded so users can "make install exec_prefix=/foo"
789 # and all the variables that are supposed to be based on exec_prefix
790 # by default will actually change.
791 # Use braces instead of parens because sh, perl, etc. also accept them.
792 # (The list follows the same order as the GNU Coding Standards.)
793 bindir='${exec_prefix}/bin'
794 sbindir='${exec_prefix}/sbin'
795 libexecdir='${exec_prefix}/libexec'
796 datarootdir='${prefix}/share'
797 datadir='${datarootdir}'
798 sysconfdir='${prefix}/etc'
799 sharedstatedir='${prefix}/com'
800 localstatedir='${prefix}/var'
801 includedir='${prefix}/include'
802 oldincludedir='/usr/include'
803 docdir='${datarootdir}/doc/${PACKAGE}'
804 infodir='${datarootdir}/info'
805 htmldir='${docdir}'
806 dvidir='${docdir}'
807 pdfdir='${docdir}'
808 psdir='${docdir}'
809 libdir='${exec_prefix}/lib'
810 localedir='${datarootdir}/locale'
811 mandir='${datarootdir}/man'
812
813 ac_prev=
814 ac_dashdash=
815 for ac_option
816 do
817   # If the previous option needs an argument, assign it.
818   if test -n "$ac_prev"; then
819     eval $ac_prev=\$ac_option
820     ac_prev=
821     continue
822   fi
823
824   case $ac_option in
825   *=*)  ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
826   *)    ac_optarg=yes ;;
827   esac
828
829   # Accept the important Cygnus configure options, so we can diagnose typos.
830
831   case $ac_dashdash$ac_option in
832   --)
833     ac_dashdash=yes ;;
834
835   -bindir | --bindir | --bindi | --bind | --bin | --bi)
836     ac_prev=bindir ;;
837   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
838     bindir=$ac_optarg ;;
839
840   -build | --build | --buil | --bui | --bu)
841     ac_prev=build_alias ;;
842   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
843     build_alias=$ac_optarg ;;
844
845   -cache-file | --cache-file | --cache-fil | --cache-fi \
846   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
847     ac_prev=cache_file ;;
848   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
849   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
850     cache_file=$ac_optarg ;;
851
852   --config-cache | -C)
853     cache_file=config.cache ;;
854
855   -datadir | --datadir | --datadi | --datad)
856     ac_prev=datadir ;;
857   -datadir=* | --datadir=* | --datadi=* | --datad=*)
858     datadir=$ac_optarg ;;
859
860   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
861   | --dataroo | --dataro | --datar)
862     ac_prev=datarootdir ;;
863   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
864   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
865     datarootdir=$ac_optarg ;;
866
867   -disable-* | --disable-*)
868     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
869     # Reject names that are not valid shell variable names.
870     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
871       { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
872    { (exit 1); exit 1; }; }
873     ac_useropt_orig=$ac_useropt
874     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
875     case $ac_user_opts in
876       *"
877 "enable_$ac_useropt"
878 "*) ;;
879       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
880          ac_unrecognized_sep=', ';;
881     esac
882     eval enable_$ac_useropt=no ;;
883
884   -docdir | --docdir | --docdi | --doc | --do)
885     ac_prev=docdir ;;
886   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
887     docdir=$ac_optarg ;;
888
889   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
890     ac_prev=dvidir ;;
891   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
892     dvidir=$ac_optarg ;;
893
894   -enable-* | --enable-*)
895     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
896     # Reject names that are not valid shell variable names.
897     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
898       { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
899    { (exit 1); exit 1; }; }
900     ac_useropt_orig=$ac_useropt
901     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
902     case $ac_user_opts in
903       *"
904 "enable_$ac_useropt"
905 "*) ;;
906       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
907          ac_unrecognized_sep=', ';;
908     esac
909     eval enable_$ac_useropt=\$ac_optarg ;;
910
911   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
912   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
913   | --exec | --exe | --ex)
914     ac_prev=exec_prefix ;;
915   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
916   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
917   | --exec=* | --exe=* | --ex=*)
918     exec_prefix=$ac_optarg ;;
919
920   -gas | --gas | --ga | --g)
921     # Obsolete; use --with-gas.
922     with_gas=yes ;;
923
924   -help | --help | --hel | --he | -h)
925     ac_init_help=long ;;
926   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
927     ac_init_help=recursive ;;
928   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
929     ac_init_help=short ;;
930
931   -host | --host | --hos | --ho)
932     ac_prev=host_alias ;;
933   -host=* | --host=* | --hos=* | --ho=*)
934     host_alias=$ac_optarg ;;
935
936   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
937     ac_prev=htmldir ;;
938   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
939   | --ht=*)
940     htmldir=$ac_optarg ;;
941
942   -includedir | --includedir | --includedi | --included | --include \
943   | --includ | --inclu | --incl | --inc)
944     ac_prev=includedir ;;
945   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
946   | --includ=* | --inclu=* | --incl=* | --inc=*)
947     includedir=$ac_optarg ;;
948
949   -infodir | --infodir | --infodi | --infod | --info | --inf)
950     ac_prev=infodir ;;
951   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
952     infodir=$ac_optarg ;;
953
954   -libdir | --libdir | --libdi | --libd)
955     ac_prev=libdir ;;
956   -libdir=* | --libdir=* | --libdi=* | --libd=*)
957     libdir=$ac_optarg ;;
958
959   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
960   | --libexe | --libex | --libe)
961     ac_prev=libexecdir ;;
962   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
963   | --libexe=* | --libex=* | --libe=*)
964     libexecdir=$ac_optarg ;;
965
966   -localedir | --localedir | --localedi | --localed | --locale)
967     ac_prev=localedir ;;
968   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
969     localedir=$ac_optarg ;;
970
971   -localstatedir | --localstatedir | --localstatedi | --localstated \
972   | --localstate | --localstat | --localsta | --localst | --locals)
973     ac_prev=localstatedir ;;
974   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
975   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
976     localstatedir=$ac_optarg ;;
977
978   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
979     ac_prev=mandir ;;
980   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
981     mandir=$ac_optarg ;;
982
983   -nfp | --nfp | --nf)
984     # Obsolete; use --without-fp.
985     with_fp=no ;;
986
987   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
988   | --no-cr | --no-c | -n)
989     no_create=yes ;;
990
991   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
992   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
993     no_recursion=yes ;;
994
995   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
996   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
997   | --oldin | --oldi | --old | --ol | --o)
998     ac_prev=oldincludedir ;;
999   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1000   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1001   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1002     oldincludedir=$ac_optarg ;;
1003
1004   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1005     ac_prev=prefix ;;
1006   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1007     prefix=$ac_optarg ;;
1008
1009   -program-prefix | --program-prefix | --program-prefi | --program-pref \
1010   | --program-pre | --program-pr | --program-p)
1011     ac_prev=program_prefix ;;
1012   -program-prefix=* | --program-prefix=* | --program-prefi=* \
1013   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1014     program_prefix=$ac_optarg ;;
1015
1016   -program-suffix | --program-suffix | --program-suffi | --program-suff \
1017   | --program-suf | --program-su | --program-s)
1018     ac_prev=program_suffix ;;
1019   -program-suffix=* | --program-suffix=* | --program-suffi=* \
1020   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1021     program_suffix=$ac_optarg ;;
1022
1023   -program-transform-name | --program-transform-name \
1024   | --program-transform-nam | --program-transform-na \
1025   | --program-transform-n | --program-transform- \
1026   | --program-transform | --program-transfor \
1027   | --program-transfo | --program-transf \
1028   | --program-trans | --program-tran \
1029   | --progr-tra | --program-tr | --program-t)
1030     ac_prev=program_transform_name ;;
1031   -program-transform-name=* | --program-transform-name=* \
1032   | --program-transform-nam=* | --program-transform-na=* \
1033   | --program-transform-n=* | --program-transform-=* \
1034   | --program-transform=* | --program-transfor=* \
1035   | --program-transfo=* | --program-transf=* \
1036   | --program-trans=* | --program-tran=* \
1037   | --progr-tra=* | --program-tr=* | --program-t=*)
1038     program_transform_name=$ac_optarg ;;
1039
1040   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1041     ac_prev=pdfdir ;;
1042   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1043     pdfdir=$ac_optarg ;;
1044
1045   -psdir | --psdir | --psdi | --psd | --ps)
1046     ac_prev=psdir ;;
1047   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1048     psdir=$ac_optarg ;;
1049
1050   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1051   | -silent | --silent | --silen | --sile | --sil)
1052     silent=yes ;;
1053
1054   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1055     ac_prev=sbindir ;;
1056   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1057   | --sbi=* | --sb=*)
1058     sbindir=$ac_optarg ;;
1059
1060   -sharedstatedir | --sharedstatedir | --sharedstatedi \
1061   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1062   | --sharedst | --shareds | --shared | --share | --shar \
1063   | --sha | --sh)
1064     ac_prev=sharedstatedir ;;
1065   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1066   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1067   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1068   | --sha=* | --sh=*)
1069     sharedstatedir=$ac_optarg ;;
1070
1071   -site | --site | --sit)
1072     ac_prev=site ;;
1073   -site=* | --site=* | --sit=*)
1074     site=$ac_optarg ;;
1075
1076   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1077     ac_prev=srcdir ;;
1078   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1079     srcdir=$ac_optarg ;;
1080
1081   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1082   | --syscon | --sysco | --sysc | --sys | --sy)
1083     ac_prev=sysconfdir ;;
1084   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1085   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1086     sysconfdir=$ac_optarg ;;
1087
1088   -target | --target | --targe | --targ | --tar | --ta | --t)
1089     ac_prev=target_alias ;;
1090   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1091     target_alias=$ac_optarg ;;
1092
1093   -v | -verbose | --verbose | --verbos | --verbo | --verb)
1094     verbose=yes ;;
1095
1096   -version | --version | --versio | --versi | --vers | -V)
1097     ac_init_version=: ;;
1098
1099   -with-* | --with-*)
1100     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1101     # Reject names that are not valid shell variable names.
1102     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1103       { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
1104    { (exit 1); exit 1; }; }
1105     ac_useropt_orig=$ac_useropt
1106     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1107     case $ac_user_opts in
1108       *"
1109 "with_$ac_useropt"
1110 "*) ;;
1111       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1112          ac_unrecognized_sep=', ';;
1113     esac
1114     eval with_$ac_useropt=\$ac_optarg ;;
1115
1116   -without-* | --without-*)
1117     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1118     # Reject names that are not valid shell variable names.
1119     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1120       { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
1121    { (exit 1); exit 1; }; }
1122     ac_useropt_orig=$ac_useropt
1123     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1124     case $ac_user_opts in
1125       *"
1126 "with_$ac_useropt"
1127 "*) ;;
1128       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1129          ac_unrecognized_sep=', ';;
1130     esac
1131     eval with_$ac_useropt=no ;;
1132
1133   --x)
1134     # Obsolete; use --with-x.
1135     with_x=yes ;;
1136
1137   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1138   | --x-incl | --x-inc | --x-in | --x-i)
1139     ac_prev=x_includes ;;
1140   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1141   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1142     x_includes=$ac_optarg ;;
1143
1144   -x-libraries | --x-libraries | --x-librarie | --x-librari \
1145   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1146     ac_prev=x_libraries ;;
1147   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1148   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1149     x_libraries=$ac_optarg ;;
1150
1151   -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
1152 Try \`$0 --help' for more information." >&2
1153    { (exit 1); exit 1; }; }
1154     ;;
1155
1156   *=*)
1157     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1158     # Reject names that are not valid shell variable names.
1159     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
1160       { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
1161    { (exit 1); exit 1; }; }
1162     eval $ac_envvar=\$ac_optarg
1163     export $ac_envvar ;;
1164
1165   *)
1166     # FIXME: should be removed in autoconf 3.0.
1167     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1168     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1169       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1170     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
1171     ;;
1172
1173   esac
1174 done
1175
1176 if test -n "$ac_prev"; then
1177   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1178   { $as_echo "$as_me: error: missing argument to $ac_option" >&2
1179    { (exit 1); exit 1; }; }
1180 fi
1181
1182 if test -n "$ac_unrecognized_opts"; then
1183   case $enable_option_checking in
1184     no) ;;
1185     fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
1186    { (exit 1); exit 1; }; } ;;
1187     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1188   esac
1189 fi
1190
1191 # Check all directory arguments for consistency.
1192 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
1193                 datadir sysconfdir sharedstatedir localstatedir includedir \
1194                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1195                 libdir localedir mandir
1196 do
1197   eval ac_val=\$$ac_var
1198   # Remove trailing slashes.
1199   case $ac_val in
1200     */ )
1201       ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1202       eval $ac_var=\$ac_val;;
1203   esac
1204   # Be sure to have absolute directory names.
1205   case $ac_val in
1206     [\\/$]* | ?:[\\/]* )  continue;;
1207     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1208   esac
1209   { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
1210    { (exit 1); exit 1; }; }
1211 done
1212
1213 # There might be people who depend on the old broken behavior: `$host'
1214 # used to hold the argument of --host etc.
1215 # FIXME: To remove some day.
1216 build=$build_alias
1217 host=$host_alias
1218 target=$target_alias
1219
1220 # FIXME: To remove some day.
1221 if test "x$host_alias" != x; then
1222   if test "x$build_alias" = x; then
1223     cross_compiling=maybe
1224     $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
1225     If a cross compiler is detected then cross compile mode will be used." >&2
1226   elif test "x$build_alias" != "x$host_alias"; then
1227     cross_compiling=yes
1228   fi
1229 fi
1230
1231 ac_tool_prefix=
1232 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1233
1234 test "$silent" = yes && exec 6>/dev/null
1235
1236
1237 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1238 ac_ls_di=`ls -di .` &&
1239 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1240   { $as_echo "$as_me: error: working directory cannot be determined" >&2
1241    { (exit 1); exit 1; }; }
1242 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1243   { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
1244    { (exit 1); exit 1; }; }
1245
1246
1247 # Find the source files, if location was not specified.
1248 if test -z "$srcdir"; then
1249   ac_srcdir_defaulted=yes
1250   # Try the directory containing this script, then the parent directory.
1251   ac_confdir=`$as_dirname -- "$as_myself" ||
1252 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1253          X"$as_myself" : 'X\(//\)[^/]' \| \
1254          X"$as_myself" : 'X\(//\)$' \| \
1255          X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1256 $as_echo X"$as_myself" |
1257     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1258             s//\1/
1259             q
1260           }
1261           /^X\(\/\/\)[^/].*/{
1262             s//\1/
1263             q
1264           }
1265           /^X\(\/\/\)$/{
1266             s//\1/
1267             q
1268           }
1269           /^X\(\/\).*/{
1270             s//\1/
1271             q
1272           }
1273           s/.*/./; q'`
1274   srcdir=$ac_confdir
1275   if test ! -r "$srcdir/$ac_unique_file"; then
1276     srcdir=..
1277   fi
1278 else
1279   ac_srcdir_defaulted=no
1280 fi
1281 if test ! -r "$srcdir/$ac_unique_file"; then
1282   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1283   { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
1284    { (exit 1); exit 1; }; }
1285 fi
1286 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1287 ac_abs_confdir=`(
1288         cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
1289    { (exit 1); exit 1; }; }
1290         pwd)`
1291 # When building in place, set srcdir=.
1292 if test "$ac_abs_confdir" = "$ac_pwd"; then
1293   srcdir=.
1294 fi
1295 # Remove unnecessary trailing slashes from srcdir.
1296 # Double slashes in file names in object file debugging info
1297 # mess up M-x gdb in Emacs.
1298 case $srcdir in
1299 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1300 esac
1301 for ac_var in $ac_precious_vars; do
1302   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1303   eval ac_env_${ac_var}_value=\$${ac_var}
1304   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1305   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1306 done
1307
1308 #
1309 # Report the --help message.
1310 #
1311 if test "$ac_init_help" = "long"; then
1312   # Omit some internal or obsolete options to make the list less imposing.
1313   # This message is too long to be a string in the A/UX 3.1 sh.
1314   cat <<_ACEOF
1315 \`configure' configures this package to adapt to many kinds of systems.
1316
1317 Usage: $0 [OPTION]... [VAR=VALUE]...
1318
1319 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1320 VAR=VALUE.  See below for descriptions of some of the useful variables.
1321
1322 Defaults for the options are specified in brackets.
1323
1324 Configuration:
1325   -h, --help              display this help and exit
1326       --help=short        display options specific to this package
1327       --help=recursive    display the short help of all the included packages
1328   -V, --version           display version information and exit
1329   -q, --quiet, --silent   do not print \`checking...' messages
1330       --cache-file=FILE   cache test results in FILE [disabled]
1331   -C, --config-cache      alias for \`--cache-file=config.cache'
1332   -n, --no-create         do not create output files
1333       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1334
1335 Installation directories:
1336   --prefix=PREFIX         install architecture-independent files in PREFIX
1337                           [$ac_default_prefix]
1338   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1339                           [PREFIX]
1340
1341 By default, \`make install' will install all the files in
1342 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1343 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1344 for instance \`--prefix=\$HOME'.
1345
1346 For better control, use the options below.
1347
1348 Fine tuning of the installation directories:
1349   --bindir=DIR            user executables [EPREFIX/bin]
1350   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1351   --libexecdir=DIR        program executables [EPREFIX/libexec]
1352   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1353   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1354   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1355   --libdir=DIR            object code libraries [EPREFIX/lib]
1356   --includedir=DIR        C header files [PREFIX/include]
1357   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1358   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1359   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1360   --infodir=DIR           info documentation [DATAROOTDIR/info]
1361   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1362   --mandir=DIR            man documentation [DATAROOTDIR/man]
1363   --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
1364   --htmldir=DIR           html documentation [DOCDIR]
1365   --dvidir=DIR            dvi documentation [DOCDIR]
1366   --pdfdir=DIR            pdf documentation [DOCDIR]
1367   --psdir=DIR             ps documentation [DOCDIR]
1368 _ACEOF
1369
1370   cat <<\_ACEOF
1371
1372 System types:
1373   --build=BUILD     configure for building on BUILD [guessed]
1374   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
1375   --target=TARGET   configure for building compilers for TARGET [HOST]
1376 _ACEOF
1377 fi
1378
1379 if test -n "$ac_init_help"; then
1380
1381   cat <<\_ACEOF
1382
1383 Optional Features:
1384   --disable-option-checking  ignore unrecognized --enable/--with options
1385   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1386   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1387   --enable-layout=LAYOUT
1388
1389 Optional Packages:
1390   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1391   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1392   --with-apr=DIR|FILE     prefix for installed APR, path to APR build tree,
1393                           or the full path to apr-config
1394   --with-ldap-include=path  path to ldap include files with trailing slash
1395   --with-ldap-lib=path    path to ldap lib file
1396   --with-ldap=library     ldap library to use
1397
1398     --with-dbm=DBM          choose the DBM type to use.
1399       DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43,db44,db45,db46,db47,db48}
1400
1401
1402     --with-gdbm=DIR          specify GDBM location
1403
1404
1405     --with-ndbm=PATH
1406       Find the NDBM header and library in \`PATH/include' and
1407       \`PATH/lib'.  If PATH is of the form \`HEADER:LIB', then search
1408       for header files in HEADER, and the library in LIB.  If you omit
1409       the \`=PATH' part completely, the configure script will search
1410       for NDBM in a number of standard places.
1411
1412
1413     --with-berkeley-db=PATH
1414       Find the Berkeley DB header and library in \`PATH/include' and
1415       \`PATH/lib'.  If PATH is of the form \`HEADER:LIB', then search
1416       for header files in HEADER, and the library in LIB.  If you omit
1417       the \`=PATH' part completely, the configure script will search
1418       for Berkeley DB in a number of standard places.
1419
1420   --with-expat=DIR        specify Expat location or 'builtin'
1421   --with-iconv=DIR        path to iconv installation
1422
1423 Some influential environment variables:
1424   CC          C compiler command
1425   CFLAGS      C compiler flags
1426   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1427               nonstandard directory <lib dir>
1428   LIBS        libraries to pass to the linker, e.g. -l<library>
1429   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
1430               you have headers in a nonstandard directory <include dir>
1431   CPP         C preprocessor
1432
1433 Use these variables to override the choices made by `configure' or to help
1434 it to find libraries and programs with nonstandard names/locations.
1435
1436 _ACEOF
1437 ac_status=$?
1438 fi
1439
1440 if test "$ac_init_help" = "recursive"; then
1441   # If there are subdirs, report their specific --help.
1442   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1443     test -d "$ac_dir" ||
1444       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1445       continue
1446     ac_builddir=.
1447
1448 case "$ac_dir" in
1449 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1450 *)
1451   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1452   # A ".." for each directory in $ac_dir_suffix.
1453   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1454   case $ac_top_builddir_sub in
1455   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1456   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1457   esac ;;
1458 esac
1459 ac_abs_top_builddir=$ac_pwd
1460 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1461 # for backward compatibility:
1462 ac_top_builddir=$ac_top_build_prefix
1463
1464 case $srcdir in
1465   .)  # We are building in place.
1466     ac_srcdir=.
1467     ac_top_srcdir=$ac_top_builddir_sub
1468     ac_abs_top_srcdir=$ac_pwd ;;
1469   [\\/]* | ?:[\\/]* )  # Absolute name.
1470     ac_srcdir=$srcdir$ac_dir_suffix;
1471     ac_top_srcdir=$srcdir
1472     ac_abs_top_srcdir=$srcdir ;;
1473   *) # Relative name.
1474     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1475     ac_top_srcdir=$ac_top_build_prefix$srcdir
1476     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1477 esac
1478 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1479
1480     cd "$ac_dir" || { ac_status=$?; continue; }
1481     # Check for guested configure.
1482     if test -f "$ac_srcdir/configure.gnu"; then
1483       echo &&
1484       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1485     elif test -f "$ac_srcdir/configure"; then
1486       echo &&
1487       $SHELL "$ac_srcdir/configure" --help=recursive
1488     else
1489       $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1490     fi || ac_status=$?
1491     cd "$ac_pwd" || { ac_status=$?; break; }
1492   done
1493 fi
1494
1495 test -n "$ac_init_help" && exit $ac_status
1496 if $ac_init_version; then
1497   cat <<\_ACEOF
1498 configure
1499 generated by GNU Autoconf 2.63
1500
1501 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
1502 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1503 This configure script is free software; the Free Software Foundation
1504 gives unlimited permission to copy, distribute and modify it.
1505 _ACEOF
1506   exit
1507 fi
1508 cat >config.log <<_ACEOF
1509 This file contains any messages produced by compilers while
1510 running configure, to aid debugging if configure makes a mistake.
1511
1512 It was created by $as_me, which was
1513 generated by GNU Autoconf 2.63.  Invocation command line was
1514
1515   $ $0 $@
1516
1517 _ACEOF
1518 exec 5>>config.log
1519 {
1520 cat <<_ASUNAME
1521 ## --------- ##
1522 ## Platform. ##
1523 ## --------- ##
1524
1525 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1526 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1527 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1528 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1529 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1530
1531 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1532 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1533
1534 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1535 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1536 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1537 /usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1538 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1539 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1540 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1541
1542 _ASUNAME
1543
1544 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1545 for as_dir in $PATH
1546 do
1547   IFS=$as_save_IFS
1548   test -z "$as_dir" && as_dir=.
1549   $as_echo "PATH: $as_dir"
1550 done
1551 IFS=$as_save_IFS
1552
1553 } >&5
1554
1555 cat >&5 <<_ACEOF
1556
1557
1558 ## ----------- ##
1559 ## Core tests. ##
1560 ## ----------- ##
1561
1562 _ACEOF
1563
1564
1565 # Keep a trace of the command line.
1566 # Strip out --no-create and --no-recursion so they do not pile up.
1567 # Strip out --silent because we don't want to record it for future runs.
1568 # Also quote any args containing shell meta-characters.
1569 # Make two passes to allow for proper duplicate-argument suppression.
1570 ac_configure_args=
1571 ac_configure_args0=
1572 ac_configure_args1=
1573 ac_must_keep_next=false
1574 for ac_pass in 1 2
1575 do
1576   for ac_arg
1577   do
1578     case $ac_arg in
1579     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1580     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1581     | -silent | --silent | --silen | --sile | --sil)
1582       continue ;;
1583     *\'*)
1584       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1585     esac
1586     case $ac_pass in
1587     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
1588     2)
1589       ac_configure_args1="$ac_configure_args1 '$ac_arg'"
1590       if test $ac_must_keep_next = true; then
1591         ac_must_keep_next=false # Got value, back to normal.
1592       else
1593         case $ac_arg in
1594           *=* | --config-cache | -C | -disable-* | --disable-* \
1595           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1596           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1597           | -with-* | --with-* | -without-* | --without-* | --x)
1598             case "$ac_configure_args0 " in
1599               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1600             esac
1601             ;;
1602           -* ) ac_must_keep_next=true ;;
1603         esac
1604       fi
1605       ac_configure_args="$ac_configure_args '$ac_arg'"
1606       ;;
1607     esac
1608   done
1609 done
1610 $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
1611 $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
1612
1613 # When interrupted or exit'd, cleanup temporary files, and complete
1614 # config.log.  We remove comments because anyway the quotes in there
1615 # would cause problems or look ugly.
1616 # WARNING: Use '\'' to represent an apostrophe within the trap.
1617 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1618 trap 'exit_status=$?
1619   # Save into config.log some information that might help in debugging.
1620   {
1621     echo
1622
1623     cat <<\_ASBOX
1624 ## ---------------- ##
1625 ## Cache variables. ##
1626 ## ---------------- ##
1627 _ASBOX
1628     echo
1629     # The following way of writing the cache mishandles newlines in values,
1630 (
1631   for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
1632     eval ac_val=\$$ac_var
1633     case $ac_val in #(
1634     *${as_nl}*)
1635       case $ac_var in #(
1636       *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
1637 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
1638       esac
1639       case $ac_var in #(
1640       _ | IFS | as_nl) ;; #(
1641       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1642       *) $as_unset $ac_var ;;
1643       esac ;;
1644     esac
1645   done
1646   (set) 2>&1 |
1647     case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
1648     *${as_nl}ac_space=\ *)
1649       sed -n \
1650         "s/'\''/'\''\\\\'\'''\''/g;
1651           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
1652       ;; #(
1653     *)
1654       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
1655       ;;
1656     esac |
1657     sort
1658 )
1659     echo
1660
1661     cat <<\_ASBOX
1662 ## ----------------- ##
1663 ## Output variables. ##
1664 ## ----------------- ##
1665 _ASBOX
1666     echo
1667     for ac_var in $ac_subst_vars
1668     do
1669       eval ac_val=\$$ac_var
1670       case $ac_val in
1671       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1672       esac
1673       $as_echo "$ac_var='\''$ac_val'\''"
1674     done | sort
1675     echo
1676
1677     if test -n "$ac_subst_files"; then
1678       cat <<\_ASBOX
1679 ## ------------------- ##
1680 ## File substitutions. ##
1681 ## ------------------- ##
1682 _ASBOX
1683       echo
1684       for ac_var in $ac_subst_files
1685       do
1686         eval ac_val=\$$ac_var
1687         case $ac_val in
1688         *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1689         esac
1690         $as_echo "$ac_var='\''$ac_val'\''"
1691       done | sort
1692       echo
1693     fi
1694
1695     if test -s confdefs.h; then
1696       cat <<\_ASBOX
1697 ## ----------- ##
1698 ## confdefs.h. ##
1699 ## ----------- ##
1700 _ASBOX
1701       echo
1702       cat confdefs.h
1703       echo
1704     fi
1705     test "$ac_signal" != 0 &&
1706       $as_echo "$as_me: caught signal $ac_signal"
1707     $as_echo "$as_me: exit $exit_status"
1708   } >&5
1709   rm -f core *.core core.conftest.* &&
1710     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
1711     exit $exit_status
1712 ' 0
1713 for ac_signal in 1 2 13 15; do
1714   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
1715 done
1716 ac_signal=0
1717
1718 # confdefs.h avoids OS command line length limits that DEFS can exceed.
1719 rm -f -r conftest* confdefs.h
1720
1721 # Predefined preprocessor variables.
1722
1723 cat >>confdefs.h <<_ACEOF
1724 #define PACKAGE_NAME "$PACKAGE_NAME"
1725 _ACEOF
1726
1727
1728 cat >>confdefs.h <<_ACEOF
1729 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
1730 _ACEOF
1731
1732
1733 cat >>confdefs.h <<_ACEOF
1734 #define PACKAGE_VERSION "$PACKAGE_VERSION"
1735 _ACEOF
1736
1737
1738 cat >>confdefs.h <<_ACEOF
1739 #define PACKAGE_STRING "$PACKAGE_STRING"
1740 _ACEOF
1741
1742
1743 cat >>confdefs.h <<_ACEOF
1744 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
1745 _ACEOF
1746
1747
1748 # Let the site file select an alternate cache file if it wants to.
1749 # Prefer an explicitly selected file to automatically selected ones.
1750 ac_site_file1=NONE
1751 ac_site_file2=NONE
1752 if test -n "$CONFIG_SITE"; then
1753   ac_site_file1=$CONFIG_SITE
1754 elif test "x$prefix" != xNONE; then
1755   ac_site_file1=$prefix/share/config.site
1756   ac_site_file2=$prefix/etc/config.site
1757 else
1758   ac_site_file1=$ac_default_prefix/share/config.site
1759   ac_site_file2=$ac_default_prefix/etc/config.site
1760 fi
1761 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
1762 do
1763   test "x$ac_site_file" = xNONE && continue
1764   if test -r "$ac_site_file"; then
1765     { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
1766 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
1767     sed 's/^/| /' "$ac_site_file" >&5
1768     . "$ac_site_file"
1769   fi
1770 done
1771
1772 if test -r "$cache_file"; then
1773   # Some versions of bash will fail to source /dev/null (special
1774   # files actually), so we avoid doing that.
1775   if test -f "$cache_file"; then
1776     { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
1777 $as_echo "$as_me: loading cache $cache_file" >&6;}
1778     case $cache_file in
1779       [\\/]* | ?:[\\/]* ) . "$cache_file";;
1780       *)                      . "./$cache_file";;
1781     esac
1782   fi
1783 else
1784   { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
1785 $as_echo "$as_me: creating cache $cache_file" >&6;}
1786   >$cache_file
1787 fi
1788
1789 # Check that the precious variables saved in the cache have kept the same
1790 # value.
1791 ac_cache_corrupted=false
1792 for ac_var in $ac_precious_vars; do
1793   eval ac_old_set=\$ac_cv_env_${ac_var}_set
1794   eval ac_new_set=\$ac_env_${ac_var}_set
1795   eval ac_old_val=\$ac_cv_env_${ac_var}_value
1796   eval ac_new_val=\$ac_env_${ac_var}_value
1797   case $ac_old_set,$ac_new_set in
1798     set,)
1799       { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
1800 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
1801       ac_cache_corrupted=: ;;
1802     ,set)
1803       { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
1804 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
1805       ac_cache_corrupted=: ;;
1806     ,);;
1807     *)
1808       if test "x$ac_old_val" != "x$ac_new_val"; then
1809         # differences in whitespace do not lead to failure.
1810         ac_old_val_w=`echo x $ac_old_val`
1811         ac_new_val_w=`echo x $ac_new_val`
1812         if test "$ac_old_val_w" != "$ac_new_val_w"; then
1813           { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
1814 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
1815           ac_cache_corrupted=:
1816         else
1817           { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
1818 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
1819           eval $ac_var=\$ac_old_val
1820         fi
1821         { $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
1822 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
1823         { $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
1824 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
1825       fi;;
1826   esac
1827   # Pass precious variables to config.status.
1828   if test "$ac_new_set" = set; then
1829     case $ac_new_val in
1830     *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
1831     *) ac_arg=$ac_var=$ac_new_val ;;
1832     esac
1833     case " $ac_configure_args " in
1834       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
1835       *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
1836     esac
1837   fi
1838 done
1839 if $ac_cache_corrupted; then
1840   { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
1841 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1842   { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
1843 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1844   { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1845 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1846    { (exit 1); exit 1; }; }
1847 fi
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865 ac_ext=c
1866 ac_cpp='$CPP $CPPFLAGS'
1867 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1868 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1869 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1870
1871
1872
1873 ac_config_headers="$ac_config_headers include/private/apu_config.h"
1874
1875 ac_aux_dir=
1876 for ac_dir in build "$srcdir"/build; do
1877   if test -f "$ac_dir/install-sh"; then
1878     ac_aux_dir=$ac_dir
1879     ac_install_sh="$ac_aux_dir/install-sh -c"
1880     break
1881   elif test -f "$ac_dir/install.sh"; then
1882     ac_aux_dir=$ac_dir
1883     ac_install_sh="$ac_aux_dir/install.sh -c"
1884     break
1885   elif test -f "$ac_dir/shtool"; then
1886     ac_aux_dir=$ac_dir
1887     ac_install_sh="$ac_aux_dir/shtool install -c"
1888     break
1889   fi
1890 done
1891 if test -z "$ac_aux_dir"; then
1892   { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in build \"$srcdir\"/build" >&5
1893 $as_echo "$as_me: error: cannot find install-sh or install.sh in build \"$srcdir\"/build" >&2;}
1894    { (exit 1); exit 1; }; }
1895 fi
1896
1897 # These three variables are undocumented and unsupported,
1898 # and are intended to be withdrawn in a future Autoconf release.
1899 # They can cause serious problems if a builder's source tree is in a directory
1900 # whose full name contains unusual characters.
1901 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
1902 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
1903 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059   rm -f config.nice
2060   cat >config.nice<<EOF
2061 #! /bin/sh
2062 #
2063 # Created by configure
2064
2065 EOF
2066   if test -n "$CC"; then
2067     echo "CC=\"$CC\"; export CC" >> config.nice
2068   fi
2069   if test -n "$CFLAGS"; then
2070     echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> config.nice
2071   fi
2072   if test -n "$CPPFLAGS"; then
2073     echo "CPPFLAGS=\"$CPPFLAGS\"; export CPPFLAGS" >> config.nice
2074   fi
2075   if test -n "$LDFLAGS"; then
2076     echo "LDFLAGS=\"$LDFLAGS\"; export LDFLAGS" >> config.nice
2077   fi
2078   if test -n "$LIBS"; then
2079     echo "LIBS=\"$LIBS\"; export LIBS" >> config.nice
2080   fi
2081   if test -n "$INCLUDES"; then
2082     echo "INCLUDES=\"$INCLUDES\"; export INCLUDES" >> config.nice
2083   fi
2084   if test -n "$NOTEST_CFLAGS"; then
2085     echo "NOTEST_CFLAGS=\"$NOTEST_CFLAGS\"; export NOTEST_CFLAGS" >> config.nice
2086   fi
2087   if test -n "$NOTEST_CPPFLAGS"; then
2088     echo "NOTEST_CPPFLAGS=\"$NOTEST_CPPFLAGS\"; export NOTEST_CPPFLAGS" >> config.nice
2089   fi
2090   if test -n "$NOTEST_LDFLAGS"; then
2091     echo "NOTEST_LDFLAGS=\"$NOTEST_LDFLAGS\"; export NOTEST_LDFLAGS" >> config.nice
2092   fi
2093   if test -n "$NOTEST_LIBS"; then
2094     echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> config.nice
2095   fi
2096
2097   # Retrieve command-line arguments.
2098   eval "set x $0 $ac_configure_args"
2099   shift
2100
2101   for arg
2102   do
2103
2104 ap_last=
2105 ap_cur="$arg"
2106 while test "x${ap_cur}" != "x${ap_last}";
2107 do
2108   ap_last="${ap_cur}"
2109   ap_cur=`eval "echo ${ap_cur}"`
2110 done
2111 arg="${ap_cur}"
2112
2113     echo "\"$arg\" \\" >> config.nice
2114   done
2115   echo '"$@"' >> config.nice
2116   chmod +x config.nice
2117
2118
2119
2120 abs_srcdir=`(cd $srcdir && pwd)`
2121 abs_builddir=`pwd`
2122
2123 if test "$abs_builddir" != "$abs_srcdir"; then
2124   USE_VPATH=1
2125   APU_CONFIG_LOCATION=build
2126 else
2127   APU_CONFIG_LOCATION=source
2128 fi
2129
2130
2131
2132 # Make sure we can run config.sub.
2133 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2134   { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
2135 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
2136    { (exit 1); exit 1; }; }
2137
2138 { $as_echo "$as_me:$LINENO: checking build system type" >&5
2139 $as_echo_n "checking build system type... " >&6; }
2140 if test "${ac_cv_build+set}" = set; then
2141   $as_echo_n "(cached) " >&6
2142 else
2143   ac_build_alias=$build_alias
2144 test "x$ac_build_alias" = x &&
2145   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2146 test "x$ac_build_alias" = x &&
2147   { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
2148 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
2149    { (exit 1); exit 1; }; }
2150 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2151   { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
2152 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
2153    { (exit 1); exit 1; }; }
2154
2155 fi
2156 { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
2157 $as_echo "$ac_cv_build" >&6; }
2158 case $ac_cv_build in
2159 *-*-*) ;;
2160 *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
2161 $as_echo "$as_me: error: invalid value of canonical build" >&2;}
2162    { (exit 1); exit 1; }; };;
2163 esac
2164 build=$ac_cv_build
2165 ac_save_IFS=$IFS; IFS='-'
2166 set x $ac_cv_build
2167 shift
2168 build_cpu=$1
2169 build_vendor=$2
2170 shift; shift
2171 # Remember, the first character of IFS is used to create $*,
2172 # except with old shells:
2173 build_os=$*
2174 IFS=$ac_save_IFS
2175 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2176
2177
2178 { $as_echo "$as_me:$LINENO: checking host system type" >&5
2179 $as_echo_n "checking host system type... " >&6; }
2180 if test "${ac_cv_host+set}" = set; then
2181   $as_echo_n "(cached) " >&6
2182 else
2183   if test "x$host_alias" = x; then
2184   ac_cv_host=$ac_cv_build
2185 else
2186   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2187     { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
2188 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
2189    { (exit 1); exit 1; }; }
2190 fi
2191
2192 fi
2193 { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
2194 $as_echo "$ac_cv_host" >&6; }
2195 case $ac_cv_host in
2196 *-*-*) ;;
2197 *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
2198 $as_echo "$as_me: error: invalid value of canonical host" >&2;}
2199    { (exit 1); exit 1; }; };;
2200 esac
2201 host=$ac_cv_host
2202 ac_save_IFS=$IFS; IFS='-'
2203 set x $ac_cv_host
2204 shift
2205 host_cpu=$1
2206 host_vendor=$2
2207 shift; shift
2208 # Remember, the first character of IFS is used to create $*,
2209 # except with old shells:
2210 host_os=$*
2211 IFS=$ac_save_IFS
2212 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2213
2214
2215 { $as_echo "$as_me:$LINENO: checking target system type" >&5
2216 $as_echo_n "checking target system type... " >&6; }
2217 if test "${ac_cv_target+set}" = set; then
2218   $as_echo_n "(cached) " >&6
2219 else
2220   if test "x$target_alias" = x; then
2221   ac_cv_target=$ac_cv_host
2222 else
2223   ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
2224     { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
2225 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
2226    { (exit 1); exit 1; }; }
2227 fi
2228
2229 fi
2230 { $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
2231 $as_echo "$ac_cv_target" >&6; }
2232 case $ac_cv_target in
2233 *-*-*) ;;
2234 *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
2235 $as_echo "$as_me: error: invalid value of canonical target" >&2;}
2236    { (exit 1); exit 1; }; };;
2237 esac
2238 target=$ac_cv_target
2239 ac_save_IFS=$IFS; IFS='-'
2240 set x $ac_cv_target
2241 shift
2242 target_cpu=$1
2243 target_vendor=$2
2244 shift; shift
2245 # Remember, the first character of IFS is used to create $*,
2246 # except with old shells:
2247 target_os=$*
2248 IFS=$ac_save_IFS
2249 case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
2250
2251
2252 # The aliases save the names the user supplied, while $host etc.
2253 # will get canonicalized.
2254 test -n "$target_alias" &&
2255   test "$program_prefix$program_suffix$program_transform_name" = \
2256     NONENONEs,x,x, &&
2257   program_prefix=${target_alias}-
2258
2259 top_builddir="$abs_builddir"
2260
2261
2262
2263
2264
2265   { $as_echo "$as_me:$LINENO: checking for working mkdir -p" >&5
2266 $as_echo_n "checking for working mkdir -p... " >&6; }
2267 if test "${ac_cv_mkdir_p+set}" = set; then
2268   $as_echo_n "(cached) " >&6
2269 else
2270
2271     test -d conftestdir && rm -rf conftestdir
2272     mkdir -p conftestdir/somedir >/dev/null 2>&1
2273     if test -d conftestdir/somedir; then
2274       ac_cv_mkdir_p=yes
2275     else
2276       ac_cv_mkdir_p=no
2277     fi
2278     rm -rf conftestdir
2279
2280 fi
2281 { $as_echo "$as_me:$LINENO: result: $ac_cv_mkdir_p" >&5
2282 $as_echo "$ac_cv_mkdir_p" >&6; }
2283   if test "$ac_cv_mkdir_p" = "yes"; then
2284       mkdir_p="mkdir -p"
2285   else
2286       mkdir_p="$abs_srcdir/build/mkdir.sh"
2287   fi
2288
2289
2290 get_version="$abs_srcdir/build/get-version.sh"
2291 version_hdr="$abs_srcdir/include/apu_version.h"
2292 APRUTIL_MAJOR_VERSION="`$get_version major $version_hdr APU`"
2293 APRUTIL_DOTTED_VERSION="`$get_version all $version_hdr APU`"
2294
2295
2296
2297
2298 echo "APR-util Version: ${APRUTIL_DOTTED_VERSION}"
2299
2300
2301 # Check whether --enable-layout was given.
2302 if test "${enable_layout+set}" = set; then
2303   enableval=$enable_layout;
2304   LAYOUT=$enableval
2305
2306 fi
2307
2308
2309 if test -z "$LAYOUT"; then
2310   LAYOUT="apr-util"
2311 fi
2312
2313   if test ! -f $srcdir/config.layout; then
2314     echo "** Error: Layout file $srcdir/config.layout not found"
2315     echo "** Error: Cannot use undefined layout '$LAYOUT'"
2316     exit 1
2317   fi
2318   pldconf=./config.pld
2319
2320   sed -e "1s/[  ]*<[lL]ayout[   ]*$LAYOUT[      ]*>[    ]*//;1t" \
2321       -e "1,/[  ]*<[lL]ayout[   ]*$LAYOUT[      ]*>[    ]*/d" \
2322       -e '/[    ]*<\/Layout>[   ]*/,$d' \
2323       -e "s/^[  ]*//g" \
2324       -e "s/:[  ]*/=\'/g" \
2325       -e "s/[   ]*$/'/g" \
2326       $srcdir/config.layout > $pldconf
2327   layout_name=$LAYOUT
2328   if test ! -s $pldconf; then
2329     echo "** Error: unable to find layout $layout_name"
2330     exit 1
2331   fi
2332   . $pldconf
2333   rm $pldconf
2334   for var in prefix exec_prefix bindir sbindir libexecdir mandir \
2335              sysconfdir datadir includedir localstatedir runtimedir \
2336              logfiledir libdir installbuilddir libsuffix ; do
2337     eval "val=\"\$$var\""
2338     case $val in
2339       *+)
2340         val=`echo $val | sed -e 's;\+$;;'`
2341         eval "$var=\"\$val\""
2342         autosuffix=yes
2343         ;;
2344       *)
2345         autosuffix=no
2346         ;;
2347     esac
2348     val=`echo $val | sed -e 's:\(.\)/*$:\1:'`
2349     val=`echo $val | sed -e 's:[\$]\([a-z_]*\):$\1:g'`
2350     if test "$autosuffix" = "yes"; then
2351       if echo $val | grep apache >/dev/null; then
2352         addtarget=no
2353       else
2354         addtarget=yes
2355       fi
2356       if test "$addtarget" = "yes"; then
2357         val="$val/apache2"
2358       fi
2359     fi
2360     eval "$var='$val'"
2361   done
2362
2363
2364
2365 { $as_echo "$as_me:$LINENO: checking for chosen layout" >&5
2366 $as_echo_n "checking for chosen layout... " >&6; }
2367 { $as_echo "$as_me:$LINENO: result: $layout_name" >&5
2368 $as_echo "$layout_name" >&6; }
2369
2370
2371 ac_prev=
2372 # Retrieve the command-line arguments.  The eval is needed because
2373 # the arguments are quoted to preserve accuracy.
2374 eval "set x $ac_configure_args"
2375 shift
2376 for ac_option
2377 do
2378   # If the previous option needs an argument, assign it.
2379   if test -n "$ac_prev"; then
2380     eval "$ac_prev=\$ac_option"
2381     ac_prev=
2382     continue
2383   fi
2384
2385   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
2386
2387   case $ac_option in
2388
2389   -bindir | --bindir | --bindi | --bind | --bin | --bi)
2390     ac_prev=bindir ;;
2391   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
2392     bindir="$ac_optarg" ;;
2393
2394   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
2395     ac_prev=datadir ;;
2396   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
2397   | --da=*)
2398     datadir="$ac_optarg" ;;
2399
2400   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
2401   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
2402   | --exec | --exe | --ex)
2403     ac_prev=exec_prefix ;;
2404   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
2405   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
2406   | --exec=* | --exe=* | --ex=*)
2407     exec_prefix="$ac_optarg" ;;
2408
2409   -includedir | --includedir | --includedi | --included | --include \
2410   | --includ | --inclu | --incl | --inc)
2411     ac_prev=includedir ;;
2412   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
2413   | --includ=* | --inclu=* | --incl=* | --inc=*)
2414     includedir="$ac_optarg" ;;
2415
2416   -infodir | --infodir | --infodi | --infod | --info | --inf)
2417     ac_prev=infodir ;;
2418   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
2419     infodir="$ac_optarg" ;;
2420
2421   -libdir | --libdir | --libdi | --libd)
2422     ac_prev=libdir ;;
2423   -libdir=* | --libdir=* | --libdi=* | --libd=*)
2424     libdir="$ac_optarg" ;;
2425
2426   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
2427   | --libexe | --libex | --libe)
2428     ac_prev=libexecdir ;;
2429   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
2430   | --libexe=* | --libex=* | --libe=*)
2431     libexecdir="$ac_optarg" ;;
2432
2433   -localstatedir | --localstatedir | --localstatedi | --localstated \
2434   | --localstate | --localstat | --localsta | --localst \
2435   | --locals | --local | --loca | --loc | --lo)
2436     ac_prev=localstatedir ;;
2437   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
2438   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
2439   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
2440     localstatedir="$ac_optarg" ;;
2441
2442   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
2443     ac_prev=mandir ;;
2444   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
2445     mandir="$ac_optarg" ;;
2446
2447   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
2448     ac_prev=prefix ;;
2449   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
2450     prefix="$ac_optarg" ;;
2451
2452   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
2453     ac_prev=sbindir ;;
2454   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
2455   | --sbi=* | --sb=*)
2456     sbindir="$ac_optarg" ;;
2457
2458   -sharedstatedir | --sharedstatedir | --sharedstatedi \
2459   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
2460   | --sharedst | --shareds | --shared | --share | --shar \
2461   | --sha | --sh)
2462     ac_prev=sharedstatedir ;;
2463   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
2464   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
2465   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
2466   | --sha=* | --sh=*)
2467     sharedstatedir="$ac_optarg" ;;
2468
2469   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
2470   | --syscon | --sysco | --sysc | --sys | --sy)
2471     ac_prev=sysconfdir ;;
2472   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
2473   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
2474     sysconfdir="$ac_optarg" ;;
2475
2476   esac
2477 done
2478
2479 # Be sure to have absolute paths.
2480 for ac_var in exec_prefix prefix
2481 do
2482   eval ac_val=$`echo $ac_var`
2483   case $ac_val in
2484     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
2485     *)  { { $as_echo "$as_me:$LINENO: error: expected an absolute path for --$ac_var: $ac_val" >&5
2486 $as_echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2;}
2487    { (exit 1); exit 1; }; };;
2488   esac
2489 done
2490
2491
2492
2493
2494 if test "x$apu_preload_done" != "xyes" ; then
2495     apu_preload_done="yes"
2496
2497     echo "Applying apr-util hints file rules for $host"
2498
2499     case "$host" in
2500     *-dec-osf*)
2501
2502   if test -z "$apu_crypt_threadsafe"; then
2503     echo "  setting apu_crypt_threadsafe to \"1\""
2504     apu_crypt_threadsafe="1"
2505   fi
2506
2507         ;;
2508     *-hp-hpux11.*)
2509
2510   if test -z "$apu_crypt_threadsafe"; then
2511     echo "  setting apu_crypt_threadsafe to \"1\""
2512     apu_crypt_threadsafe="1"
2513   fi
2514
2515         ;;
2516     *-ibm-aix4*|*-ibm-aix5.1*)
2517
2518   if test -z "$apu_iconv_inbuf_const"; then
2519     echo "  setting apu_iconv_inbuf_const to \"1\""
2520     apu_iconv_inbuf_const="1"
2521   fi
2522
2523         ;;
2524     *-ibm-os390)
2525
2526   if test -z "$apu_crypt_threadsafe"; then
2527     echo "  setting apu_crypt_threadsafe to \"1\""
2528     apu_crypt_threadsafe="1"
2529   fi
2530
2531         ;;
2532     *-solaris2*)
2533
2534   if test -z "$apu_iconv_inbuf_const"; then
2535     echo "  setting apu_iconv_inbuf_const to \"1\""
2536     apu_iconv_inbuf_const="1"
2537   fi
2538
2539
2540   if test -z "$apu_crypt_threadsafe"; then
2541     echo "  setting apu_crypt_threadsafe to \"1\""
2542     apu_crypt_threadsafe="1"
2543   fi
2544
2545         ;;
2546     *-sco3.2v5*)
2547
2548   if test -z "$apu_db_xtra_libs"; then
2549     echo "  setting apu_db_xtra_libs to \"-lsocket\""
2550     apu_db_xtra_libs="-lsocket"
2551   fi
2552
2553         ;;
2554     esac
2555
2556 fi
2557
2558
2559
2560 APRUTIL_INCLUDES=""
2561 APRUTIL_PRIV_INCLUDES="-I$top_builddir/include -I$top_builddir/include/private"
2562 if test -n "$USE_VPATH"; then
2563     APRUTIL_PRIV_INCLUDES="$APRUTIL_PRIV_INCLUDES -I$abs_srcdir/include/private -I$abs_srcdir/include"
2564 fi
2565
2566
2567
2568
2569   apr_found="no"
2570
2571   if test "$ac_cv_emxos2" = "yes"; then
2572     # Scripts don't pass test -x on OS/2
2573     TEST_X="test -f"
2574   else
2575     TEST_X="test -x"
2576   fi
2577
2578   { $as_echo "$as_me:$LINENO: checking for APR" >&5
2579 $as_echo_n "checking for APR... " >&6; }
2580
2581 # Check whether --with-apr was given.
2582 if test "${with_apr+set}" = set; then
2583   withval=$with_apr;
2584     if test "$withval" = "no" || test "$withval" = "yes"; then
2585       { { $as_echo "$as_me:$LINENO: error: --with-apr requires a directory to be provided" >&5
2586 $as_echo "$as_me: error: --with-apr requires a directory to be provided" >&2;}
2587    { (exit 1); exit 1; }; }
2588     fi
2589
2590     if $TEST_X "$withval/bin/apr-config"; then
2591       apr_found="yes"
2592       apr_config="$withval/bin/apr-config"
2593     elif $TEST_X "$withval/apr-config"; then
2594       apr_found="yes"
2595       apr_config="$withval/apr-config"
2596     elif $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
2597       apr_found="yes"
2598       apr_config="$withval"
2599     fi
2600
2601         if test "$apr_found" != "yes"; then
2602       { { $as_echo "$as_me:$LINENO: error: the --with-apr parameter is incorrect. It must specify an install prefix, a
2603 build directory, or an apr-config file." >&5
2604 $as_echo "$as_me: error: the --with-apr parameter is incorrect. It must specify an install prefix, a
2605 build directory, or an apr-config file." >&2;}
2606    { (exit 1); exit 1; }; }
2607     fi
2608
2609 else
2610
2611         if test -d ""; then
2612       apr_temp_abs_srcdir="`cd  && pwd`"
2613       apr_found="reconfig"
2614       if test -n ""; then
2615         apr_config="/apr-config"
2616       else
2617         apr_config="/apr-config"
2618       fi
2619     fi
2620     if test "$apr_found" = "no" && test -n "" && test "" = "1"; then
2621       if apr-config --help > /dev/null 2>&1 ; then
2622         apr_found="yes"
2623         apr_config="apr-config"
2624       else
2625                 for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do
2626           if $TEST_X "$lookdir/bin/apr-config"; then
2627             apr_found="yes"
2628             apr_config="$lookdir/bin/apr-config"
2629             break
2630           fi
2631         done
2632       fi
2633     fi
2634
2635 fi
2636
2637
2638   { $as_echo "$as_me:$LINENO: result: $apr_found" >&5
2639 $as_echo "$apr_found" >&6; }
2640
2641   if test "$apr_found" = "no"; then
2642     { { $as_echo "$as_me:$LINENO: error: APR could not be located. Please use the --with-apr option." >&5
2643 $as_echo "$as_me: error: APR could not be located. Please use the --with-apr option." >&2;}
2644    { (exit 1); exit 1; }; }
2645   fi
2646
2647   APR_BUILD_DIR="`$apr_config --installbuilddir`"
2648
2649       APR_BUILD_DIR="`cd $APR_BUILD_DIR && pwd`"
2650
2651   APR_INCLUDES="`$apr_config --includes`"
2652   APR_LIBS="`$apr_config --link-libtool --libs`"
2653   APR_SO_EXT="`$apr_config --apr-so-ext`"
2654   APR_LIB_TARGET="`$apr_config --apr-lib-target`"
2655
2656
2657
2658
2659
2660
2661
2662   if test -z "$CC"; then
2663     echo "  setting CC to \"`$apr_config --cc`\""
2664     CC="`$apr_config --cc`"
2665   fi
2666
2667
2668   if test -z "$CPP"; then
2669     echo "  setting CPP to \"`$apr_config --cpp`\""
2670     CPP="`$apr_config --cpp`"
2671   fi
2672
2673
2674   if test "x$CFLAGS" = "x"; then
2675     echo "  setting CFLAGS to \"`$apr_config --cflags`\""
2676     CFLAGS="`$apr_config --cflags`"
2677   else
2678     apr_addto_bugger="`$apr_config --cflags`"
2679     for i in $apr_addto_bugger; do
2680       apr_addto_duplicate="0"
2681       for j in $CFLAGS; do
2682         if test "x$i" = "x$j"; then
2683           apr_addto_duplicate="1"
2684           break
2685         fi
2686       done
2687       if test $apr_addto_duplicate = "0"; then
2688         echo "  adding \"$i\" to CFLAGS"
2689         CFLAGS="$CFLAGS $i"
2690       fi
2691     done
2692   fi
2693
2694
2695   if test "x$CPPFLAGS" = "x"; then
2696     echo "  setting CPPFLAGS to \"`$apr_config --cppflags`\""
2697     CPPFLAGS="`$apr_config --cppflags`"
2698   else
2699     apr_addto_bugger="`$apr_config --cppflags`"
2700     for i in $apr_addto_bugger; do
2701       apr_addto_duplicate="0"
2702       for j in $CPPFLAGS; do
2703         if test "x$i" = "x$j"; then
2704           apr_addto_duplicate="1"
2705           break
2706         fi
2707       done
2708       if test $apr_addto_duplicate = "0"; then
2709         echo "  adding \"$i\" to CPPFLAGS"
2710         CPPFLAGS="$CPPFLAGS $i"
2711       fi
2712     done
2713   fi
2714
2715
2716 ac_ext=c
2717 ac_cpp='$CPP $CPPFLAGS'
2718 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2719 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2720 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2721 if test -n "$ac_tool_prefix"; then
2722   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
2723 set dummy ${ac_tool_prefix}gcc; ac_word=$2
2724 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2725 $as_echo_n "checking for $ac_word... " >&6; }
2726 if test "${ac_cv_prog_CC+set}" = set; then
2727   $as_echo_n "(cached) " >&6
2728 else
2729   if test -n "$CC"; then
2730   ac_cv_prog_CC="$CC" # Let the user override the test.
2731 else
2732 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2733 for as_dir in $PATH
2734 do
2735   IFS=$as_save_IFS
2736   test -z "$as_dir" && as_dir=.
2737   for ac_exec_ext in '' $ac_executable_extensions; do
2738   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2739     ac_cv_prog_CC="${ac_tool_prefix}gcc"
2740     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2741     break 2
2742   fi
2743 done
2744 done
2745 IFS=$as_save_IFS
2746
2747 fi
2748 fi
2749 CC=$ac_cv_prog_CC
2750 if test -n "$CC"; then
2751   { $as_echo "$as_me:$LINENO: result: $CC" >&5
2752 $as_echo "$CC" >&6; }
2753 else
2754   { $as_echo "$as_me:$LINENO: result: no" >&5
2755 $as_echo "no" >&6; }
2756 fi
2757
2758
2759 fi
2760 if test -z "$ac_cv_prog_CC"; then
2761   ac_ct_CC=$CC
2762   # Extract the first word of "gcc", so it can be a program name with args.
2763 set dummy gcc; ac_word=$2
2764 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2765 $as_echo_n "checking for $ac_word... " >&6; }
2766 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
2767   $as_echo_n "(cached) " >&6
2768 else
2769   if test -n "$ac_ct_CC"; then
2770   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2771 else
2772 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2773 for as_dir in $PATH
2774 do
2775   IFS=$as_save_IFS
2776   test -z "$as_dir" && as_dir=.
2777   for ac_exec_ext in '' $ac_executable_extensions; do
2778   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2779     ac_cv_prog_ac_ct_CC="gcc"
2780     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2781     break 2
2782   fi
2783 done
2784 done
2785 IFS=$as_save_IFS
2786
2787 fi
2788 fi
2789 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2790 if test -n "$ac_ct_CC"; then
2791   { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2792 $as_echo "$ac_ct_CC" >&6; }
2793 else
2794   { $as_echo "$as_me:$LINENO: result: no" >&5
2795 $as_echo "no" >&6; }
2796 fi
2797
2798   if test "x$ac_ct_CC" = x; then
2799     CC=""
2800   else
2801     case $cross_compiling:$ac_tool_warned in
2802 yes:)
2803 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
2804 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2805 ac_tool_warned=yes ;;
2806 esac
2807     CC=$ac_ct_CC
2808   fi
2809 else
2810   CC="$ac_cv_prog_CC"
2811 fi
2812
2813 if test -z "$CC"; then
2814           if test -n "$ac_tool_prefix"; then
2815     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2816 set dummy ${ac_tool_prefix}cc; ac_word=$2
2817 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2818 $as_echo_n "checking for $ac_word... " >&6; }
2819 if test "${ac_cv_prog_CC+set}" = set; then
2820   $as_echo_n "(cached) " >&6
2821 else
2822   if test -n "$CC"; then
2823   ac_cv_prog_CC="$CC" # Let the user override the test.
2824 else
2825 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2826 for as_dir in $PATH
2827 do
2828   IFS=$as_save_IFS
2829   test -z "$as_dir" && as_dir=.
2830   for ac_exec_ext in '' $ac_executable_extensions; do
2831   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2832     ac_cv_prog_CC="${ac_tool_prefix}cc"
2833     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2834     break 2
2835   fi
2836 done
2837 done
2838 IFS=$as_save_IFS
2839
2840 fi
2841 fi
2842 CC=$ac_cv_prog_CC
2843 if test -n "$CC"; then
2844   { $as_echo "$as_me:$LINENO: result: $CC" >&5
2845 $as_echo "$CC" >&6; }
2846 else
2847   { $as_echo "$as_me:$LINENO: result: no" >&5
2848 $as_echo "no" >&6; }
2849 fi
2850
2851
2852   fi
2853 fi
2854 if test -z "$CC"; then
2855   # Extract the first word of "cc", so it can be a program name with args.
2856 set dummy cc; ac_word=$2
2857 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2858 $as_echo_n "checking for $ac_word... " >&6; }
2859 if test "${ac_cv_prog_CC+set}" = set; then
2860   $as_echo_n "(cached) " >&6
2861 else
2862   if test -n "$CC"; then
2863   ac_cv_prog_CC="$CC" # Let the user override the test.
2864 else
2865   ac_prog_rejected=no
2866 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2867 for as_dir in $PATH
2868 do
2869   IFS=$as_save_IFS
2870   test -z "$as_dir" && as_dir=.
2871   for ac_exec_ext in '' $ac_executable_extensions; do
2872   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2873     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
2874        ac_prog_rejected=yes
2875        continue
2876      fi
2877     ac_cv_prog_CC="cc"
2878     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2879     break 2
2880   fi
2881 done
2882 done
2883 IFS=$as_save_IFS
2884
2885 if test $ac_prog_rejected = yes; then
2886   # We found a bogon in the path, so make sure we never use it.
2887   set dummy $ac_cv_prog_CC
2888   shift
2889   if test $# != 0; then
2890     # We chose a different compiler from the bogus one.
2891     # However, it has the same basename, so the bogon will be chosen
2892     # first if we set CC to just the basename; use the full file name.
2893     shift
2894     ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
2895   fi
2896 fi
2897 fi
2898 fi
2899 CC=$ac_cv_prog_CC
2900 if test -n "$CC"; then
2901   { $as_echo "$as_me:$LINENO: result: $CC" >&5
2902 $as_echo "$CC" >&6; }
2903 else
2904   { $as_echo "$as_me:$LINENO: result: no" >&5
2905 $as_echo "no" >&6; }
2906 fi
2907
2908
2909 fi
2910 if test -z "$CC"; then
2911   if test -n "$ac_tool_prefix"; then
2912   for ac_prog in cl.exe
2913   do
2914     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
2915 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
2916 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2917 $as_echo_n "checking for $ac_word... " >&6; }
2918 if test "${ac_cv_prog_CC+set}" = set; then
2919   $as_echo_n "(cached) " >&6
2920 else
2921   if test -n "$CC"; then
2922   ac_cv_prog_CC="$CC" # Let the user override the test.
2923 else
2924 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2925 for as_dir in $PATH
2926 do
2927   IFS=$as_save_IFS
2928   test -z "$as_dir" && as_dir=.
2929   for ac_exec_ext in '' $ac_executable_extensions; do
2930   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2931     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
2932     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2933     break 2
2934   fi
2935 done
2936 done
2937 IFS=$as_save_IFS
2938
2939 fi
2940 fi
2941 CC=$ac_cv_prog_CC
2942 if test -n "$CC"; then
2943   { $as_echo "$as_me:$LINENO: result: $CC" >&5
2944 $as_echo "$CC" >&6; }
2945 else
2946   { $as_echo "$as_me:$LINENO: result: no" >&5
2947 $as_echo "no" >&6; }
2948 fi
2949
2950
2951     test -n "$CC" && break
2952   done
2953 fi
2954 if test -z "$CC"; then
2955   ac_ct_CC=$CC
2956   for ac_prog in cl.exe
2957 do
2958   # Extract the first word of "$ac_prog", so it can be a program name with args.
2959 set dummy $ac_prog; ac_word=$2
2960 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2961 $as_echo_n "checking for $ac_word... " >&6; }
2962 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
2963   $as_echo_n "(cached) " >&6
2964 else
2965   if test -n "$ac_ct_CC"; then
2966   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2967 else
2968 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2969 for as_dir in $PATH
2970 do
2971   IFS=$as_save_IFS
2972   test -z "$as_dir" && as_dir=.
2973   for ac_exec_ext in '' $ac_executable_extensions; do
2974   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2975     ac_cv_prog_ac_ct_CC="$ac_prog"
2976     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2977     break 2
2978   fi
2979 done
2980 done
2981 IFS=$as_save_IFS
2982
2983 fi
2984 fi
2985 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2986 if test -n "$ac_ct_CC"; then
2987   { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2988 $as_echo "$ac_ct_CC" >&6; }
2989 else
2990   { $as_echo "$as_me:$LINENO: result: no" >&5
2991 $as_echo "no" >&6; }
2992 fi
2993
2994
2995   test -n "$ac_ct_CC" && break
2996 done
2997
2998   if test "x$ac_ct_CC" = x; then
2999     CC=""
3000   else
3001     case $cross_compiling:$ac_tool_warned in
3002 yes:)
3003 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
3004 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3005 ac_tool_warned=yes ;;
3006 esac
3007     CC=$ac_ct_CC
3008   fi
3009 fi
3010
3011 fi
3012
3013
3014 test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3015 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3016 { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
3017 See \`config.log' for more details." >&5
3018 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH
3019 See \`config.log' for more details." >&2;}
3020    { (exit 1); exit 1; }; }; }
3021
3022 # Provide some information about the compiler.
3023 $as_echo "$as_me:$LINENO: checking for C compiler version" >&5
3024 set X $ac_compile
3025 ac_compiler=$2
3026 { (ac_try="$ac_compiler --version >&5"
3027 case "(($ac_try" in
3028   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3029   *) ac_try_echo=$ac_try;;
3030 esac
3031 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3032 $as_echo "$ac_try_echo") >&5
3033   (eval "$ac_compiler --version >&5") 2>&5
3034   ac_status=$?
3035   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3036   (exit $ac_status); }
3037 { (ac_try="$ac_compiler -v >&5"
3038 case "(($ac_try" in
3039   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3040   *) ac_try_echo=$ac_try;;
3041 esac
3042 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3043 $as_echo "$ac_try_echo") >&5
3044   (eval "$ac_compiler -v >&5") 2>&5
3045   ac_status=$?
3046   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3047   (exit $ac_status); }
3048 { (ac_try="$ac_compiler -V >&5"
3049 case "(($ac_try" in
3050   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3051   *) ac_try_echo=$ac_try;;
3052 esac
3053 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3054 $as_echo "$ac_try_echo") >&5
3055   (eval "$ac_compiler -V >&5") 2>&5
3056   ac_status=$?
3057   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3058   (exit $ac_status); }
3059
3060 cat >conftest.$ac_ext <<_ACEOF
3061 /* confdefs.h.  */
3062 _ACEOF
3063 cat confdefs.h >>conftest.$ac_ext
3064 cat >>conftest.$ac_ext <<_ACEOF
3065 /* end confdefs.h.  */
3066
3067 int
3068 main ()
3069 {
3070
3071   ;
3072   return 0;
3073 }
3074 _ACEOF
3075 ac_clean_files_save=$ac_clean_files
3076 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3077 # Try to create an executable without -o first, disregard a.out.
3078 # It will help us diagnose broken compilers, and finding out an intuition
3079 # of exeext.
3080 { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
3081 $as_echo_n "checking for C compiler default output file name... " >&6; }
3082 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3083
3084 # The possible output files:
3085 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3086
3087 ac_rmfiles=
3088 for ac_file in $ac_files
3089 do
3090   case $ac_file in
3091     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3092     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3093   esac
3094 done
3095 rm -f $ac_rmfiles
3096
3097 if { (ac_try="$ac_link_default"
3098 case "(($ac_try" in
3099   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3100   *) ac_try_echo=$ac_try;;
3101 esac
3102 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3103 $as_echo "$ac_try_echo") >&5
3104   (eval "$ac_link_default") 2>&5
3105   ac_status=$?
3106   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3107   (exit $ac_status); }; then
3108   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3109 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3110 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
3111 # so that the user can short-circuit this test for compilers unknown to
3112 # Autoconf.
3113 for ac_file in $ac_files ''
3114 do
3115   test -f "$ac_file" || continue
3116   case $ac_file in
3117     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3118         ;;
3119     [ab].out )
3120         # We found the default executable, but exeext='' is most
3121         # certainly right.
3122         break;;
3123     *.* )
3124         if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3125         then :; else
3126            ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3127         fi
3128         # We set ac_cv_exeext here because the later test for it is not
3129         # safe: cross compilers may not add the suffix if given an `-o'
3130         # argument, so we may need to know it at that point already.
3131         # Even if this section looks crufty: it has the advantage of
3132         # actually working.
3133         break;;
3134     * )
3135         break;;
3136   esac
3137 done
3138 test "$ac_cv_exeext" = no && ac_cv_exeext=
3139
3140 else
3141   ac_file=''
3142 fi
3143
3144 { $as_echo "$as_me:$LINENO: result: $ac_file" >&5
3145 $as_echo "$ac_file" >&6; }
3146 if test -z "$ac_file"; then
3147   $as_echo "$as_me: failed program was:" >&5
3148 sed 's/^/| /' conftest.$ac_ext >&5
3149
3150 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3151 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3152 { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
3153 See \`config.log' for more details." >&5
3154 $as_echo "$as_me: error: C compiler cannot create executables
3155 See \`config.log' for more details." >&2;}
3156    { (exit 77); exit 77; }; }; }
3157 fi
3158
3159 ac_exeext=$ac_cv_exeext
3160
3161 # Check that the compiler produces executables we can run.  If not, either
3162 # the compiler is broken, or we cross compile.
3163 { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
3164 $as_echo_n "checking whether the C compiler works... " >&6; }
3165 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
3166 # If not cross compiling, check that we can run a simple program.
3167 if test "$cross_compiling" != yes; then
3168   if { ac_try='./$ac_file'
3169   { (case "(($ac_try" in
3170   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3171   *) ac_try_echo=$ac_try;;
3172 esac
3173 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3174 $as_echo "$ac_try_echo") >&5
3175   (eval "$ac_try") 2>&5
3176   ac_status=$?
3177   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3178   (exit $ac_status); }; }; then
3179     cross_compiling=no
3180   else
3181     if test "$cross_compiling" = maybe; then
3182         cross_compiling=yes
3183     else
3184         { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3185 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3186 { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
3187 If you meant to cross compile, use \`--host'.
3188 See \`config.log' for more details." >&5
3189 $as_echo "$as_me: error: cannot run C compiled programs.
3190 If you meant to cross compile, use \`--host'.
3191 See \`config.log' for more details." >&2;}
3192    { (exit 1); exit 1; }; }; }
3193     fi
3194   fi
3195 fi
3196 { $as_echo "$as_me:$LINENO: result: yes" >&5
3197 $as_echo "yes" >&6; }
3198
3199 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3200 ac_clean_files=$ac_clean_files_save
3201 # Check that the compiler produces executables we can run.  If not, either
3202 # the compiler is broken, or we cross compile.
3203 { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
3204 $as_echo_n "checking whether we are cross compiling... " >&6; }
3205 { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
3206 $as_echo "$cross_compiling" >&6; }
3207
3208 { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
3209 $as_echo_n "checking for suffix of executables... " >&6; }
3210 if { (ac_try="$ac_link"
3211 case "(($ac_try" in
3212   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3213   *) ac_try_echo=$ac_try;;
3214 esac
3215 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3216 $as_echo "$ac_try_echo") >&5
3217   (eval "$ac_link") 2>&5
3218   ac_status=$?
3219   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3220   (exit $ac_status); }; then
3221   # If both `conftest.exe' and `conftest' are `present' (well, observable)
3222 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
3223 # work properly (i.e., refer to `conftest.exe'), while it won't with
3224 # `rm'.
3225 for ac_file in conftest.exe conftest conftest.*; do
3226   test -f "$ac_file" || continue
3227   case $ac_file in
3228     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3229     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3230           break;;
3231     * ) break;;
3232   esac
3233 done
3234 else
3235   { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3236 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3237 { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
3238 See \`config.log' for more details." >&5
3239 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
3240 See \`config.log' for more details." >&2;}
3241    { (exit 1); exit 1; }; }; }
3242 fi
3243
3244 rm -f conftest$ac_cv_exeext
3245 { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
3246 $as_echo "$ac_cv_exeext" >&6; }
3247
3248 rm -f conftest.$ac_ext
3249 EXEEXT=$ac_cv_exeext
3250 ac_exeext=$EXEEXT
3251 { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
3252 $as_echo_n "checking for suffix of object files... " >&6; }
3253 if test "${ac_cv_objext+set}" = set; then
3254   $as_echo_n "(cached) " >&6
3255 else
3256   cat >conftest.$ac_ext <<_ACEOF
3257 /* confdefs.h.  */
3258 _ACEOF
3259 cat confdefs.h >>conftest.$ac_ext
3260 cat >>conftest.$ac_ext <<_ACEOF
3261 /* end confdefs.h.  */
3262
3263 int
3264 main ()
3265 {
3266
3267   ;
3268   return 0;
3269 }
3270 _ACEOF
3271 rm -f conftest.o conftest.obj
3272 if { (ac_try="$ac_compile"
3273 case "(($ac_try" in
3274   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3275   *) ac_try_echo=$ac_try;;
3276 esac
3277 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3278 $as_echo "$ac_try_echo") >&5
3279   (eval "$ac_compile") 2>&5
3280   ac_status=$?
3281   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3282   (exit $ac_status); }; then
3283   for ac_file in conftest.o conftest.obj conftest.*; do
3284   test -f "$ac_file" || continue;
3285   case $ac_file in
3286     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
3287     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
3288        break;;
3289   esac
3290 done
3291 else
3292   $as_echo "$as_me: failed program was:" >&5
3293 sed 's/^/| /' conftest.$ac_ext >&5
3294
3295 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3296 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3297 { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
3298 See \`config.log' for more details." >&5
3299 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
3300 See \`config.log' for more details." >&2;}
3301    { (exit 1); exit 1; }; }; }
3302 fi
3303
3304 rm -f conftest.$ac_cv_objext conftest.$ac_ext
3305 fi
3306 { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
3307 $as_echo "$ac_cv_objext" >&6; }
3308 OBJEXT=$ac_cv_objext
3309 ac_objext=$OBJEXT
3310 { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
3311 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3312 if test "${ac_cv_c_compiler_gnu+set}" = set; then
3313   $as_echo_n "(cached) " >&6
3314 else
3315   cat >conftest.$ac_ext <<_ACEOF
3316 /* confdefs.h.  */
3317 _ACEOF
3318 cat confdefs.h >>conftest.$ac_ext
3319 cat >>conftest.$ac_ext <<_ACEOF
3320 /* end confdefs.h.  */
3321
3322 int
3323 main ()
3324 {
3325 #ifndef __GNUC__
3326        choke me
3327 #endif
3328
3329   ;
3330   return 0;
3331 }
3332 _ACEOF
3333 rm -f conftest.$ac_objext
3334 if { (ac_try="$ac_compile"
3335 case "(($ac_try" in
3336   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3337   *) ac_try_echo=$ac_try;;
3338 esac
3339 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3340 $as_echo "$ac_try_echo") >&5
3341   (eval "$ac_compile") 2>conftest.er1
3342   ac_status=$?
3343   grep -v '^ *+' conftest.er1 >conftest.err
3344   rm -f conftest.er1
3345   cat conftest.err >&5
3346   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3347   (exit $ac_status); } && {
3348          test -z "$ac_c_werror_flag" ||
3349          test ! -s conftest.err
3350        } && test -s conftest.$ac_objext; then
3351   ac_compiler_gnu=yes
3352 else
3353   $as_echo "$as_me: failed program was:" >&5
3354 sed 's/^/| /' conftest.$ac_ext >&5
3355
3356         ac_compiler_gnu=no
3357 fi
3358
3359 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3360 ac_cv_c_compiler_gnu=$ac_compiler_gnu
3361
3362 fi
3363 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
3364 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
3365 if test $ac_compiler_gnu = yes; then
3366   GCC=yes
3367 else
3368   GCC=
3369 fi
3370 ac_test_CFLAGS=${CFLAGS+set}
3371 ac_save_CFLAGS=$CFLAGS
3372 { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
3373 $as_echo_n "checking whether $CC accepts -g... " >&6; }
3374 if test "${ac_cv_prog_cc_g+set}" = set; then
3375   $as_echo_n "(cached) " >&6
3376 else
3377   ac_save_c_werror_flag=$ac_c_werror_flag
3378    ac_c_werror_flag=yes
3379    ac_cv_prog_cc_g=no
3380    CFLAGS="-g"
3381    cat >conftest.$ac_ext <<_ACEOF
3382 /* confdefs.h.  */
3383 _ACEOF
3384 cat confdefs.h >>conftest.$ac_ext
3385 cat >>conftest.$ac_ext <<_ACEOF
3386 /* end confdefs.h.  */
3387
3388 int
3389 main ()
3390 {
3391
3392   ;
3393   return 0;
3394 }
3395 _ACEOF
3396 rm -f conftest.$ac_objext
3397 if { (ac_try="$ac_compile"
3398 case "(($ac_try" in
3399   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3400   *) ac_try_echo=$ac_try;;
3401 esac
3402 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3403 $as_echo "$ac_try_echo") >&5
3404   (eval "$ac_compile") 2>conftest.er1
3405   ac_status=$?
3406   grep -v '^ *+' conftest.er1 >conftest.err
3407   rm -f conftest.er1
3408   cat conftest.err >&5
3409   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3410   (exit $ac_status); } && {
3411          test -z "$ac_c_werror_flag" ||
3412          test ! -s conftest.err
3413        } && test -s conftest.$ac_objext; then
3414   ac_cv_prog_cc_g=yes
3415 else
3416   $as_echo "$as_me: failed program was:" >&5
3417 sed 's/^/| /' conftest.$ac_ext >&5
3418
3419         CFLAGS=""
3420       cat >conftest.$ac_ext <<_ACEOF
3421 /* confdefs.h.  */
3422 _ACEOF
3423 cat confdefs.h >>conftest.$ac_ext
3424 cat >>conftest.$ac_ext <<_ACEOF
3425 /* end confdefs.h.  */
3426
3427 int
3428 main ()
3429 {
3430
3431   ;
3432   return 0;
3433 }
3434 _ACEOF
3435 rm -f conftest.$ac_objext
3436 if { (ac_try="$ac_compile"
3437 case "(($ac_try" in
3438   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3439   *) ac_try_echo=$ac_try;;
3440 esac
3441 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3442 $as_echo "$ac_try_echo") >&5
3443   (eval "$ac_compile") 2>conftest.er1
3444   ac_status=$?
3445   grep -v '^ *+' conftest.er1 >conftest.err
3446   rm -f conftest.er1
3447   cat conftest.err >&5
3448   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3449   (exit $ac_status); } && {
3450          test -z "$ac_c_werror_flag" ||
3451          test ! -s conftest.err
3452        } && test -s conftest.$ac_objext; then
3453   :
3454 else
3455   $as_echo "$as_me: failed program was:" >&5
3456 sed 's/^/| /' conftest.$ac_ext >&5
3457
3458         ac_c_werror_flag=$ac_save_c_werror_flag
3459          CFLAGS="-g"
3460          cat >conftest.$ac_ext <<_ACEOF
3461 /* confdefs.h.  */
3462 _ACEOF
3463 cat confdefs.h >>conftest.$ac_ext
3464 cat >>conftest.$ac_ext <<_ACEOF
3465 /* end confdefs.h.  */
3466
3467 int
3468 main ()
3469 {
3470
3471   ;
3472   return 0;
3473 }
3474 _ACEOF
3475 rm -f conftest.$ac_objext
3476 if { (ac_try="$ac_compile"
3477 case "(($ac_try" in
3478   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3479   *) ac_try_echo=$ac_try;;
3480 esac
3481 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3482 $as_echo "$ac_try_echo") >&5
3483   (eval "$ac_compile") 2>conftest.er1
3484   ac_status=$?
3485   grep -v '^ *+' conftest.er1 >conftest.err
3486   rm -f conftest.er1
3487   cat conftest.err >&5
3488   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3489   (exit $ac_status); } && {
3490          test -z "$ac_c_werror_flag" ||
3491          test ! -s conftest.err
3492        } && test -s conftest.$ac_objext; then
3493   ac_cv_prog_cc_g=yes
3494 else
3495   $as_echo "$as_me: failed program was:" >&5
3496 sed 's/^/| /' conftest.$ac_ext >&5
3497
3498
3499 fi
3500
3501 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3502 fi
3503
3504 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3505 fi
3506
3507 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3508    ac_c_werror_flag=$ac_save_c_werror_flag
3509 fi
3510 { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
3511 $as_echo "$ac_cv_prog_cc_g" >&6; }
3512 if test "$ac_test_CFLAGS" = set; then
3513   CFLAGS=$ac_save_CFLAGS
3514 elif test $ac_cv_prog_cc_g = yes; then
3515   if test "$GCC" = yes; then
3516     CFLAGS="-g -O2"
3517   else
3518     CFLAGS="-g"
3519   fi
3520 else
3521   if test "$GCC" = yes; then
3522     CFLAGS="-O2"
3523   else
3524     CFLAGS=
3525   fi
3526 fi
3527 { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
3528 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3529 if test "${ac_cv_prog_cc_c89+set}" = set; then
3530   $as_echo_n "(cached) " >&6
3531 else
3532   ac_cv_prog_cc_c89=no
3533 ac_save_CC=$CC
3534 cat >conftest.$ac_ext <<_ACEOF
3535 /* confdefs.h.  */
3536 _ACEOF
3537 cat confdefs.h >>conftest.$ac_ext
3538 cat >>conftest.$ac_ext <<_ACEOF
3539 /* end confdefs.h.  */
3540 #include <stdarg.h>
3541 #include <stdio.h>
3542 #include <sys/types.h>
3543 #include <sys/stat.h>
3544 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3545 struct buf { int x; };
3546 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3547 static char *e (p, i)
3548      char **p;
3549      int i;
3550 {
3551   return p[i];
3552 }
3553 static char *f (char * (*g) (char **, int), char **p, ...)
3554 {
3555   char *s;
3556   va_list v;
3557   va_start (v,p);
3558   s = g (p, va_arg (v,int));
3559   va_end (v);
3560   return s;
3561 }
3562
3563 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
3564    function prototypes and stuff, but not '\xHH' hex character constants.
3565    These don't provoke an error unfortunately, instead are silently treated
3566    as 'x'.  The following induces an error, until -std is added to get
3567    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
3568    array size at least.  It's necessary to write '\x00'==0 to get something
3569    that's true only with -std.  */
3570 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3571
3572 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
3573    inside strings and character constants.  */
3574 #define FOO(x) 'x'
3575 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
3576
3577 int test (int i, double x);
3578 struct s1 {int (*f) (int a);};
3579 struct s2 {int (*f) (double a);};
3580 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3581 int argc;
3582 char **argv;
3583 int
3584 main ()
3585 {
3586 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3587   ;
3588   return 0;
3589 }
3590 _ACEOF
3591 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
3592         -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3593 do
3594   CC="$ac_save_CC $ac_arg"
3595   rm -f conftest.$ac_objext
3596 if { (ac_try="$ac_compile"
3597 case "(($ac_try" in
3598   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3599   *) ac_try_echo=$ac_try;;
3600 esac
3601 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3602 $as_echo "$ac_try_echo") >&5
3603   (eval "$ac_compile") 2>conftest.er1
3604   ac_status=$?
3605   grep -v '^ *+' conftest.er1 >conftest.err
3606   rm -f conftest.er1
3607   cat conftest.err >&5
3608   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3609   (exit $ac_status); } && {
3610          test -z "$ac_c_werror_flag" ||
3611          test ! -s conftest.err
3612        } && test -s conftest.$ac_objext; then
3613   ac_cv_prog_cc_c89=$ac_arg
3614 else
3615   $as_echo "$as_me: failed program was:" >&5
3616 sed 's/^/| /' conftest.$ac_ext >&5
3617
3618
3619 fi
3620
3621 rm -f core conftest.err conftest.$ac_objext
3622   test "x$ac_cv_prog_cc_c89" != "xno" && break
3623 done
3624 rm -f conftest.$ac_ext
3625 CC=$ac_save_CC
3626
3627 fi
3628 # AC_CACHE_VAL
3629 case "x$ac_cv_prog_cc_c89" in
3630   x)
3631     { $as_echo "$as_me:$LINENO: result: none needed" >&5
3632 $as_echo "none needed" >&6; } ;;
3633   xno)
3634     { $as_echo "$as_me:$LINENO: result: unsupported" >&5
3635 $as_echo "unsupported" >&6; } ;;
3636   *)
3637     CC="$CC $ac_cv_prog_cc_c89"
3638     { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
3639 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
3640 esac
3641
3642
3643 ac_ext=c
3644 ac_cpp='$CPP $CPPFLAGS'
3645 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3646 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3647 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3648
3649
3650 ac_ext=c
3651 ac_cpp='$CPP $CPPFLAGS'
3652 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3653 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3654 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3655 { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
3656 $as_echo_n "checking how to run the C preprocessor... " >&6; }
3657 # On Suns, sometimes $CPP names a directory.
3658 if test -n "$CPP" && test -d "$CPP"; then
3659   CPP=
3660 fi
3661 if test -z "$CPP"; then
3662   if test "${ac_cv_prog_CPP+set}" = set; then
3663   $as_echo_n "(cached) " >&6
3664 else
3665       # Double quotes because CPP needs to be expanded
3666     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3667     do
3668       ac_preproc_ok=false
3669 for ac_c_preproc_warn_flag in '' yes
3670 do
3671   # Use a header file that comes with gcc, so configuring glibc
3672   # with a fresh cross-compiler works.
3673   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3674   # <limits.h> exists even on freestanding compilers.
3675   # On the NeXT, cc -E runs the code through the compiler's parser,
3676   # not just through cpp. "Syntax error" is here to catch this case.
3677   cat >conftest.$ac_ext <<_ACEOF
3678 /* confdefs.h.  */
3679 _ACEOF
3680 cat confdefs.h >>conftest.$ac_ext
3681 cat >>conftest.$ac_ext <<_ACEOF
3682 /* end confdefs.h.  */
3683 #ifdef __STDC__
3684 # include <limits.h>
3685 #else
3686 # include <assert.h>
3687 #endif
3688                      Syntax error
3689 _ACEOF
3690 if { (ac_try="$ac_cpp conftest.$ac_ext"
3691 case "(($ac_try" in
3692   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3693   *) ac_try_echo=$ac_try;;
3694 esac
3695 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3696 $as_echo "$ac_try_echo") >&5
3697   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
3698   ac_status=$?
3699   grep -v '^ *+' conftest.er1 >conftest.err
3700   rm -f conftest.er1
3701   cat conftest.err >&5
3702   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3703   (exit $ac_status); } >/dev/null && {
3704          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
3705          test ! -s conftest.err
3706        }; then
3707   :
3708 else
3709   $as_echo "$as_me: failed program was:" >&5
3710 sed 's/^/| /' conftest.$ac_ext >&5
3711
3712   # Broken: fails on valid input.
3713 continue
3714 fi
3715
3716 rm -f conftest.err conftest.$ac_ext
3717
3718   # OK, works on sane cases.  Now check whether nonexistent headers
3719   # can be detected and how.
3720   cat >conftest.$ac_ext <<_ACEOF
3721 /* confdefs.h.  */
3722 _ACEOF
3723 cat confdefs.h >>conftest.$ac_ext
3724 cat >>conftest.$ac_ext <<_ACEOF
3725 /* end confdefs.h.  */
3726 #include <ac_nonexistent.h>
3727 _ACEOF
3728 if { (ac_try="$ac_cpp conftest.$ac_ext"
3729 case "(($ac_try" in
3730   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3731   *) ac_try_echo=$ac_try;;
3732 esac
3733 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3734 $as_echo "$ac_try_echo") >&5
3735   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
3736   ac_status=$?
3737   grep -v '^ *+' conftest.er1 >conftest.err
3738   rm -f conftest.er1
3739   cat conftest.err >&5
3740   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3741   (exit $ac_status); } >/dev/null && {
3742          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
3743          test ! -s conftest.err
3744        }; then
3745   # Broken: success on invalid input.
3746 continue
3747 else
3748   $as_echo "$as_me: failed program was:" >&5
3749 sed 's/^/| /' conftest.$ac_ext >&5
3750
3751   # Passes both tests.
3752 ac_preproc_ok=:
3753 break
3754 fi
3755
3756 rm -f conftest.err conftest.$ac_ext
3757
3758 done
3759 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3760 rm -f conftest.err conftest.$ac_ext
3761 if $ac_preproc_ok; then
3762   break
3763 fi
3764
3765     done
3766     ac_cv_prog_CPP=$CPP
3767
3768 fi
3769   CPP=$ac_cv_prog_CPP
3770 else
3771   ac_cv_prog_CPP=$CPP
3772 fi
3773 { $as_echo "$as_me:$LINENO: result: $CPP" >&5
3774 $as_echo "$CPP" >&6; }
3775 ac_preproc_ok=false
3776 for ac_c_preproc_warn_flag in '' yes
3777 do
3778   # Use a header file that comes with gcc, so configuring glibc
3779   # with a fresh cross-compiler works.
3780   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3781   # <limits.h> exists even on freestanding compilers.
3782   # On the NeXT, cc -E runs the code through the compiler's parser,
3783   # not just through cpp. "Syntax error" is here to catch this case.
3784   cat >conftest.$ac_ext <<_ACEOF
3785 /* confdefs.h.  */
3786 _ACEOF
3787 cat confdefs.h >>conftest.$ac_ext
3788 cat >>conftest.$ac_ext <<_ACEOF
3789 /* end confdefs.h.  */
3790 #ifdef __STDC__
3791 # include <limits.h>
3792 #else
3793 # include <assert.h>
3794 #endif
3795                      Syntax error
3796 _ACEOF
3797 if { (ac_try="$ac_cpp conftest.$ac_ext"
3798 case "(($ac_try" in
3799   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3800   *) ac_try_echo=$ac_try;;
3801 esac
3802 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3803 $as_echo "$ac_try_echo") >&5
3804   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
3805   ac_status=$?
3806   grep -v '^ *+' conftest.er1 >conftest.err
3807   rm -f conftest.er1
3808   cat conftest.err >&5
3809   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3810   (exit $ac_status); } >/dev/null && {
3811          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
3812          test ! -s conftest.err
3813        }; then
3814   :
3815 else
3816   $as_echo "$as_me: failed program was:" >&5
3817 sed 's/^/| /' conftest.$ac_ext >&5
3818
3819   # Broken: fails on valid input.
3820 continue
3821 fi
3822
3823 rm -f conftest.err conftest.$ac_ext
3824
3825   # OK, works on sane cases.  Now check whether nonexistent headers
3826   # can be detected and how.
3827   cat >conftest.$ac_ext <<_ACEOF
3828 /* confdefs.h.  */
3829 _ACEOF
3830 cat confdefs.h >>conftest.$ac_ext
3831 cat >>conftest.$ac_ext <<_ACEOF
3832 /* end confdefs.h.  */
3833 #include <ac_nonexistent.h>
3834 _ACEOF
3835 if { (ac_try="$ac_cpp conftest.$ac_ext"
3836 case "(($ac_try" in
3837   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3838   *) ac_try_echo=$ac_try;;
3839 esac
3840 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3841 $as_echo "$ac_try_echo") >&5
3842   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
3843   ac_status=$?
3844   grep -v '^ *+' conftest.er1 >conftest.err
3845   rm -f conftest.er1
3846   cat conftest.err >&5
3847   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3848   (exit $ac_status); } >/dev/null && {
3849          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
3850          test ! -s conftest.err
3851        }; then
3852   # Broken: success on invalid input.
3853 continue
3854 else
3855   $as_echo "$as_me: failed program was:" >&5
3856 sed 's/^/| /' conftest.$ac_ext >&5
3857
3858   # Passes both tests.
3859 ac_preproc_ok=:
3860 break
3861 fi
3862
3863 rm -f conftest.err conftest.$ac_ext
3864
3865 done
3866 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3867 rm -f conftest.err conftest.$ac_ext
3868 if $ac_preproc_ok; then
3869   :
3870 else
3871   { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3872 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3873 { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
3874 See \`config.log' for more details." >&5
3875 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
3876 See \`config.log' for more details." >&2;}
3877    { (exit 1); exit 1; }; }; }
3878 fi
3879
3880 ac_ext=c
3881 ac_cpp='$CPP $CPPFLAGS'
3882 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3883 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3884 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3885
3886
3887 { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
3888 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
3889 if test "${ac_cv_path_GREP+set}" = set; then
3890   $as_echo_n "(cached) " >&6
3891 else
3892   if test -z "$GREP"; then
3893   ac_path_GREP_found=false
3894   # Loop through the user's path and test for each of PROGNAME-LIST
3895   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3896 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3897 do
3898   IFS=$as_save_IFS
3899   test -z "$as_dir" && as_dir=.
3900   for ac_prog in grep ggrep; do
3901     for ac_exec_ext in '' $ac_executable_extensions; do
3902       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
3903       { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
3904 # Check for GNU ac_path_GREP and select it if it is found.
3905   # Check for GNU $ac_path_GREP
3906 case `"$ac_path_GREP" --version 2>&1` in
3907 *GNU*)
3908   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
3909 *)
3910   ac_count=0
3911   $as_echo_n 0123456789 >"conftest.in"
3912   while :
3913   do
3914     cat "conftest.in" "conftest.in" >"conftest.tmp"
3915     mv "conftest.tmp" "conftest.in"
3916     cp "conftest.in" "conftest.nl"
3917     $as_echo 'GREP' >> "conftest.nl"
3918     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
3919     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
3920     ac_count=`expr $ac_count + 1`
3921     if test $ac_count -gt ${ac_path_GREP_max-0}; then
3922       # Best one so far, save it but keep looking for a better one
3923       ac_cv_path_GREP="$ac_path_GREP"
3924       ac_path_GREP_max=$ac_count
3925     fi
3926     # 10*(2^10) chars as input seems more than enough
3927     test $ac_count -gt 10 && break
3928   done
3929   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
3930 esac
3931
3932       $ac_path_GREP_found && break 3
3933     done
3934   done
3935 done
3936 IFS=$as_save_IFS
3937   if test -z "$ac_cv_path_GREP"; then
3938     { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
3939 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
3940    { (exit 1); exit 1; }; }
3941   fi
3942 else
3943   ac_cv_path_GREP=$GREP
3944 fi
3945
3946 fi
3947 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
3948 $as_echo "$ac_cv_path_GREP" >&6; }
3949  GREP="$ac_cv_path_GREP"
3950
3951
3952 { $as_echo "$as_me:$LINENO: checking for egrep" >&5
3953 $as_echo_n "checking for egrep... " >&6; }
3954 if test "${ac_cv_path_EGREP+set}" = set; then
3955   $as_echo_n "(cached) " >&6
3956 else
3957   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
3958    then ac_cv_path_EGREP="$GREP -E"
3959    else
3960      if test -z "$EGREP"; then
3961   ac_path_EGREP_found=false
3962   # Loop through the user's path and test for each of PROGNAME-LIST
3963   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3964 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3965 do
3966   IFS=$as_save_IFS
3967   test -z "$as_dir" && as_dir=.
3968   for ac_prog in egrep; do
3969     for ac_exec_ext in '' $ac_executable_extensions; do
3970       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
3971       { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
3972 # Check for GNU ac_path_EGREP and select it if it is found.
3973   # Check for GNU $ac_path_EGREP
3974 case `"$ac_path_EGREP" --version 2>&1` in
3975 *GNU*)
3976   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
3977 *)
3978   ac_count=0
3979   $as_echo_n 0123456789 >"conftest.in"
3980   while :
3981   do
3982     cat "conftest.in" "conftest.in" >"conftest.tmp"
3983     mv "conftest.tmp" "conftest.in"
3984     cp "conftest.in" "conftest.nl"
3985     $as_echo 'EGREP' >> "conftest.nl"
3986     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
3987     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
3988     ac_count=`expr $ac_count + 1`
3989     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
3990       # Best one so far, save it but keep looking for a better one
3991       ac_cv_path_EGREP="$ac_path_EGREP"
3992       ac_path_EGREP_max=$ac_count
3993     fi
3994     # 10*(2^10) chars as input seems more than enough
3995     test $ac_count -gt 10 && break
3996   done
3997   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
3998 esac
3999
4000       $ac_path_EGREP_found && break 3
4001     done
4002   done
4003 done
4004 IFS=$as_save_IFS
4005   if test -z "$ac_cv_path_EGREP"; then
4006     { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
4007 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
4008    { (exit 1); exit 1; }; }
4009   fi
4010 else
4011   ac_cv_path_EGREP=$EGREP
4012 fi
4013
4014    fi
4015 fi
4016 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
4017 $as_echo "$ac_cv_path_EGREP" >&6; }
4018  EGREP="$ac_cv_path_EGREP"
4019
4020
4021 { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
4022 $as_echo_n "checking for ANSI C header files... " >&6; }
4023 if test "${ac_cv_header_stdc+set}" = set; then
4024   $as_echo_n "(cached) " >&6
4025 else
4026   cat >conftest.$ac_ext <<_ACEOF
4027 /* confdefs.h.  */
4028 _ACEOF
4029 cat confdefs.h >>conftest.$ac_ext
4030 cat >>conftest.$ac_ext <<_ACEOF
4031 /* end confdefs.h.  */
4032 #include <stdlib.h>
4033 #include <stdarg.h>
4034 #include <string.h>
4035 #include <float.h>
4036
4037 int
4038 main ()
4039 {
4040
4041   ;
4042   return 0;
4043 }
4044 _ACEOF
4045 rm -f conftest.$ac_objext
4046 if { (ac_try="$ac_compile"
4047 case "(($ac_try" in
4048   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4049   *) ac_try_echo=$ac_try;;
4050 esac
4051 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4052 $as_echo "$ac_try_echo") >&5
4053   (eval "$ac_compile") 2>conftest.er1
4054   ac_status=$?
4055   grep -v '^ *+' conftest.er1 >conftest.err
4056   rm -f conftest.er1
4057   cat conftest.err >&5
4058   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4059   (exit $ac_status); } && {
4060          test -z "$ac_c_werror_flag" ||
4061          test ! -s conftest.err
4062        } && test -s conftest.$ac_objext; then
4063   ac_cv_header_stdc=yes
4064 else
4065   $as_echo "$as_me: failed program was:" >&5
4066 sed 's/^/| /' conftest.$ac_ext >&5
4067
4068         ac_cv_header_stdc=no
4069 fi
4070
4071 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4072
4073 if test $ac_cv_header_stdc = yes; then
4074   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4075   cat >conftest.$ac_ext <<_ACEOF
4076 /* confdefs.h.  */
4077 _ACEOF
4078 cat confdefs.h >>conftest.$ac_ext
4079 cat >>conftest.$ac_ext <<_ACEOF
4080 /* end confdefs.h.  */
4081 #include <string.h>
4082
4083 _ACEOF
4084 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4085   $EGREP "memchr" >/dev/null 2>&1; then
4086   :
4087 else
4088   ac_cv_header_stdc=no
4089 fi
4090 rm -f conftest*
4091
4092 fi
4093
4094 if test $ac_cv_header_stdc = yes; then
4095   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4096   cat >conftest.$ac_ext <<_ACEOF
4097 /* confdefs.h.  */
4098 _ACEOF
4099 cat confdefs.h >>conftest.$ac_ext
4100 cat >>conftest.$ac_ext <<_ACEOF
4101 /* end confdefs.h.  */
4102 #include <stdlib.h>
4103
4104 _ACEOF
4105 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4106   $EGREP "free" >/dev/null 2>&1; then
4107   :
4108 else
4109   ac_cv_header_stdc=no
4110 fi
4111 rm -f conftest*
4112
4113 fi
4114
4115 if test $ac_cv_header_stdc = yes; then
4116   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4117   if test "$cross_compiling" = yes; then
4118   :
4119 else
4120   cat >conftest.$ac_ext <<_ACEOF
4121 /* confdefs.h.  */
4122 _ACEOF
4123 cat confdefs.h >>conftest.$ac_ext
4124 cat >>conftest.$ac_ext <<_ACEOF
4125 /* end confdefs.h.  */
4126 #include <ctype.h>
4127 #include <stdlib.h>
4128 #if ((' ' & 0x0FF) == 0x020)
4129 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4130 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4131 #else
4132 # define ISLOWER(c) \
4133                    (('a' <= (c) && (c) <= 'i') \
4134                      || ('j' <= (c) && (c) <= 'r') \
4135                      || ('s' <= (c) && (c) <= 'z'))
4136 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
4137 #endif
4138
4139 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4140 int
4141 main ()
4142 {
4143   int i;
4144   for (i = 0; i < 256; i++)
4145     if (XOR (islower (i), ISLOWER (i))
4146         || toupper (i) != TOUPPER (i))
4147       return 2;
4148   return 0;
4149 }
4150 _ACEOF
4151 rm -f conftest$ac_exeext
4152 if { (ac_try="$ac_link"
4153 case "(($ac_try" in
4154   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4155   *) ac_try_echo=$ac_try;;
4156 esac
4157 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4158 $as_echo "$ac_try_echo") >&5
4159   (eval "$ac_link") 2>&5
4160   ac_status=$?
4161   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4162   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4163   { (case "(($ac_try" in
4164   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4165   *) ac_try_echo=$ac_try;;
4166 esac
4167 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4168 $as_echo "$ac_try_echo") >&5
4169   (eval "$ac_try") 2>&5
4170   ac_status=$?
4171   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4172   (exit $ac_status); }; }; then
4173   :
4174 else
4175   $as_echo "$as_me: program exited with status $ac_status" >&5
4176 $as_echo "$as_me: failed program was:" >&5
4177 sed 's/^/| /' conftest.$ac_ext >&5
4178
4179 ( exit $ac_status )
4180 ac_cv_header_stdc=no
4181 fi
4182 rm -rf conftest.dSYM
4183 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4184 fi
4185
4186
4187 fi
4188 fi
4189 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
4190 $as_echo "$ac_cv_header_stdc" >&6; }
4191 if test $ac_cv_header_stdc = yes; then
4192
4193 cat >>confdefs.h <<\_ACEOF
4194 #define STDC_HEADERS 1
4195 _ACEOF
4196
4197 fi
4198
4199 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
4210                   inttypes.h stdint.h unistd.h
4211 do
4212 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
4213 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
4214 $as_echo_n "checking for $ac_header... " >&6; }
4215 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
4216   $as_echo_n "(cached) " >&6
4217 else
4218   cat >conftest.$ac_ext <<_ACEOF
4219 /* confdefs.h.  */
4220 _ACEOF
4221 cat confdefs.h >>conftest.$ac_ext
4222 cat >>conftest.$ac_ext <<_ACEOF
4223 /* end confdefs.h.  */
4224 $ac_includes_default
4225
4226 #include <$ac_header>
4227 _ACEOF
4228 rm -f conftest.$ac_objext
4229 if { (ac_try="$ac_compile"
4230 case "(($ac_try" in
4231   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4232   *) ac_try_echo=$ac_try;;
4233 esac
4234 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4235 $as_echo "$ac_try_echo") >&5
4236   (eval "$ac_compile") 2>conftest.er1
4237   ac_status=$?
4238   grep -v '^ *+' conftest.er1 >conftest.err
4239   rm -f conftest.er1
4240   cat conftest.err >&5
4241   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4242   (exit $ac_status); } && {
4243          test -z "$ac_c_werror_flag" ||
4244          test ! -s conftest.err
4245        } && test -s conftest.$ac_objext; then
4246   eval "$as_ac_Header=yes"
4247 else
4248   $as_echo "$as_me: failed program was:" >&5
4249 sed 's/^/| /' conftest.$ac_ext >&5
4250
4251         eval "$as_ac_Header=no"
4252 fi
4253
4254 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4255 fi
4256 ac_res=`eval 'as_val=${'$as_ac_Header'}
4257                  $as_echo "$as_val"'`
4258                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4259 $as_echo "$ac_res" >&6; }
4260 as_val=`eval 'as_val=${'$as_ac_Header'}
4261                  $as_echo "$as_val"'`
4262    if test "x$as_val" = x""yes; then
4263   cat >>confdefs.h <<_ACEOF
4264 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
4265 _ACEOF
4266
4267 fi
4268
4269 done
4270
4271
4272
4273
4274 echo $ac_n "${nl}checking for ldap support..."
4275
4276 apu_has_ldap="0";
4277 apu_has_ldap_netscape_ssl="0"
4278 apu_has_ldap_starttls="0"
4279
4280
4281 # Check whether --with-ldap-include was given.
4282 if test "${with_ldap_include+set}" = set; then
4283   withval=$with_ldap_include;
4284 fi
4285
4286
4287 # Check whether --with-ldap-lib was given.
4288 if test "${with_ldap_lib+set}" = set; then
4289   withval=$with_ldap_lib;
4290 fi
4291
4292
4293 # Check whether --with-ldap was given.
4294 if test "${with_ldap+set}" = set; then
4295   withval=$with_ldap;
4296     save_cppflags="$CPPFLAGS"
4297     save_ldflags="$LDFLAGS"
4298     save_libs="$LIBS"
4299     if test -n "$with_ldap_include"; then
4300       CPPFLAGS="$CPPFLAGS -I$with_ldap_include"
4301
4302   if test "x$APRUTIL_INCLUDES" = "x"; then
4303     echo "  setting APRUTIL_INCLUDES to \"-I$with_ldap_include\""
4304     APRUTIL_INCLUDES="-I$with_ldap_include"
4305   else
4306     apr_addto_bugger="-I$with_ldap_include"
4307     for i in $apr_addto_bugger; do
4308       apr_addto_duplicate="0"
4309       for j in $APRUTIL_INCLUDES; do
4310         if test "x$i" = "x$j"; then
4311           apr_addto_duplicate="1"
4312           break
4313         fi
4314       done
4315       if test $apr_addto_duplicate = "0"; then
4316         echo "  adding \"$i\" to APRUTIL_INCLUDES"
4317         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
4318       fi
4319     done
4320   fi
4321
4322     fi
4323     if test -n "$with_ldap_lib"; then
4324       LDFLAGS="$LDFLAGS -L$with_ldap_lib"
4325
4326   if test "x$APRUTIL_LDFLAGS" = "x"; then
4327     echo "  setting APRUTIL_LDFLAGS to \"-L$with_ldap_lib\""
4328     APRUTIL_LDFLAGS="-L$with_ldap_lib"
4329   else
4330     apr_addto_bugger="-L$with_ldap_lib"
4331     for i in $apr_addto_bugger; do
4332       apr_addto_duplicate="0"
4333       for j in $APRUTIL_LDFLAGS; do
4334         if test "x$i" = "x$j"; then
4335           apr_addto_duplicate="1"
4336           break
4337         fi
4338       done
4339       if test $apr_addto_duplicate = "0"; then
4340         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
4341         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
4342       fi
4343     done
4344   fi
4345
4346     fi
4347
4348     LIBLDAP="$withval"
4349     if test "$LIBLDAP" = "yes"; then
4350
4351   if test ${apu_has_ldap} != "1"; then
4352     ldaplib="ldap50"
4353     extralib="-lnspr4 -lplc4 -lplds4 -liutil50 -llber50 -lldif50 -lnss3 -lprldap50 -lssl3 -lssldap50"
4354     unset ac_cv_lib_${ldaplib}_ldap_init
4355     unset ac_cv_lib_${ldaplib}___ldap_init
4356     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
4357 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
4358 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
4359 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
4360   $as_echo_n "(cached) " >&6
4361 else
4362   ac_check_lib_save_LIBS=$LIBS
4363 LIBS="-l${ldaplib} ${extralib} $LIBS"
4364 cat >conftest.$ac_ext <<_ACEOF
4365 /* confdefs.h.  */
4366 _ACEOF
4367 cat confdefs.h >>conftest.$ac_ext
4368 cat >>conftest.$ac_ext <<_ACEOF
4369 /* end confdefs.h.  */
4370
4371 /* Override any GCC internal prototype to avoid an error.
4372    Use char because int might match the return type of a GCC
4373    builtin and then its argument prototype would still apply.  */
4374 #ifdef __cplusplus
4375 extern "C"
4376 #endif
4377 char ldap_init ();
4378 int
4379 main ()
4380 {
4381 return ldap_init ();
4382   ;
4383   return 0;
4384 }
4385 _ACEOF
4386 rm -f conftest.$ac_objext conftest$ac_exeext
4387 if { (ac_try="$ac_link"
4388 case "(($ac_try" in
4389   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4390   *) ac_try_echo=$ac_try;;
4391 esac
4392 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4393 $as_echo "$ac_try_echo") >&5
4394   (eval "$ac_link") 2>conftest.er1
4395   ac_status=$?
4396   grep -v '^ *+' conftest.er1 >conftest.err
4397   rm -f conftest.er1
4398   cat conftest.err >&5
4399   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4400   (exit $ac_status); } && {
4401          test -z "$ac_c_werror_flag" ||
4402          test ! -s conftest.err
4403        } && test -s conftest$ac_exeext && {
4404          test "$cross_compiling" = yes ||
4405          $as_test_x conftest$ac_exeext
4406        }; then
4407   eval "$as_ac_Lib=yes"
4408 else
4409   $as_echo "$as_me: failed program was:" >&5
4410 sed 's/^/| /' conftest.$ac_ext >&5
4411
4412         eval "$as_ac_Lib=no"
4413 fi
4414
4415 rm -rf conftest.dSYM
4416 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
4417       conftest$ac_exeext conftest.$ac_ext
4418 LIBS=$ac_check_lib_save_LIBS
4419 fi
4420 ac_res=`eval 'as_val=${'$as_ac_Lib'}
4421                  $as_echo "$as_val"'`
4422                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4423 $as_echo "$ac_res" >&6; }
4424 as_val=`eval 'as_val=${'$as_ac_Lib'}
4425                  $as_echo "$as_val"'`
4426    if test "x$as_val" = x""yes; then
4427
4428
4429   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
4430     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
4431     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
4432   else
4433     apr_addto_bugger="-l${ldaplib} ${extralib}"
4434     for i in $apr_addto_bugger; do
4435       apr_addto_duplicate="0"
4436       for j in $APRUTIL_EXPORT_LIBS; do
4437         if test "x$i" = "x$j"; then
4438           apr_addto_duplicate="1"
4439           break
4440         fi
4441       done
4442       if test $apr_addto_duplicate = "0"; then
4443         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
4444         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
4445       fi
4446     done
4447   fi
4448
4449
4450   if test "x$APRUTIL_LIBS" = "x"; then
4451     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
4452     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
4453   else
4454     apr_addto_bugger="-l${ldaplib} ${extralib}"
4455     for i in $apr_addto_bugger; do
4456       apr_addto_duplicate="0"
4457       for j in $APRUTIL_LIBS; do
4458         if test "x$i" = "x$j"; then
4459           apr_addto_duplicate="1"
4460           break
4461         fi
4462       done
4463       if test $apr_addto_duplicate = "0"; then
4464         echo "  adding \"$i\" to APRUTIL_LIBS"
4465         APRUTIL_LIBS="$APRUTIL_LIBS $i"
4466       fi
4467     done
4468   fi
4469
4470         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
4471 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
4472 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
4473 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
4474   $as_echo_n "(cached) " >&6
4475 else
4476   ac_check_lib_save_LIBS=$LIBS
4477 LIBS="-l${ldaplib} ${extralib} $LIBS"
4478 cat >conftest.$ac_ext <<_ACEOF
4479 /* confdefs.h.  */
4480 _ACEOF
4481 cat confdefs.h >>conftest.$ac_ext
4482 cat >>conftest.$ac_ext <<_ACEOF
4483 /* end confdefs.h.  */
4484
4485 /* Override any GCC internal prototype to avoid an error.
4486    Use char because int might match the return type of a GCC
4487    builtin and then its argument prototype would still apply.  */
4488 #ifdef __cplusplus
4489 extern "C"
4490 #endif
4491 char ldapssl_install_routines ();
4492 int
4493 main ()
4494 {
4495 return ldapssl_install_routines ();
4496   ;
4497   return 0;
4498 }
4499 _ACEOF
4500 rm -f conftest.$ac_objext conftest$ac_exeext
4501 if { (ac_try="$ac_link"
4502 case "(($ac_try" in
4503   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4504   *) ac_try_echo=$ac_try;;
4505 esac
4506 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4507 $as_echo "$ac_try_echo") >&5
4508   (eval "$ac_link") 2>conftest.er1
4509   ac_status=$?
4510   grep -v '^ *+' conftest.er1 >conftest.err
4511   rm -f conftest.er1
4512   cat conftest.err >&5
4513   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4514   (exit $ac_status); } && {
4515          test -z "$ac_c_werror_flag" ||
4516          test ! -s conftest.err
4517        } && test -s conftest$ac_exeext && {
4518          test "$cross_compiling" = yes ||
4519          $as_test_x conftest$ac_exeext
4520        }; then
4521   eval "$as_ac_Lib=yes"
4522 else
4523   $as_echo "$as_me: failed program was:" >&5
4524 sed 's/^/| /' conftest.$ac_ext >&5
4525
4526         eval "$as_ac_Lib=no"
4527 fi
4528
4529 rm -rf conftest.dSYM
4530 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
4531       conftest$ac_exeext conftest.$ac_ext
4532 LIBS=$ac_check_lib_save_LIBS
4533 fi
4534 ac_res=`eval 'as_val=${'$as_ac_Lib'}
4535                  $as_echo "$as_val"'`
4536                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4537 $as_echo "$ac_res" >&6; }
4538 as_val=`eval 'as_val=${'$as_ac_Lib'}
4539                  $as_echo "$as_val"'`
4540    if test "x$as_val" = x""yes; then
4541   apu_has_ldap_netscape_ssl="1"
4542 fi
4543
4544         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
4545 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
4546 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
4547 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
4548   $as_echo_n "(cached) " >&6
4549 else
4550   ac_check_lib_save_LIBS=$LIBS
4551 LIBS="-l${ldaplib} ${extralib} $LIBS"
4552 cat >conftest.$ac_ext <<_ACEOF
4553 /* confdefs.h.  */
4554 _ACEOF
4555 cat confdefs.h >>conftest.$ac_ext
4556 cat >>conftest.$ac_ext <<_ACEOF
4557 /* end confdefs.h.  */
4558
4559 /* Override any GCC internal prototype to avoid an error.
4560    Use char because int might match the return type of a GCC
4561    builtin and then its argument prototype would still apply.  */
4562 #ifdef __cplusplus
4563 extern "C"
4564 #endif
4565 char ldap_start_tls_s ();
4566 int
4567 main ()
4568 {
4569 return ldap_start_tls_s ();
4570   ;
4571   return 0;
4572 }
4573 _ACEOF
4574 rm -f conftest.$ac_objext conftest$ac_exeext
4575 if { (ac_try="$ac_link"
4576 case "(($ac_try" in
4577   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4578   *) ac_try_echo=$ac_try;;
4579 esac
4580 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4581 $as_echo "$ac_try_echo") >&5
4582   (eval "$ac_link") 2>conftest.er1
4583   ac_status=$?
4584   grep -v '^ *+' conftest.er1 >conftest.err
4585   rm -f conftest.er1
4586   cat conftest.err >&5
4587   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4588   (exit $ac_status); } && {
4589          test -z "$ac_c_werror_flag" ||
4590          test ! -s conftest.err
4591        } && test -s conftest$ac_exeext && {
4592          test "$cross_compiling" = yes ||
4593          $as_test_x conftest$ac_exeext
4594        }; then
4595   eval "$as_ac_Lib=yes"
4596 else
4597   $as_echo "$as_me: failed program was:" >&5
4598 sed 's/^/| /' conftest.$ac_ext >&5
4599
4600         eval "$as_ac_Lib=no"
4601 fi
4602
4603 rm -rf conftest.dSYM
4604 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
4605       conftest$ac_exeext conftest.$ac_ext
4606 LIBS=$ac_check_lib_save_LIBS
4607 fi
4608 ac_res=`eval 'as_val=${'$as_ac_Lib'}
4609                  $as_echo "$as_val"'`
4610                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4611 $as_echo "$ac_res" >&6; }
4612 as_val=`eval 'as_val=${'$as_ac_Lib'}
4613                  $as_echo "$as_val"'`
4614    if test "x$as_val" = x""yes; then
4615   apu_has_ldap_starttls="1"
4616 fi
4617
4618         apu_has_ldap="1";
4619
4620 fi
4621
4622   fi
4623
4624
4625   if test ${apu_has_ldap} != "1"; then
4626     ldaplib="ldapssl41"
4627     extralib="-lnspr3 -lplc3 -lplds3"
4628     unset ac_cv_lib_${ldaplib}_ldap_init
4629     unset ac_cv_lib_${ldaplib}___ldap_init
4630     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
4631 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
4632 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
4633 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
4634   $as_echo_n "(cached) " >&6
4635 else
4636   ac_check_lib_save_LIBS=$LIBS
4637 LIBS="-l${ldaplib} ${extralib} $LIBS"
4638 cat >conftest.$ac_ext <<_ACEOF
4639 /* confdefs.h.  */
4640 _ACEOF
4641 cat confdefs.h >>conftest.$ac_ext
4642 cat >>conftest.$ac_ext <<_ACEOF
4643 /* end confdefs.h.  */
4644
4645 /* Override any GCC internal prototype to avoid an error.
4646    Use char because int might match the return type of a GCC
4647    builtin and then its argument prototype would still apply.  */
4648 #ifdef __cplusplus
4649 extern "C"
4650 #endif
4651 char ldap_init ();
4652 int
4653 main ()
4654 {
4655 return ldap_init ();
4656   ;
4657   return 0;
4658 }
4659 _ACEOF
4660 rm -f conftest.$ac_objext conftest$ac_exeext
4661 if { (ac_try="$ac_link"
4662 case "(($ac_try" in
4663   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4664   *) ac_try_echo=$ac_try;;
4665 esac
4666 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4667 $as_echo "$ac_try_echo") >&5
4668   (eval "$ac_link") 2>conftest.er1
4669   ac_status=$?
4670   grep -v '^ *+' conftest.er1 >conftest.err
4671   rm -f conftest.er1
4672   cat conftest.err >&5
4673   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4674   (exit $ac_status); } && {
4675          test -z "$ac_c_werror_flag" ||
4676          test ! -s conftest.err
4677        } && test -s conftest$ac_exeext && {
4678          test "$cross_compiling" = yes ||
4679          $as_test_x conftest$ac_exeext
4680        }; then
4681   eval "$as_ac_Lib=yes"
4682 else
4683   $as_echo "$as_me: failed program was:" >&5
4684 sed 's/^/| /' conftest.$ac_ext >&5
4685
4686         eval "$as_ac_Lib=no"
4687 fi
4688
4689 rm -rf conftest.dSYM
4690 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
4691       conftest$ac_exeext conftest.$ac_ext
4692 LIBS=$ac_check_lib_save_LIBS
4693 fi
4694 ac_res=`eval 'as_val=${'$as_ac_Lib'}
4695                  $as_echo "$as_val"'`
4696                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4697 $as_echo "$ac_res" >&6; }
4698 as_val=`eval 'as_val=${'$as_ac_Lib'}
4699                  $as_echo "$as_val"'`
4700    if test "x$as_val" = x""yes; then
4701
4702
4703   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
4704     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
4705     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
4706   else
4707     apr_addto_bugger="-l${ldaplib} ${extralib}"
4708     for i in $apr_addto_bugger; do
4709       apr_addto_duplicate="0"
4710       for j in $APRUTIL_EXPORT_LIBS; do
4711         if test "x$i" = "x$j"; then
4712           apr_addto_duplicate="1"
4713           break
4714         fi
4715       done
4716       if test $apr_addto_duplicate = "0"; then
4717         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
4718         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
4719       fi
4720     done
4721   fi
4722
4723
4724   if test "x$APRUTIL_LIBS" = "x"; then
4725     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
4726     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
4727   else
4728     apr_addto_bugger="-l${ldaplib} ${extralib}"
4729     for i in $apr_addto_bugger; do
4730       apr_addto_duplicate="0"
4731       for j in $APRUTIL_LIBS; do
4732         if test "x$i" = "x$j"; then
4733           apr_addto_duplicate="1"
4734           break
4735         fi
4736       done
4737       if test $apr_addto_duplicate = "0"; then
4738         echo "  adding \"$i\" to APRUTIL_LIBS"
4739         APRUTIL_LIBS="$APRUTIL_LIBS $i"
4740       fi
4741     done
4742   fi
4743
4744         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
4745 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
4746 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
4747 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
4748   $as_echo_n "(cached) " >&6
4749 else
4750   ac_check_lib_save_LIBS=$LIBS
4751 LIBS="-l${ldaplib} ${extralib} $LIBS"
4752 cat >conftest.$ac_ext <<_ACEOF
4753 /* confdefs.h.  */
4754 _ACEOF
4755 cat confdefs.h >>conftest.$ac_ext
4756 cat >>conftest.$ac_ext <<_ACEOF
4757 /* end confdefs.h.  */
4758
4759 /* Override any GCC internal prototype to avoid an error.
4760    Use char because int might match the return type of a GCC
4761    builtin and then its argument prototype would still apply.  */
4762 #ifdef __cplusplus
4763 extern "C"
4764 #endif
4765 char ldapssl_install_routines ();
4766 int
4767 main ()
4768 {
4769 return ldapssl_install_routines ();
4770   ;
4771   return 0;
4772 }
4773 _ACEOF
4774 rm -f conftest.$ac_objext conftest$ac_exeext
4775 if { (ac_try="$ac_link"
4776 case "(($ac_try" in
4777   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4778   *) ac_try_echo=$ac_try;;
4779 esac
4780 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4781 $as_echo "$ac_try_echo") >&5
4782   (eval "$ac_link") 2>conftest.er1
4783   ac_status=$?
4784   grep -v '^ *+' conftest.er1 >conftest.err
4785   rm -f conftest.er1
4786   cat conftest.err >&5
4787   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4788   (exit $ac_status); } && {
4789          test -z "$ac_c_werror_flag" ||
4790          test ! -s conftest.err
4791        } && test -s conftest$ac_exeext && {
4792          test "$cross_compiling" = yes ||
4793          $as_test_x conftest$ac_exeext
4794        }; then
4795   eval "$as_ac_Lib=yes"
4796 else
4797   $as_echo "$as_me: failed program was:" >&5
4798 sed 's/^/| /' conftest.$ac_ext >&5
4799
4800         eval "$as_ac_Lib=no"
4801 fi
4802
4803 rm -rf conftest.dSYM
4804 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
4805       conftest$ac_exeext conftest.$ac_ext
4806 LIBS=$ac_check_lib_save_LIBS
4807 fi
4808 ac_res=`eval 'as_val=${'$as_ac_Lib'}
4809                  $as_echo "$as_val"'`
4810                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4811 $as_echo "$ac_res" >&6; }
4812 as_val=`eval 'as_val=${'$as_ac_Lib'}
4813                  $as_echo "$as_val"'`
4814    if test "x$as_val" = x""yes; then
4815   apu_has_ldap_netscape_ssl="1"
4816 fi
4817
4818         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
4819 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
4820 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
4821 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
4822   $as_echo_n "(cached) " >&6
4823 else
4824   ac_check_lib_save_LIBS=$LIBS
4825 LIBS="-l${ldaplib} ${extralib} $LIBS"
4826 cat >conftest.$ac_ext <<_ACEOF
4827 /* confdefs.h.  */
4828 _ACEOF
4829 cat confdefs.h >>conftest.$ac_ext
4830 cat >>conftest.$ac_ext <<_ACEOF
4831 /* end confdefs.h.  */
4832
4833 /* Override any GCC internal prototype to avoid an error.
4834    Use char because int might match the return type of a GCC
4835    builtin and then its argument prototype would still apply.  */
4836 #ifdef __cplusplus
4837 extern "C"
4838 #endif
4839 char ldap_start_tls_s ();
4840 int
4841 main ()
4842 {
4843 return ldap_start_tls_s ();
4844   ;
4845   return 0;
4846 }
4847 _ACEOF
4848 rm -f conftest.$ac_objext conftest$ac_exeext
4849 if { (ac_try="$ac_link"
4850 case "(($ac_try" in
4851   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4852   *) ac_try_echo=$ac_try;;
4853 esac
4854 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4855 $as_echo "$ac_try_echo") >&5
4856   (eval "$ac_link") 2>conftest.er1
4857   ac_status=$?
4858   grep -v '^ *+' conftest.er1 >conftest.err
4859   rm -f conftest.er1
4860   cat conftest.err >&5
4861   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4862   (exit $ac_status); } && {
4863          test -z "$ac_c_werror_flag" ||
4864          test ! -s conftest.err
4865        } && test -s conftest$ac_exeext && {
4866          test "$cross_compiling" = yes ||
4867          $as_test_x conftest$ac_exeext
4868        }; then
4869   eval "$as_ac_Lib=yes"
4870 else
4871   $as_echo "$as_me: failed program was:" >&5
4872 sed 's/^/| /' conftest.$ac_ext >&5
4873
4874         eval "$as_ac_Lib=no"
4875 fi
4876
4877 rm -rf conftest.dSYM
4878 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
4879       conftest$ac_exeext conftest.$ac_ext
4880 LIBS=$ac_check_lib_save_LIBS
4881 fi
4882 ac_res=`eval 'as_val=${'$as_ac_Lib'}
4883                  $as_echo "$as_val"'`
4884                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4885 $as_echo "$ac_res" >&6; }
4886 as_val=`eval 'as_val=${'$as_ac_Lib'}
4887                  $as_echo "$as_val"'`
4888    if test "x$as_val" = x""yes; then
4889   apu_has_ldap_starttls="1"
4890 fi
4891
4892         apu_has_ldap="1";
4893
4894 fi
4895
4896   fi
4897
4898
4899   if test ${apu_has_ldap} != "1"; then
4900     ldaplib="ldapssl40"
4901     extralib=
4902     unset ac_cv_lib_${ldaplib}_ldap_init
4903     unset ac_cv_lib_${ldaplib}___ldap_init
4904     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
4905 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
4906 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
4907 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
4908   $as_echo_n "(cached) " >&6
4909 else
4910   ac_check_lib_save_LIBS=$LIBS
4911 LIBS="-l${ldaplib} ${extralib} $LIBS"
4912 cat >conftest.$ac_ext <<_ACEOF
4913 /* confdefs.h.  */
4914 _ACEOF
4915 cat confdefs.h >>conftest.$ac_ext
4916 cat >>conftest.$ac_ext <<_ACEOF
4917 /* end confdefs.h.  */
4918
4919 /* Override any GCC internal prototype to avoid an error.
4920    Use char because int might match the return type of a GCC
4921    builtin and then its argument prototype would still apply.  */
4922 #ifdef __cplusplus
4923 extern "C"
4924 #endif
4925 char ldap_init ();
4926 int
4927 main ()
4928 {
4929 return ldap_init ();
4930   ;
4931   return 0;
4932 }
4933 _ACEOF
4934 rm -f conftest.$ac_objext conftest$ac_exeext
4935 if { (ac_try="$ac_link"
4936 case "(($ac_try" in
4937   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4938   *) ac_try_echo=$ac_try;;
4939 esac
4940 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4941 $as_echo "$ac_try_echo") >&5
4942   (eval "$ac_link") 2>conftest.er1
4943   ac_status=$?
4944   grep -v '^ *+' conftest.er1 >conftest.err
4945   rm -f conftest.er1
4946   cat conftest.err >&5
4947   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4948   (exit $ac_status); } && {
4949          test -z "$ac_c_werror_flag" ||
4950          test ! -s conftest.err
4951        } && test -s conftest$ac_exeext && {
4952          test "$cross_compiling" = yes ||
4953          $as_test_x conftest$ac_exeext
4954        }; then
4955   eval "$as_ac_Lib=yes"
4956 else
4957   $as_echo "$as_me: failed program was:" >&5
4958 sed 's/^/| /' conftest.$ac_ext >&5
4959
4960         eval "$as_ac_Lib=no"
4961 fi
4962
4963 rm -rf conftest.dSYM
4964 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
4965       conftest$ac_exeext conftest.$ac_ext
4966 LIBS=$ac_check_lib_save_LIBS
4967 fi
4968 ac_res=`eval 'as_val=${'$as_ac_Lib'}
4969                  $as_echo "$as_val"'`
4970                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4971 $as_echo "$ac_res" >&6; }
4972 as_val=`eval 'as_val=${'$as_ac_Lib'}
4973                  $as_echo "$as_val"'`
4974    if test "x$as_val" = x""yes; then
4975
4976
4977   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
4978     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
4979     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
4980   else
4981     apr_addto_bugger="-l${ldaplib} ${extralib}"
4982     for i in $apr_addto_bugger; do
4983       apr_addto_duplicate="0"
4984       for j in $APRUTIL_EXPORT_LIBS; do
4985         if test "x$i" = "x$j"; then
4986           apr_addto_duplicate="1"
4987           break
4988         fi
4989       done
4990       if test $apr_addto_duplicate = "0"; then
4991         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
4992         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
4993       fi
4994     done
4995   fi
4996
4997
4998   if test "x$APRUTIL_LIBS" = "x"; then
4999     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
5000     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
5001   else
5002     apr_addto_bugger="-l${ldaplib} ${extralib}"
5003     for i in $apr_addto_bugger; do
5004       apr_addto_duplicate="0"
5005       for j in $APRUTIL_LIBS; do
5006         if test "x$i" = "x$j"; then
5007           apr_addto_duplicate="1"
5008           break
5009         fi
5010       done
5011       if test $apr_addto_duplicate = "0"; then
5012         echo "  adding \"$i\" to APRUTIL_LIBS"
5013         APRUTIL_LIBS="$APRUTIL_LIBS $i"
5014       fi
5015     done
5016   fi
5017
5018         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
5019 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
5020 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
5021 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5022   $as_echo_n "(cached) " >&6
5023 else
5024   ac_check_lib_save_LIBS=$LIBS
5025 LIBS="-l${ldaplib} ${extralib} $LIBS"
5026 cat >conftest.$ac_ext <<_ACEOF
5027 /* confdefs.h.  */
5028 _ACEOF
5029 cat confdefs.h >>conftest.$ac_ext
5030 cat >>conftest.$ac_ext <<_ACEOF
5031 /* end confdefs.h.  */
5032
5033 /* Override any GCC internal prototype to avoid an error.
5034    Use char because int might match the return type of a GCC
5035    builtin and then its argument prototype would still apply.  */
5036 #ifdef __cplusplus
5037 extern "C"
5038 #endif
5039 char ldapssl_install_routines ();
5040 int
5041 main ()
5042 {
5043 return ldapssl_install_routines ();
5044   ;
5045   return 0;
5046 }
5047 _ACEOF
5048 rm -f conftest.$ac_objext conftest$ac_exeext
5049 if { (ac_try="$ac_link"
5050 case "(($ac_try" in
5051   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5052   *) ac_try_echo=$ac_try;;
5053 esac
5054 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5055 $as_echo "$ac_try_echo") >&5
5056   (eval "$ac_link") 2>conftest.er1
5057   ac_status=$?
5058   grep -v '^ *+' conftest.er1 >conftest.err
5059   rm -f conftest.er1
5060   cat conftest.err >&5
5061   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5062   (exit $ac_status); } && {
5063          test -z "$ac_c_werror_flag" ||
5064          test ! -s conftest.err
5065        } && test -s conftest$ac_exeext && {
5066          test "$cross_compiling" = yes ||
5067          $as_test_x conftest$ac_exeext
5068        }; then
5069   eval "$as_ac_Lib=yes"
5070 else
5071   $as_echo "$as_me: failed program was:" >&5
5072 sed 's/^/| /' conftest.$ac_ext >&5
5073
5074         eval "$as_ac_Lib=no"
5075 fi
5076
5077 rm -rf conftest.dSYM
5078 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5079       conftest$ac_exeext conftest.$ac_ext
5080 LIBS=$ac_check_lib_save_LIBS
5081 fi
5082 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5083                  $as_echo "$as_val"'`
5084                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5085 $as_echo "$ac_res" >&6; }
5086 as_val=`eval 'as_val=${'$as_ac_Lib'}
5087                  $as_echo "$as_val"'`
5088    if test "x$as_val" = x""yes; then
5089   apu_has_ldap_netscape_ssl="1"
5090 fi
5091
5092         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
5093 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
5094 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
5095 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5096   $as_echo_n "(cached) " >&6
5097 else
5098   ac_check_lib_save_LIBS=$LIBS
5099 LIBS="-l${ldaplib} ${extralib} $LIBS"
5100 cat >conftest.$ac_ext <<_ACEOF
5101 /* confdefs.h.  */
5102 _ACEOF
5103 cat confdefs.h >>conftest.$ac_ext
5104 cat >>conftest.$ac_ext <<_ACEOF
5105 /* end confdefs.h.  */
5106
5107 /* Override any GCC internal prototype to avoid an error.
5108    Use char because int might match the return type of a GCC
5109    builtin and then its argument prototype would still apply.  */
5110 #ifdef __cplusplus
5111 extern "C"
5112 #endif
5113 char ldap_start_tls_s ();
5114 int
5115 main ()
5116 {
5117 return ldap_start_tls_s ();
5118   ;
5119   return 0;
5120 }
5121 _ACEOF
5122 rm -f conftest.$ac_objext conftest$ac_exeext
5123 if { (ac_try="$ac_link"
5124 case "(($ac_try" in
5125   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5126   *) ac_try_echo=$ac_try;;
5127 esac
5128 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5129 $as_echo "$ac_try_echo") >&5
5130   (eval "$ac_link") 2>conftest.er1
5131   ac_status=$?
5132   grep -v '^ *+' conftest.er1 >conftest.err
5133   rm -f conftest.er1
5134   cat conftest.err >&5
5135   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5136   (exit $ac_status); } && {
5137          test -z "$ac_c_werror_flag" ||
5138          test ! -s conftest.err
5139        } && test -s conftest$ac_exeext && {
5140          test "$cross_compiling" = yes ||
5141          $as_test_x conftest$ac_exeext
5142        }; then
5143   eval "$as_ac_Lib=yes"
5144 else
5145   $as_echo "$as_me: failed program was:" >&5
5146 sed 's/^/| /' conftest.$ac_ext >&5
5147
5148         eval "$as_ac_Lib=no"
5149 fi
5150
5151 rm -rf conftest.dSYM
5152 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5153       conftest$ac_exeext conftest.$ac_ext
5154 LIBS=$ac_check_lib_save_LIBS
5155 fi
5156 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5157                  $as_echo "$as_val"'`
5158                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5159 $as_echo "$ac_res" >&6; }
5160 as_val=`eval 'as_val=${'$as_ac_Lib'}
5161                  $as_echo "$as_val"'`
5162    if test "x$as_val" = x""yes; then
5163   apu_has_ldap_starttls="1"
5164 fi
5165
5166         apu_has_ldap="1";
5167
5168 fi
5169
5170   fi
5171
5172
5173   if test ${apu_has_ldap} != "1"; then
5174     ldaplib="ldapssl30"
5175     extralib=
5176     unset ac_cv_lib_${ldaplib}_ldap_init
5177     unset ac_cv_lib_${ldaplib}___ldap_init
5178     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
5179 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
5180 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
5181 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5182   $as_echo_n "(cached) " >&6
5183 else
5184   ac_check_lib_save_LIBS=$LIBS
5185 LIBS="-l${ldaplib} ${extralib} $LIBS"
5186 cat >conftest.$ac_ext <<_ACEOF
5187 /* confdefs.h.  */
5188 _ACEOF
5189 cat confdefs.h >>conftest.$ac_ext
5190 cat >>conftest.$ac_ext <<_ACEOF
5191 /* end confdefs.h.  */
5192
5193 /* Override any GCC internal prototype to avoid an error.
5194    Use char because int might match the return type of a GCC
5195    builtin and then its argument prototype would still apply.  */
5196 #ifdef __cplusplus
5197 extern "C"
5198 #endif
5199 char ldap_init ();
5200 int
5201 main ()
5202 {
5203 return ldap_init ();
5204   ;
5205   return 0;
5206 }
5207 _ACEOF
5208 rm -f conftest.$ac_objext conftest$ac_exeext
5209 if { (ac_try="$ac_link"
5210 case "(($ac_try" in
5211   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5212   *) ac_try_echo=$ac_try;;
5213 esac
5214 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5215 $as_echo "$ac_try_echo") >&5
5216   (eval "$ac_link") 2>conftest.er1
5217   ac_status=$?
5218   grep -v '^ *+' conftest.er1 >conftest.err
5219   rm -f conftest.er1
5220   cat conftest.err >&5
5221   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5222   (exit $ac_status); } && {
5223          test -z "$ac_c_werror_flag" ||
5224          test ! -s conftest.err
5225        } && test -s conftest$ac_exeext && {
5226          test "$cross_compiling" = yes ||
5227          $as_test_x conftest$ac_exeext
5228        }; then
5229   eval "$as_ac_Lib=yes"
5230 else
5231   $as_echo "$as_me: failed program was:" >&5
5232 sed 's/^/| /' conftest.$ac_ext >&5
5233
5234         eval "$as_ac_Lib=no"
5235 fi
5236
5237 rm -rf conftest.dSYM
5238 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5239       conftest$ac_exeext conftest.$ac_ext
5240 LIBS=$ac_check_lib_save_LIBS
5241 fi
5242 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5243                  $as_echo "$as_val"'`
5244                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5245 $as_echo "$ac_res" >&6; }
5246 as_val=`eval 'as_val=${'$as_ac_Lib'}
5247                  $as_echo "$as_val"'`
5248    if test "x$as_val" = x""yes; then
5249
5250
5251   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
5252     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
5253     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
5254   else
5255     apr_addto_bugger="-l${ldaplib} ${extralib}"
5256     for i in $apr_addto_bugger; do
5257       apr_addto_duplicate="0"
5258       for j in $APRUTIL_EXPORT_LIBS; do
5259         if test "x$i" = "x$j"; then
5260           apr_addto_duplicate="1"
5261           break
5262         fi
5263       done
5264       if test $apr_addto_duplicate = "0"; then
5265         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
5266         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
5267       fi
5268     done
5269   fi
5270
5271
5272   if test "x$APRUTIL_LIBS" = "x"; then
5273     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
5274     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
5275   else
5276     apr_addto_bugger="-l${ldaplib} ${extralib}"
5277     for i in $apr_addto_bugger; do
5278       apr_addto_duplicate="0"
5279       for j in $APRUTIL_LIBS; do
5280         if test "x$i" = "x$j"; then
5281           apr_addto_duplicate="1"
5282           break
5283         fi
5284       done
5285       if test $apr_addto_duplicate = "0"; then
5286         echo "  adding \"$i\" to APRUTIL_LIBS"
5287         APRUTIL_LIBS="$APRUTIL_LIBS $i"
5288       fi
5289     done
5290   fi
5291
5292         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
5293 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
5294 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
5295 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5296   $as_echo_n "(cached) " >&6
5297 else
5298   ac_check_lib_save_LIBS=$LIBS
5299 LIBS="-l${ldaplib} ${extralib} $LIBS"
5300 cat >conftest.$ac_ext <<_ACEOF
5301 /* confdefs.h.  */
5302 _ACEOF
5303 cat confdefs.h >>conftest.$ac_ext
5304 cat >>conftest.$ac_ext <<_ACEOF
5305 /* end confdefs.h.  */
5306
5307 /* Override any GCC internal prototype to avoid an error.
5308    Use char because int might match the return type of a GCC
5309    builtin and then its argument prototype would still apply.  */
5310 #ifdef __cplusplus
5311 extern "C"
5312 #endif
5313 char ldapssl_install_routines ();
5314 int
5315 main ()
5316 {
5317 return ldapssl_install_routines ();
5318   ;
5319   return 0;
5320 }
5321 _ACEOF
5322 rm -f conftest.$ac_objext conftest$ac_exeext
5323 if { (ac_try="$ac_link"
5324 case "(($ac_try" in
5325   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5326   *) ac_try_echo=$ac_try;;
5327 esac
5328 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5329 $as_echo "$ac_try_echo") >&5
5330   (eval "$ac_link") 2>conftest.er1
5331   ac_status=$?
5332   grep -v '^ *+' conftest.er1 >conftest.err
5333   rm -f conftest.er1
5334   cat conftest.err >&5
5335   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5336   (exit $ac_status); } && {
5337          test -z "$ac_c_werror_flag" ||
5338          test ! -s conftest.err
5339        } && test -s conftest$ac_exeext && {
5340          test "$cross_compiling" = yes ||
5341          $as_test_x conftest$ac_exeext
5342        }; then
5343   eval "$as_ac_Lib=yes"
5344 else
5345   $as_echo "$as_me: failed program was:" >&5
5346 sed 's/^/| /' conftest.$ac_ext >&5
5347
5348         eval "$as_ac_Lib=no"
5349 fi
5350
5351 rm -rf conftest.dSYM
5352 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5353       conftest$ac_exeext conftest.$ac_ext
5354 LIBS=$ac_check_lib_save_LIBS
5355 fi
5356 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5357                  $as_echo "$as_val"'`
5358                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5359 $as_echo "$ac_res" >&6; }
5360 as_val=`eval 'as_val=${'$as_ac_Lib'}
5361                  $as_echo "$as_val"'`
5362    if test "x$as_val" = x""yes; then
5363   apu_has_ldap_netscape_ssl="1"
5364 fi
5365
5366         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
5367 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
5368 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
5369 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5370   $as_echo_n "(cached) " >&6
5371 else
5372   ac_check_lib_save_LIBS=$LIBS
5373 LIBS="-l${ldaplib} ${extralib} $LIBS"
5374 cat >conftest.$ac_ext <<_ACEOF
5375 /* confdefs.h.  */
5376 _ACEOF
5377 cat confdefs.h >>conftest.$ac_ext
5378 cat >>conftest.$ac_ext <<_ACEOF
5379 /* end confdefs.h.  */
5380
5381 /* Override any GCC internal prototype to avoid an error.
5382    Use char because int might match the return type of a GCC
5383    builtin and then its argument prototype would still apply.  */
5384 #ifdef __cplusplus
5385 extern "C"
5386 #endif
5387 char ldap_start_tls_s ();
5388 int
5389 main ()
5390 {
5391 return ldap_start_tls_s ();
5392   ;
5393   return 0;
5394 }
5395 _ACEOF
5396 rm -f conftest.$ac_objext conftest$ac_exeext
5397 if { (ac_try="$ac_link"
5398 case "(($ac_try" in
5399   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5400   *) ac_try_echo=$ac_try;;
5401 esac
5402 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5403 $as_echo "$ac_try_echo") >&5
5404   (eval "$ac_link") 2>conftest.er1
5405   ac_status=$?
5406   grep -v '^ *+' conftest.er1 >conftest.err
5407   rm -f conftest.er1
5408   cat conftest.err >&5
5409   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5410   (exit $ac_status); } && {
5411          test -z "$ac_c_werror_flag" ||
5412          test ! -s conftest.err
5413        } && test -s conftest$ac_exeext && {
5414          test "$cross_compiling" = yes ||
5415          $as_test_x conftest$ac_exeext
5416        }; then
5417   eval "$as_ac_Lib=yes"
5418 else
5419   $as_echo "$as_me: failed program was:" >&5
5420 sed 's/^/| /' conftest.$ac_ext >&5
5421
5422         eval "$as_ac_Lib=no"
5423 fi
5424
5425 rm -rf conftest.dSYM
5426 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5427       conftest$ac_exeext conftest.$ac_ext
5428 LIBS=$ac_check_lib_save_LIBS
5429 fi
5430 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5431                  $as_echo "$as_val"'`
5432                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5433 $as_echo "$ac_res" >&6; }
5434 as_val=`eval 'as_val=${'$as_ac_Lib'}
5435                  $as_echo "$as_val"'`
5436    if test "x$as_val" = x""yes; then
5437   apu_has_ldap_starttls="1"
5438 fi
5439
5440         apu_has_ldap="1";
5441
5442 fi
5443
5444   fi
5445
5446
5447   if test ${apu_has_ldap} != "1"; then
5448     ldaplib="ldapssl20"
5449     extralib=
5450     unset ac_cv_lib_${ldaplib}_ldap_init
5451     unset ac_cv_lib_${ldaplib}___ldap_init
5452     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
5453 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
5454 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
5455 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5456   $as_echo_n "(cached) " >&6
5457 else
5458   ac_check_lib_save_LIBS=$LIBS
5459 LIBS="-l${ldaplib} ${extralib} $LIBS"
5460 cat >conftest.$ac_ext <<_ACEOF
5461 /* confdefs.h.  */
5462 _ACEOF
5463 cat confdefs.h >>conftest.$ac_ext
5464 cat >>conftest.$ac_ext <<_ACEOF
5465 /* end confdefs.h.  */
5466
5467 /* Override any GCC internal prototype to avoid an error.
5468    Use char because int might match the return type of a GCC
5469    builtin and then its argument prototype would still apply.  */
5470 #ifdef __cplusplus
5471 extern "C"
5472 #endif
5473 char ldap_init ();
5474 int
5475 main ()
5476 {
5477 return ldap_init ();
5478   ;
5479   return 0;
5480 }
5481 _ACEOF
5482 rm -f conftest.$ac_objext conftest$ac_exeext
5483 if { (ac_try="$ac_link"
5484 case "(($ac_try" in
5485   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5486   *) ac_try_echo=$ac_try;;
5487 esac
5488 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5489 $as_echo "$ac_try_echo") >&5
5490   (eval "$ac_link") 2>conftest.er1
5491   ac_status=$?
5492   grep -v '^ *+' conftest.er1 >conftest.err
5493   rm -f conftest.er1
5494   cat conftest.err >&5
5495   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5496   (exit $ac_status); } && {
5497          test -z "$ac_c_werror_flag" ||
5498          test ! -s conftest.err
5499        } && test -s conftest$ac_exeext && {
5500          test "$cross_compiling" = yes ||
5501          $as_test_x conftest$ac_exeext
5502        }; then
5503   eval "$as_ac_Lib=yes"
5504 else
5505   $as_echo "$as_me: failed program was:" >&5
5506 sed 's/^/| /' conftest.$ac_ext >&5
5507
5508         eval "$as_ac_Lib=no"
5509 fi
5510
5511 rm -rf conftest.dSYM
5512 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5513       conftest$ac_exeext conftest.$ac_ext
5514 LIBS=$ac_check_lib_save_LIBS
5515 fi
5516 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5517                  $as_echo "$as_val"'`
5518                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5519 $as_echo "$ac_res" >&6; }
5520 as_val=`eval 'as_val=${'$as_ac_Lib'}
5521                  $as_echo "$as_val"'`
5522    if test "x$as_val" = x""yes; then
5523
5524
5525   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
5526     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
5527     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
5528   else
5529     apr_addto_bugger="-l${ldaplib} ${extralib}"
5530     for i in $apr_addto_bugger; do
5531       apr_addto_duplicate="0"
5532       for j in $APRUTIL_EXPORT_LIBS; do
5533         if test "x$i" = "x$j"; then
5534           apr_addto_duplicate="1"
5535           break
5536         fi
5537       done
5538       if test $apr_addto_duplicate = "0"; then
5539         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
5540         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
5541       fi
5542     done
5543   fi
5544
5545
5546   if test "x$APRUTIL_LIBS" = "x"; then
5547     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
5548     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
5549   else
5550     apr_addto_bugger="-l${ldaplib} ${extralib}"
5551     for i in $apr_addto_bugger; do
5552       apr_addto_duplicate="0"
5553       for j in $APRUTIL_LIBS; do
5554         if test "x$i" = "x$j"; then
5555           apr_addto_duplicate="1"
5556           break
5557         fi
5558       done
5559       if test $apr_addto_duplicate = "0"; then
5560         echo "  adding \"$i\" to APRUTIL_LIBS"
5561         APRUTIL_LIBS="$APRUTIL_LIBS $i"
5562       fi
5563     done
5564   fi
5565
5566         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
5567 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
5568 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
5569 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5570   $as_echo_n "(cached) " >&6
5571 else
5572   ac_check_lib_save_LIBS=$LIBS
5573 LIBS="-l${ldaplib} ${extralib} $LIBS"
5574 cat >conftest.$ac_ext <<_ACEOF
5575 /* confdefs.h.  */
5576 _ACEOF
5577 cat confdefs.h >>conftest.$ac_ext
5578 cat >>conftest.$ac_ext <<_ACEOF
5579 /* end confdefs.h.  */
5580
5581 /* Override any GCC internal prototype to avoid an error.
5582    Use char because int might match the return type of a GCC
5583    builtin and then its argument prototype would still apply.  */
5584 #ifdef __cplusplus
5585 extern "C"
5586 #endif
5587 char ldapssl_install_routines ();
5588 int
5589 main ()
5590 {
5591 return ldapssl_install_routines ();
5592   ;
5593   return 0;
5594 }
5595 _ACEOF
5596 rm -f conftest.$ac_objext conftest$ac_exeext
5597 if { (ac_try="$ac_link"
5598 case "(($ac_try" in
5599   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5600   *) ac_try_echo=$ac_try;;
5601 esac
5602 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5603 $as_echo "$ac_try_echo") >&5
5604   (eval "$ac_link") 2>conftest.er1
5605   ac_status=$?
5606   grep -v '^ *+' conftest.er1 >conftest.err
5607   rm -f conftest.er1
5608   cat conftest.err >&5
5609   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5610   (exit $ac_status); } && {
5611          test -z "$ac_c_werror_flag" ||
5612          test ! -s conftest.err
5613        } && test -s conftest$ac_exeext && {
5614          test "$cross_compiling" = yes ||
5615          $as_test_x conftest$ac_exeext
5616        }; then
5617   eval "$as_ac_Lib=yes"
5618 else
5619   $as_echo "$as_me: failed program was:" >&5
5620 sed 's/^/| /' conftest.$ac_ext >&5
5621
5622         eval "$as_ac_Lib=no"
5623 fi
5624
5625 rm -rf conftest.dSYM
5626 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5627       conftest$ac_exeext conftest.$ac_ext
5628 LIBS=$ac_check_lib_save_LIBS
5629 fi
5630 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5631                  $as_echo "$as_val"'`
5632                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5633 $as_echo "$ac_res" >&6; }
5634 as_val=`eval 'as_val=${'$as_ac_Lib'}
5635                  $as_echo "$as_val"'`
5636    if test "x$as_val" = x""yes; then
5637   apu_has_ldap_netscape_ssl="1"
5638 fi
5639
5640         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
5641 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
5642 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
5643 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5644   $as_echo_n "(cached) " >&6
5645 else
5646   ac_check_lib_save_LIBS=$LIBS
5647 LIBS="-l${ldaplib} ${extralib} $LIBS"
5648 cat >conftest.$ac_ext <<_ACEOF
5649 /* confdefs.h.  */
5650 _ACEOF
5651 cat confdefs.h >>conftest.$ac_ext
5652 cat >>conftest.$ac_ext <<_ACEOF
5653 /* end confdefs.h.  */
5654
5655 /* Override any GCC internal prototype to avoid an error.
5656    Use char because int might match the return type of a GCC
5657    builtin and then its argument prototype would still apply.  */
5658 #ifdef __cplusplus
5659 extern "C"
5660 #endif
5661 char ldap_start_tls_s ();
5662 int
5663 main ()
5664 {
5665 return ldap_start_tls_s ();
5666   ;
5667   return 0;
5668 }
5669 _ACEOF
5670 rm -f conftest.$ac_objext conftest$ac_exeext
5671 if { (ac_try="$ac_link"
5672 case "(($ac_try" in
5673   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5674   *) ac_try_echo=$ac_try;;
5675 esac
5676 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5677 $as_echo "$ac_try_echo") >&5
5678   (eval "$ac_link") 2>conftest.er1
5679   ac_status=$?
5680   grep -v '^ *+' conftest.er1 >conftest.err
5681   rm -f conftest.er1
5682   cat conftest.err >&5
5683   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5684   (exit $ac_status); } && {
5685          test -z "$ac_c_werror_flag" ||
5686          test ! -s conftest.err
5687        } && test -s conftest$ac_exeext && {
5688          test "$cross_compiling" = yes ||
5689          $as_test_x conftest$ac_exeext
5690        }; then
5691   eval "$as_ac_Lib=yes"
5692 else
5693   $as_echo "$as_me: failed program was:" >&5
5694 sed 's/^/| /' conftest.$ac_ext >&5
5695
5696         eval "$as_ac_Lib=no"
5697 fi
5698
5699 rm -rf conftest.dSYM
5700 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5701       conftest$ac_exeext conftest.$ac_ext
5702 LIBS=$ac_check_lib_save_LIBS
5703 fi
5704 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5705                  $as_echo "$as_val"'`
5706                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5707 $as_echo "$ac_res" >&6; }
5708 as_val=`eval 'as_val=${'$as_ac_Lib'}
5709                  $as_echo "$as_val"'`
5710    if test "x$as_val" = x""yes; then
5711   apu_has_ldap_starttls="1"
5712 fi
5713
5714         apu_has_ldap="1";
5715
5716 fi
5717
5718   fi
5719
5720
5721   if test ${apu_has_ldap} != "1"; then
5722     ldaplib="ldap"
5723     extralib="-llber"
5724     unset ac_cv_lib_${ldaplib}_ldap_init
5725     unset ac_cv_lib_${ldaplib}___ldap_init
5726     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
5727 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
5728 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
5729 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5730   $as_echo_n "(cached) " >&6
5731 else
5732   ac_check_lib_save_LIBS=$LIBS
5733 LIBS="-l${ldaplib} ${extralib} $LIBS"
5734 cat >conftest.$ac_ext <<_ACEOF
5735 /* confdefs.h.  */
5736 _ACEOF
5737 cat confdefs.h >>conftest.$ac_ext
5738 cat >>conftest.$ac_ext <<_ACEOF
5739 /* end confdefs.h.  */
5740
5741 /* Override any GCC internal prototype to avoid an error.
5742    Use char because int might match the return type of a GCC
5743    builtin and then its argument prototype would still apply.  */
5744 #ifdef __cplusplus
5745 extern "C"
5746 #endif
5747 char ldap_init ();
5748 int
5749 main ()
5750 {
5751 return ldap_init ();
5752   ;
5753   return 0;
5754 }
5755 _ACEOF
5756 rm -f conftest.$ac_objext conftest$ac_exeext
5757 if { (ac_try="$ac_link"
5758 case "(($ac_try" in
5759   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5760   *) ac_try_echo=$ac_try;;
5761 esac
5762 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5763 $as_echo "$ac_try_echo") >&5
5764   (eval "$ac_link") 2>conftest.er1
5765   ac_status=$?
5766   grep -v '^ *+' conftest.er1 >conftest.err
5767   rm -f conftest.er1
5768   cat conftest.err >&5
5769   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5770   (exit $ac_status); } && {
5771          test -z "$ac_c_werror_flag" ||
5772          test ! -s conftest.err
5773        } && test -s conftest$ac_exeext && {
5774          test "$cross_compiling" = yes ||
5775          $as_test_x conftest$ac_exeext
5776        }; then
5777   eval "$as_ac_Lib=yes"
5778 else
5779   $as_echo "$as_me: failed program was:" >&5
5780 sed 's/^/| /' conftest.$ac_ext >&5
5781
5782         eval "$as_ac_Lib=no"
5783 fi
5784
5785 rm -rf conftest.dSYM
5786 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5787       conftest$ac_exeext conftest.$ac_ext
5788 LIBS=$ac_check_lib_save_LIBS
5789 fi
5790 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5791                  $as_echo "$as_val"'`
5792                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5793 $as_echo "$ac_res" >&6; }
5794 as_val=`eval 'as_val=${'$as_ac_Lib'}
5795                  $as_echo "$as_val"'`
5796    if test "x$as_val" = x""yes; then
5797
5798
5799   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
5800     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
5801     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
5802   else
5803     apr_addto_bugger="-l${ldaplib} ${extralib}"
5804     for i in $apr_addto_bugger; do
5805       apr_addto_duplicate="0"
5806       for j in $APRUTIL_EXPORT_LIBS; do
5807         if test "x$i" = "x$j"; then
5808           apr_addto_duplicate="1"
5809           break
5810         fi
5811       done
5812       if test $apr_addto_duplicate = "0"; then
5813         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
5814         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
5815       fi
5816     done
5817   fi
5818
5819
5820   if test "x$APRUTIL_LIBS" = "x"; then
5821     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
5822     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
5823   else
5824     apr_addto_bugger="-l${ldaplib} ${extralib}"
5825     for i in $apr_addto_bugger; do
5826       apr_addto_duplicate="0"
5827       for j in $APRUTIL_LIBS; do
5828         if test "x$i" = "x$j"; then
5829           apr_addto_duplicate="1"
5830           break
5831         fi
5832       done
5833       if test $apr_addto_duplicate = "0"; then
5834         echo "  adding \"$i\" to APRUTIL_LIBS"
5835         APRUTIL_LIBS="$APRUTIL_LIBS $i"
5836       fi
5837     done
5838   fi
5839
5840         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
5841 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
5842 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
5843 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5844   $as_echo_n "(cached) " >&6
5845 else
5846   ac_check_lib_save_LIBS=$LIBS
5847 LIBS="-l${ldaplib} ${extralib} $LIBS"
5848 cat >conftest.$ac_ext <<_ACEOF
5849 /* confdefs.h.  */
5850 _ACEOF
5851 cat confdefs.h >>conftest.$ac_ext
5852 cat >>conftest.$ac_ext <<_ACEOF
5853 /* end confdefs.h.  */
5854
5855 /* Override any GCC internal prototype to avoid an error.
5856    Use char because int might match the return type of a GCC
5857    builtin and then its argument prototype would still apply.  */
5858 #ifdef __cplusplus
5859 extern "C"
5860 #endif
5861 char ldapssl_install_routines ();
5862 int
5863 main ()
5864 {
5865 return ldapssl_install_routines ();
5866   ;
5867   return 0;
5868 }
5869 _ACEOF
5870 rm -f conftest.$ac_objext conftest$ac_exeext
5871 if { (ac_try="$ac_link"
5872 case "(($ac_try" in
5873   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5874   *) ac_try_echo=$ac_try;;
5875 esac
5876 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5877 $as_echo "$ac_try_echo") >&5
5878   (eval "$ac_link") 2>conftest.er1
5879   ac_status=$?
5880   grep -v '^ *+' conftest.er1 >conftest.err
5881   rm -f conftest.er1
5882   cat conftest.err >&5
5883   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5884   (exit $ac_status); } && {
5885          test -z "$ac_c_werror_flag" ||
5886          test ! -s conftest.err
5887        } && test -s conftest$ac_exeext && {
5888          test "$cross_compiling" = yes ||
5889          $as_test_x conftest$ac_exeext
5890        }; then
5891   eval "$as_ac_Lib=yes"
5892 else
5893   $as_echo "$as_me: failed program was:" >&5
5894 sed 's/^/| /' conftest.$ac_ext >&5
5895
5896         eval "$as_ac_Lib=no"
5897 fi
5898
5899 rm -rf conftest.dSYM
5900 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5901       conftest$ac_exeext conftest.$ac_ext
5902 LIBS=$ac_check_lib_save_LIBS
5903 fi
5904 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5905                  $as_echo "$as_val"'`
5906                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5907 $as_echo "$ac_res" >&6; }
5908 as_val=`eval 'as_val=${'$as_ac_Lib'}
5909                  $as_echo "$as_val"'`
5910    if test "x$as_val" = x""yes; then
5911   apu_has_ldap_netscape_ssl="1"
5912 fi
5913
5914         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
5915 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
5916 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
5917 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
5918   $as_echo_n "(cached) " >&6
5919 else
5920   ac_check_lib_save_LIBS=$LIBS
5921 LIBS="-l${ldaplib} ${extralib} $LIBS"
5922 cat >conftest.$ac_ext <<_ACEOF
5923 /* confdefs.h.  */
5924 _ACEOF
5925 cat confdefs.h >>conftest.$ac_ext
5926 cat >>conftest.$ac_ext <<_ACEOF
5927 /* end confdefs.h.  */
5928
5929 /* Override any GCC internal prototype to avoid an error.
5930    Use char because int might match the return type of a GCC
5931    builtin and then its argument prototype would still apply.  */
5932 #ifdef __cplusplus
5933 extern "C"
5934 #endif
5935 char ldap_start_tls_s ();
5936 int
5937 main ()
5938 {
5939 return ldap_start_tls_s ();
5940   ;
5941   return 0;
5942 }
5943 _ACEOF
5944 rm -f conftest.$ac_objext conftest$ac_exeext
5945 if { (ac_try="$ac_link"
5946 case "(($ac_try" in
5947   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5948   *) ac_try_echo=$ac_try;;
5949 esac
5950 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5951 $as_echo "$ac_try_echo") >&5
5952   (eval "$ac_link") 2>conftest.er1
5953   ac_status=$?
5954   grep -v '^ *+' conftest.er1 >conftest.err
5955   rm -f conftest.er1
5956   cat conftest.err >&5
5957   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5958   (exit $ac_status); } && {
5959          test -z "$ac_c_werror_flag" ||
5960          test ! -s conftest.err
5961        } && test -s conftest$ac_exeext && {
5962          test "$cross_compiling" = yes ||
5963          $as_test_x conftest$ac_exeext
5964        }; then
5965   eval "$as_ac_Lib=yes"
5966 else
5967   $as_echo "$as_me: failed program was:" >&5
5968 sed 's/^/| /' conftest.$ac_ext >&5
5969
5970         eval "$as_ac_Lib=no"
5971 fi
5972
5973 rm -rf conftest.dSYM
5974 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5975       conftest$ac_exeext conftest.$ac_ext
5976 LIBS=$ac_check_lib_save_LIBS
5977 fi
5978 ac_res=`eval 'as_val=${'$as_ac_Lib'}
5979                  $as_echo "$as_val"'`
5980                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
5981 $as_echo "$ac_res" >&6; }
5982 as_val=`eval 'as_val=${'$as_ac_Lib'}
5983                  $as_echo "$as_val"'`
5984    if test "x$as_val" = x""yes; then
5985   apu_has_ldap_starttls="1"
5986 fi
5987
5988         apu_has_ldap="1";
5989
5990 fi
5991
5992   fi
5993
5994
5995   if test ${apu_has_ldap} != "1"; then
5996     ldaplib="ldap"
5997     extralib="-llber -lresolv"
5998     unset ac_cv_lib_${ldaplib}_ldap_init
5999     unset ac_cv_lib_${ldaplib}___ldap_init
6000     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
6001 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
6002 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
6003 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6004   $as_echo_n "(cached) " >&6
6005 else
6006   ac_check_lib_save_LIBS=$LIBS
6007 LIBS="-l${ldaplib} ${extralib} $LIBS"
6008 cat >conftest.$ac_ext <<_ACEOF
6009 /* confdefs.h.  */
6010 _ACEOF
6011 cat confdefs.h >>conftest.$ac_ext
6012 cat >>conftest.$ac_ext <<_ACEOF
6013 /* end confdefs.h.  */
6014
6015 /* Override any GCC internal prototype to avoid an error.
6016    Use char because int might match the return type of a GCC
6017    builtin and then its argument prototype would still apply.  */
6018 #ifdef __cplusplus
6019 extern "C"
6020 #endif
6021 char ldap_init ();
6022 int
6023 main ()
6024 {
6025 return ldap_init ();
6026   ;
6027   return 0;
6028 }
6029 _ACEOF
6030 rm -f conftest.$ac_objext conftest$ac_exeext
6031 if { (ac_try="$ac_link"
6032 case "(($ac_try" in
6033   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6034   *) ac_try_echo=$ac_try;;
6035 esac
6036 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6037 $as_echo "$ac_try_echo") >&5
6038   (eval "$ac_link") 2>conftest.er1
6039   ac_status=$?
6040   grep -v '^ *+' conftest.er1 >conftest.err
6041   rm -f conftest.er1
6042   cat conftest.err >&5
6043   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6044   (exit $ac_status); } && {
6045          test -z "$ac_c_werror_flag" ||
6046          test ! -s conftest.err
6047        } && test -s conftest$ac_exeext && {
6048          test "$cross_compiling" = yes ||
6049          $as_test_x conftest$ac_exeext
6050        }; then
6051   eval "$as_ac_Lib=yes"
6052 else
6053   $as_echo "$as_me: failed program was:" >&5
6054 sed 's/^/| /' conftest.$ac_ext >&5
6055
6056         eval "$as_ac_Lib=no"
6057 fi
6058
6059 rm -rf conftest.dSYM
6060 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6061       conftest$ac_exeext conftest.$ac_ext
6062 LIBS=$ac_check_lib_save_LIBS
6063 fi
6064 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6065                  $as_echo "$as_val"'`
6066                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6067 $as_echo "$ac_res" >&6; }
6068 as_val=`eval 'as_val=${'$as_ac_Lib'}
6069                  $as_echo "$as_val"'`
6070    if test "x$as_val" = x""yes; then
6071
6072
6073   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
6074     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
6075     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
6076   else
6077     apr_addto_bugger="-l${ldaplib} ${extralib}"
6078     for i in $apr_addto_bugger; do
6079       apr_addto_duplicate="0"
6080       for j in $APRUTIL_EXPORT_LIBS; do
6081         if test "x$i" = "x$j"; then
6082           apr_addto_duplicate="1"
6083           break
6084         fi
6085       done
6086       if test $apr_addto_duplicate = "0"; then
6087         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
6088         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
6089       fi
6090     done
6091   fi
6092
6093
6094   if test "x$APRUTIL_LIBS" = "x"; then
6095     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
6096     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
6097   else
6098     apr_addto_bugger="-l${ldaplib} ${extralib}"
6099     for i in $apr_addto_bugger; do
6100       apr_addto_duplicate="0"
6101       for j in $APRUTIL_LIBS; do
6102         if test "x$i" = "x$j"; then
6103           apr_addto_duplicate="1"
6104           break
6105         fi
6106       done
6107       if test $apr_addto_duplicate = "0"; then
6108         echo "  adding \"$i\" to APRUTIL_LIBS"
6109         APRUTIL_LIBS="$APRUTIL_LIBS $i"
6110       fi
6111     done
6112   fi
6113
6114         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
6115 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
6116 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
6117 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6118   $as_echo_n "(cached) " >&6
6119 else
6120   ac_check_lib_save_LIBS=$LIBS
6121 LIBS="-l${ldaplib} ${extralib} $LIBS"
6122 cat >conftest.$ac_ext <<_ACEOF
6123 /* confdefs.h.  */
6124 _ACEOF
6125 cat confdefs.h >>conftest.$ac_ext
6126 cat >>conftest.$ac_ext <<_ACEOF
6127 /* end confdefs.h.  */
6128
6129 /* Override any GCC internal prototype to avoid an error.
6130    Use char because int might match the return type of a GCC
6131    builtin and then its argument prototype would still apply.  */
6132 #ifdef __cplusplus
6133 extern "C"
6134 #endif
6135 char ldapssl_install_routines ();
6136 int
6137 main ()
6138 {
6139 return ldapssl_install_routines ();
6140   ;
6141   return 0;
6142 }
6143 _ACEOF
6144 rm -f conftest.$ac_objext conftest$ac_exeext
6145 if { (ac_try="$ac_link"
6146 case "(($ac_try" in
6147   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6148   *) ac_try_echo=$ac_try;;
6149 esac
6150 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6151 $as_echo "$ac_try_echo") >&5
6152   (eval "$ac_link") 2>conftest.er1
6153   ac_status=$?
6154   grep -v '^ *+' conftest.er1 >conftest.err
6155   rm -f conftest.er1
6156   cat conftest.err >&5
6157   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6158   (exit $ac_status); } && {
6159          test -z "$ac_c_werror_flag" ||
6160          test ! -s conftest.err
6161        } && test -s conftest$ac_exeext && {
6162          test "$cross_compiling" = yes ||
6163          $as_test_x conftest$ac_exeext
6164        }; then
6165   eval "$as_ac_Lib=yes"
6166 else
6167   $as_echo "$as_me: failed program was:" >&5
6168 sed 's/^/| /' conftest.$ac_ext >&5
6169
6170         eval "$as_ac_Lib=no"
6171 fi
6172
6173 rm -rf conftest.dSYM
6174 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6175       conftest$ac_exeext conftest.$ac_ext
6176 LIBS=$ac_check_lib_save_LIBS
6177 fi
6178 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6179                  $as_echo "$as_val"'`
6180                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6181 $as_echo "$ac_res" >&6; }
6182 as_val=`eval 'as_val=${'$as_ac_Lib'}
6183                  $as_echo "$as_val"'`
6184    if test "x$as_val" = x""yes; then
6185   apu_has_ldap_netscape_ssl="1"
6186 fi
6187
6188         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
6189 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
6190 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
6191 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6192   $as_echo_n "(cached) " >&6
6193 else
6194   ac_check_lib_save_LIBS=$LIBS
6195 LIBS="-l${ldaplib} ${extralib} $LIBS"
6196 cat >conftest.$ac_ext <<_ACEOF
6197 /* confdefs.h.  */
6198 _ACEOF
6199 cat confdefs.h >>conftest.$ac_ext
6200 cat >>conftest.$ac_ext <<_ACEOF
6201 /* end confdefs.h.  */
6202
6203 /* Override any GCC internal prototype to avoid an error.
6204    Use char because int might match the return type of a GCC
6205    builtin and then its argument prototype would still apply.  */
6206 #ifdef __cplusplus
6207 extern "C"
6208 #endif
6209 char ldap_start_tls_s ();
6210 int
6211 main ()
6212 {
6213 return ldap_start_tls_s ();
6214   ;
6215   return 0;
6216 }
6217 _ACEOF
6218 rm -f conftest.$ac_objext conftest$ac_exeext
6219 if { (ac_try="$ac_link"
6220 case "(($ac_try" in
6221   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6222   *) ac_try_echo=$ac_try;;
6223 esac
6224 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6225 $as_echo "$ac_try_echo") >&5
6226   (eval "$ac_link") 2>conftest.er1
6227   ac_status=$?
6228   grep -v '^ *+' conftest.er1 >conftest.err
6229   rm -f conftest.er1
6230   cat conftest.err >&5
6231   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6232   (exit $ac_status); } && {
6233          test -z "$ac_c_werror_flag" ||
6234          test ! -s conftest.err
6235        } && test -s conftest$ac_exeext && {
6236          test "$cross_compiling" = yes ||
6237          $as_test_x conftest$ac_exeext
6238        }; then
6239   eval "$as_ac_Lib=yes"
6240 else
6241   $as_echo "$as_me: failed program was:" >&5
6242 sed 's/^/| /' conftest.$ac_ext >&5
6243
6244         eval "$as_ac_Lib=no"
6245 fi
6246
6247 rm -rf conftest.dSYM
6248 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6249       conftest$ac_exeext conftest.$ac_ext
6250 LIBS=$ac_check_lib_save_LIBS
6251 fi
6252 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6253                  $as_echo "$as_val"'`
6254                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6255 $as_echo "$ac_res" >&6; }
6256 as_val=`eval 'as_val=${'$as_ac_Lib'}
6257                  $as_echo "$as_val"'`
6258    if test "x$as_val" = x""yes; then
6259   apu_has_ldap_starttls="1"
6260 fi
6261
6262         apu_has_ldap="1";
6263
6264 fi
6265
6266   fi
6267
6268
6269   if test ${apu_has_ldap} != "1"; then
6270     ldaplib="ldap"
6271     extralib="-llber -lresolv -lsocket -lnsl"
6272     unset ac_cv_lib_${ldaplib}_ldap_init
6273     unset ac_cv_lib_${ldaplib}___ldap_init
6274     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
6275 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
6276 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
6277 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6278   $as_echo_n "(cached) " >&6
6279 else
6280   ac_check_lib_save_LIBS=$LIBS
6281 LIBS="-l${ldaplib} ${extralib} $LIBS"
6282 cat >conftest.$ac_ext <<_ACEOF
6283 /* confdefs.h.  */
6284 _ACEOF
6285 cat confdefs.h >>conftest.$ac_ext
6286 cat >>conftest.$ac_ext <<_ACEOF
6287 /* end confdefs.h.  */
6288
6289 /* Override any GCC internal prototype to avoid an error.
6290    Use char because int might match the return type of a GCC
6291    builtin and then its argument prototype would still apply.  */
6292 #ifdef __cplusplus
6293 extern "C"
6294 #endif
6295 char ldap_init ();
6296 int
6297 main ()
6298 {
6299 return ldap_init ();
6300   ;
6301   return 0;
6302 }
6303 _ACEOF
6304 rm -f conftest.$ac_objext conftest$ac_exeext
6305 if { (ac_try="$ac_link"
6306 case "(($ac_try" in
6307   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6308   *) ac_try_echo=$ac_try;;
6309 esac
6310 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6311 $as_echo "$ac_try_echo") >&5
6312   (eval "$ac_link") 2>conftest.er1
6313   ac_status=$?
6314   grep -v '^ *+' conftest.er1 >conftest.err
6315   rm -f conftest.er1
6316   cat conftest.err >&5
6317   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6318   (exit $ac_status); } && {
6319          test -z "$ac_c_werror_flag" ||
6320          test ! -s conftest.err
6321        } && test -s conftest$ac_exeext && {
6322          test "$cross_compiling" = yes ||
6323          $as_test_x conftest$ac_exeext
6324        }; then
6325   eval "$as_ac_Lib=yes"
6326 else
6327   $as_echo "$as_me: failed program was:" >&5
6328 sed 's/^/| /' conftest.$ac_ext >&5
6329
6330         eval "$as_ac_Lib=no"
6331 fi
6332
6333 rm -rf conftest.dSYM
6334 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6335       conftest$ac_exeext conftest.$ac_ext
6336 LIBS=$ac_check_lib_save_LIBS
6337 fi
6338 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6339                  $as_echo "$as_val"'`
6340                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6341 $as_echo "$ac_res" >&6; }
6342 as_val=`eval 'as_val=${'$as_ac_Lib'}
6343                  $as_echo "$as_val"'`
6344    if test "x$as_val" = x""yes; then
6345
6346
6347   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
6348     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
6349     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
6350   else
6351     apr_addto_bugger="-l${ldaplib} ${extralib}"
6352     for i in $apr_addto_bugger; do
6353       apr_addto_duplicate="0"
6354       for j in $APRUTIL_EXPORT_LIBS; do
6355         if test "x$i" = "x$j"; then
6356           apr_addto_duplicate="1"
6357           break
6358         fi
6359       done
6360       if test $apr_addto_duplicate = "0"; then
6361         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
6362         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
6363       fi
6364     done
6365   fi
6366
6367
6368   if test "x$APRUTIL_LIBS" = "x"; then
6369     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
6370     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
6371   else
6372     apr_addto_bugger="-l${ldaplib} ${extralib}"
6373     for i in $apr_addto_bugger; do
6374       apr_addto_duplicate="0"
6375       for j in $APRUTIL_LIBS; do
6376         if test "x$i" = "x$j"; then
6377           apr_addto_duplicate="1"
6378           break
6379         fi
6380       done
6381       if test $apr_addto_duplicate = "0"; then
6382         echo "  adding \"$i\" to APRUTIL_LIBS"
6383         APRUTIL_LIBS="$APRUTIL_LIBS $i"
6384       fi
6385     done
6386   fi
6387
6388         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
6389 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
6390 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
6391 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6392   $as_echo_n "(cached) " >&6
6393 else
6394   ac_check_lib_save_LIBS=$LIBS
6395 LIBS="-l${ldaplib} ${extralib} $LIBS"
6396 cat >conftest.$ac_ext <<_ACEOF
6397 /* confdefs.h.  */
6398 _ACEOF
6399 cat confdefs.h >>conftest.$ac_ext
6400 cat >>conftest.$ac_ext <<_ACEOF
6401 /* end confdefs.h.  */
6402
6403 /* Override any GCC internal prototype to avoid an error.
6404    Use char because int might match the return type of a GCC
6405    builtin and then its argument prototype would still apply.  */
6406 #ifdef __cplusplus
6407 extern "C"
6408 #endif
6409 char ldapssl_install_routines ();
6410 int
6411 main ()
6412 {
6413 return ldapssl_install_routines ();
6414   ;
6415   return 0;
6416 }
6417 _ACEOF
6418 rm -f conftest.$ac_objext conftest$ac_exeext
6419 if { (ac_try="$ac_link"
6420 case "(($ac_try" in
6421   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6422   *) ac_try_echo=$ac_try;;
6423 esac
6424 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6425 $as_echo "$ac_try_echo") >&5
6426   (eval "$ac_link") 2>conftest.er1
6427   ac_status=$?
6428   grep -v '^ *+' conftest.er1 >conftest.err
6429   rm -f conftest.er1
6430   cat conftest.err >&5
6431   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6432   (exit $ac_status); } && {
6433          test -z "$ac_c_werror_flag" ||
6434          test ! -s conftest.err
6435        } && test -s conftest$ac_exeext && {
6436          test "$cross_compiling" = yes ||
6437          $as_test_x conftest$ac_exeext
6438        }; then
6439   eval "$as_ac_Lib=yes"
6440 else
6441   $as_echo "$as_me: failed program was:" >&5
6442 sed 's/^/| /' conftest.$ac_ext >&5
6443
6444         eval "$as_ac_Lib=no"
6445 fi
6446
6447 rm -rf conftest.dSYM
6448 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6449       conftest$ac_exeext conftest.$ac_ext
6450 LIBS=$ac_check_lib_save_LIBS
6451 fi
6452 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6453                  $as_echo "$as_val"'`
6454                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6455 $as_echo "$ac_res" >&6; }
6456 as_val=`eval 'as_val=${'$as_ac_Lib'}
6457                  $as_echo "$as_val"'`
6458    if test "x$as_val" = x""yes; then
6459   apu_has_ldap_netscape_ssl="1"
6460 fi
6461
6462         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
6463 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
6464 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
6465 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6466   $as_echo_n "(cached) " >&6
6467 else
6468   ac_check_lib_save_LIBS=$LIBS
6469 LIBS="-l${ldaplib} ${extralib} $LIBS"
6470 cat >conftest.$ac_ext <<_ACEOF
6471 /* confdefs.h.  */
6472 _ACEOF
6473 cat confdefs.h >>conftest.$ac_ext
6474 cat >>conftest.$ac_ext <<_ACEOF
6475 /* end confdefs.h.  */
6476
6477 /* Override any GCC internal prototype to avoid an error.
6478    Use char because int might match the return type of a GCC
6479    builtin and then its argument prototype would still apply.  */
6480 #ifdef __cplusplus
6481 extern "C"
6482 #endif
6483 char ldap_start_tls_s ();
6484 int
6485 main ()
6486 {
6487 return ldap_start_tls_s ();
6488   ;
6489   return 0;
6490 }
6491 _ACEOF
6492 rm -f conftest.$ac_objext conftest$ac_exeext
6493 if { (ac_try="$ac_link"
6494 case "(($ac_try" in
6495   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6496   *) ac_try_echo=$ac_try;;
6497 esac
6498 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6499 $as_echo "$ac_try_echo") >&5
6500   (eval "$ac_link") 2>conftest.er1
6501   ac_status=$?
6502   grep -v '^ *+' conftest.er1 >conftest.err
6503   rm -f conftest.er1
6504   cat conftest.err >&5
6505   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6506   (exit $ac_status); } && {
6507          test -z "$ac_c_werror_flag" ||
6508          test ! -s conftest.err
6509        } && test -s conftest$ac_exeext && {
6510          test "$cross_compiling" = yes ||
6511          $as_test_x conftest$ac_exeext
6512        }; then
6513   eval "$as_ac_Lib=yes"
6514 else
6515   $as_echo "$as_me: failed program was:" >&5
6516 sed 's/^/| /' conftest.$ac_ext >&5
6517
6518         eval "$as_ac_Lib=no"
6519 fi
6520
6521 rm -rf conftest.dSYM
6522 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6523       conftest$ac_exeext conftest.$ac_ext
6524 LIBS=$ac_check_lib_save_LIBS
6525 fi
6526 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6527                  $as_echo "$as_val"'`
6528                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6529 $as_echo "$ac_res" >&6; }
6530 as_val=`eval 'as_val=${'$as_ac_Lib'}
6531                  $as_echo "$as_val"'`
6532    if test "x$as_val" = x""yes; then
6533   apu_has_ldap_starttls="1"
6534 fi
6535
6536         apu_has_ldap="1";
6537
6538 fi
6539
6540   fi
6541
6542
6543   if test ${apu_has_ldap} != "1"; then
6544     ldaplib="ldap"
6545     extralib="-ldl -lpthread"
6546     unset ac_cv_lib_${ldaplib}_ldap_init
6547     unset ac_cv_lib_${ldaplib}___ldap_init
6548     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
6549 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
6550 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
6551 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6552   $as_echo_n "(cached) " >&6
6553 else
6554   ac_check_lib_save_LIBS=$LIBS
6555 LIBS="-l${ldaplib} ${extralib} $LIBS"
6556 cat >conftest.$ac_ext <<_ACEOF
6557 /* confdefs.h.  */
6558 _ACEOF
6559 cat confdefs.h >>conftest.$ac_ext
6560 cat >>conftest.$ac_ext <<_ACEOF
6561 /* end confdefs.h.  */
6562
6563 /* Override any GCC internal prototype to avoid an error.
6564    Use char because int might match the return type of a GCC
6565    builtin and then its argument prototype would still apply.  */
6566 #ifdef __cplusplus
6567 extern "C"
6568 #endif
6569 char ldap_init ();
6570 int
6571 main ()
6572 {
6573 return ldap_init ();
6574   ;
6575   return 0;
6576 }
6577 _ACEOF
6578 rm -f conftest.$ac_objext conftest$ac_exeext
6579 if { (ac_try="$ac_link"
6580 case "(($ac_try" in
6581   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6582   *) ac_try_echo=$ac_try;;
6583 esac
6584 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6585 $as_echo "$ac_try_echo") >&5
6586   (eval "$ac_link") 2>conftest.er1
6587   ac_status=$?
6588   grep -v '^ *+' conftest.er1 >conftest.err
6589   rm -f conftest.er1
6590   cat conftest.err >&5
6591   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6592   (exit $ac_status); } && {
6593          test -z "$ac_c_werror_flag" ||
6594          test ! -s conftest.err
6595        } && test -s conftest$ac_exeext && {
6596          test "$cross_compiling" = yes ||
6597          $as_test_x conftest$ac_exeext
6598        }; then
6599   eval "$as_ac_Lib=yes"
6600 else
6601   $as_echo "$as_me: failed program was:" >&5
6602 sed 's/^/| /' conftest.$ac_ext >&5
6603
6604         eval "$as_ac_Lib=no"
6605 fi
6606
6607 rm -rf conftest.dSYM
6608 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6609       conftest$ac_exeext conftest.$ac_ext
6610 LIBS=$ac_check_lib_save_LIBS
6611 fi
6612 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6613                  $as_echo "$as_val"'`
6614                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6615 $as_echo "$ac_res" >&6; }
6616 as_val=`eval 'as_val=${'$as_ac_Lib'}
6617                  $as_echo "$as_val"'`
6618    if test "x$as_val" = x""yes; then
6619
6620
6621   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
6622     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
6623     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
6624   else
6625     apr_addto_bugger="-l${ldaplib} ${extralib}"
6626     for i in $apr_addto_bugger; do
6627       apr_addto_duplicate="0"
6628       for j in $APRUTIL_EXPORT_LIBS; do
6629         if test "x$i" = "x$j"; then
6630           apr_addto_duplicate="1"
6631           break
6632         fi
6633       done
6634       if test $apr_addto_duplicate = "0"; then
6635         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
6636         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
6637       fi
6638     done
6639   fi
6640
6641
6642   if test "x$APRUTIL_LIBS" = "x"; then
6643     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
6644     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
6645   else
6646     apr_addto_bugger="-l${ldaplib} ${extralib}"
6647     for i in $apr_addto_bugger; do
6648       apr_addto_duplicate="0"
6649       for j in $APRUTIL_LIBS; do
6650         if test "x$i" = "x$j"; then
6651           apr_addto_duplicate="1"
6652           break
6653         fi
6654       done
6655       if test $apr_addto_duplicate = "0"; then
6656         echo "  adding \"$i\" to APRUTIL_LIBS"
6657         APRUTIL_LIBS="$APRUTIL_LIBS $i"
6658       fi
6659     done
6660   fi
6661
6662         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
6663 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
6664 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
6665 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6666   $as_echo_n "(cached) " >&6
6667 else
6668   ac_check_lib_save_LIBS=$LIBS
6669 LIBS="-l${ldaplib} ${extralib} $LIBS"
6670 cat >conftest.$ac_ext <<_ACEOF
6671 /* confdefs.h.  */
6672 _ACEOF
6673 cat confdefs.h >>conftest.$ac_ext
6674 cat >>conftest.$ac_ext <<_ACEOF
6675 /* end confdefs.h.  */
6676
6677 /* Override any GCC internal prototype to avoid an error.
6678    Use char because int might match the return type of a GCC
6679    builtin and then its argument prototype would still apply.  */
6680 #ifdef __cplusplus
6681 extern "C"
6682 #endif
6683 char ldapssl_install_routines ();
6684 int
6685 main ()
6686 {
6687 return ldapssl_install_routines ();
6688   ;
6689   return 0;
6690 }
6691 _ACEOF
6692 rm -f conftest.$ac_objext conftest$ac_exeext
6693 if { (ac_try="$ac_link"
6694 case "(($ac_try" in
6695   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6696   *) ac_try_echo=$ac_try;;
6697 esac
6698 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6699 $as_echo "$ac_try_echo") >&5
6700   (eval "$ac_link") 2>conftest.er1
6701   ac_status=$?
6702   grep -v '^ *+' conftest.er1 >conftest.err
6703   rm -f conftest.er1
6704   cat conftest.err >&5
6705   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6706   (exit $ac_status); } && {
6707          test -z "$ac_c_werror_flag" ||
6708          test ! -s conftest.err
6709        } && test -s conftest$ac_exeext && {
6710          test "$cross_compiling" = yes ||
6711          $as_test_x conftest$ac_exeext
6712        }; then
6713   eval "$as_ac_Lib=yes"
6714 else
6715   $as_echo "$as_me: failed program was:" >&5
6716 sed 's/^/| /' conftest.$ac_ext >&5
6717
6718         eval "$as_ac_Lib=no"
6719 fi
6720
6721 rm -rf conftest.dSYM
6722 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6723       conftest$ac_exeext conftest.$ac_ext
6724 LIBS=$ac_check_lib_save_LIBS
6725 fi
6726 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6727                  $as_echo "$as_val"'`
6728                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6729 $as_echo "$ac_res" >&6; }
6730 as_val=`eval 'as_val=${'$as_ac_Lib'}
6731                  $as_echo "$as_val"'`
6732    if test "x$as_val" = x""yes; then
6733   apu_has_ldap_netscape_ssl="1"
6734 fi
6735
6736         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
6737 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
6738 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
6739 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6740   $as_echo_n "(cached) " >&6
6741 else
6742   ac_check_lib_save_LIBS=$LIBS
6743 LIBS="-l${ldaplib} ${extralib} $LIBS"
6744 cat >conftest.$ac_ext <<_ACEOF
6745 /* confdefs.h.  */
6746 _ACEOF
6747 cat confdefs.h >>conftest.$ac_ext
6748 cat >>conftest.$ac_ext <<_ACEOF
6749 /* end confdefs.h.  */
6750
6751 /* Override any GCC internal prototype to avoid an error.
6752    Use char because int might match the return type of a GCC
6753    builtin and then its argument prototype would still apply.  */
6754 #ifdef __cplusplus
6755 extern "C"
6756 #endif
6757 char ldap_start_tls_s ();
6758 int
6759 main ()
6760 {
6761 return ldap_start_tls_s ();
6762   ;
6763   return 0;
6764 }
6765 _ACEOF
6766 rm -f conftest.$ac_objext conftest$ac_exeext
6767 if { (ac_try="$ac_link"
6768 case "(($ac_try" in
6769   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6770   *) ac_try_echo=$ac_try;;
6771 esac
6772 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6773 $as_echo "$ac_try_echo") >&5
6774   (eval "$ac_link") 2>conftest.er1
6775   ac_status=$?
6776   grep -v '^ *+' conftest.er1 >conftest.err
6777   rm -f conftest.er1
6778   cat conftest.err >&5
6779   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6780   (exit $ac_status); } && {
6781          test -z "$ac_c_werror_flag" ||
6782          test ! -s conftest.err
6783        } && test -s conftest$ac_exeext && {
6784          test "$cross_compiling" = yes ||
6785          $as_test_x conftest$ac_exeext
6786        }; then
6787   eval "$as_ac_Lib=yes"
6788 else
6789   $as_echo "$as_me: failed program was:" >&5
6790 sed 's/^/| /' conftest.$ac_ext >&5
6791
6792         eval "$as_ac_Lib=no"
6793 fi
6794
6795 rm -rf conftest.dSYM
6796 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6797       conftest$ac_exeext conftest.$ac_ext
6798 LIBS=$ac_check_lib_save_LIBS
6799 fi
6800 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6801                  $as_echo "$as_val"'`
6802                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6803 $as_echo "$ac_res" >&6; }
6804 as_val=`eval 'as_val=${'$as_ac_Lib'}
6805                  $as_echo "$as_val"'`
6806    if test "x$as_val" = x""yes; then
6807   apu_has_ldap_starttls="1"
6808 fi
6809
6810         apu_has_ldap="1";
6811
6812 fi
6813
6814   fi
6815
6816     else
6817
6818   if test ${apu_has_ldap} != "1"; then
6819     ldaplib=$LIBLDAP
6820     extralib=
6821     unset ac_cv_lib_${ldaplib}_ldap_init
6822     unset ac_cv_lib_${ldaplib}___ldap_init
6823     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
6824 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
6825 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
6826 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6827   $as_echo_n "(cached) " >&6
6828 else
6829   ac_check_lib_save_LIBS=$LIBS
6830 LIBS="-l${ldaplib} ${extralib} $LIBS"
6831 cat >conftest.$ac_ext <<_ACEOF
6832 /* confdefs.h.  */
6833 _ACEOF
6834 cat confdefs.h >>conftest.$ac_ext
6835 cat >>conftest.$ac_ext <<_ACEOF
6836 /* end confdefs.h.  */
6837
6838 /* Override any GCC internal prototype to avoid an error.
6839    Use char because int might match the return type of a GCC
6840    builtin and then its argument prototype would still apply.  */
6841 #ifdef __cplusplus
6842 extern "C"
6843 #endif
6844 char ldap_init ();
6845 int
6846 main ()
6847 {
6848 return ldap_init ();
6849   ;
6850   return 0;
6851 }
6852 _ACEOF
6853 rm -f conftest.$ac_objext conftest$ac_exeext
6854 if { (ac_try="$ac_link"
6855 case "(($ac_try" in
6856   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6857   *) ac_try_echo=$ac_try;;
6858 esac
6859 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6860 $as_echo "$ac_try_echo") >&5
6861   (eval "$ac_link") 2>conftest.er1
6862   ac_status=$?
6863   grep -v '^ *+' conftest.er1 >conftest.err
6864   rm -f conftest.er1
6865   cat conftest.err >&5
6866   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6867   (exit $ac_status); } && {
6868          test -z "$ac_c_werror_flag" ||
6869          test ! -s conftest.err
6870        } && test -s conftest$ac_exeext && {
6871          test "$cross_compiling" = yes ||
6872          $as_test_x conftest$ac_exeext
6873        }; then
6874   eval "$as_ac_Lib=yes"
6875 else
6876   $as_echo "$as_me: failed program was:" >&5
6877 sed 's/^/| /' conftest.$ac_ext >&5
6878
6879         eval "$as_ac_Lib=no"
6880 fi
6881
6882 rm -rf conftest.dSYM
6883 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6884       conftest$ac_exeext conftest.$ac_ext
6885 LIBS=$ac_check_lib_save_LIBS
6886 fi
6887 ac_res=`eval 'as_val=${'$as_ac_Lib'}
6888                  $as_echo "$as_val"'`
6889                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6890 $as_echo "$ac_res" >&6; }
6891 as_val=`eval 'as_val=${'$as_ac_Lib'}
6892                  $as_echo "$as_val"'`
6893    if test "x$as_val" = x""yes; then
6894
6895
6896   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
6897     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
6898     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
6899   else
6900     apr_addto_bugger="-l${ldaplib} ${extralib}"
6901     for i in $apr_addto_bugger; do
6902       apr_addto_duplicate="0"
6903       for j in $APRUTIL_EXPORT_LIBS; do
6904         if test "x$i" = "x$j"; then
6905           apr_addto_duplicate="1"
6906           break
6907         fi
6908       done
6909       if test $apr_addto_duplicate = "0"; then
6910         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
6911         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
6912       fi
6913     done
6914   fi
6915
6916
6917   if test "x$APRUTIL_LIBS" = "x"; then
6918     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
6919     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
6920   else
6921     apr_addto_bugger="-l${ldaplib} ${extralib}"
6922     for i in $apr_addto_bugger; do
6923       apr_addto_duplicate="0"
6924       for j in $APRUTIL_LIBS; do
6925         if test "x$i" = "x$j"; then
6926           apr_addto_duplicate="1"
6927           break
6928         fi
6929       done
6930       if test $apr_addto_duplicate = "0"; then
6931         echo "  adding \"$i\" to APRUTIL_LIBS"
6932         APRUTIL_LIBS="$APRUTIL_LIBS $i"
6933       fi
6934     done
6935   fi
6936
6937         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
6938 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
6939 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
6940 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
6941   $as_echo_n "(cached) " >&6
6942 else
6943   ac_check_lib_save_LIBS=$LIBS
6944 LIBS="-l${ldaplib} ${extralib} $LIBS"
6945 cat >conftest.$ac_ext <<_ACEOF
6946 /* confdefs.h.  */
6947 _ACEOF
6948 cat confdefs.h >>conftest.$ac_ext
6949 cat >>conftest.$ac_ext <<_ACEOF
6950 /* end confdefs.h.  */
6951
6952 /* Override any GCC internal prototype to avoid an error.
6953    Use char because int might match the return type of a GCC
6954    builtin and then its argument prototype would still apply.  */
6955 #ifdef __cplusplus
6956 extern "C"
6957 #endif
6958 char ldapssl_install_routines ();
6959 int
6960 main ()
6961 {
6962 return ldapssl_install_routines ();
6963   ;
6964   return 0;
6965 }
6966 _ACEOF
6967 rm -f conftest.$ac_objext conftest$ac_exeext
6968 if { (ac_try="$ac_link"
6969 case "(($ac_try" in
6970   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6971   *) ac_try_echo=$ac_try;;
6972 esac
6973 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6974 $as_echo "$ac_try_echo") >&5
6975   (eval "$ac_link") 2>conftest.er1
6976   ac_status=$?
6977   grep -v '^ *+' conftest.er1 >conftest.err
6978   rm -f conftest.er1
6979   cat conftest.err >&5
6980   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6981   (exit $ac_status); } && {
6982          test -z "$ac_c_werror_flag" ||
6983          test ! -s conftest.err
6984        } && test -s conftest$ac_exeext && {
6985          test "$cross_compiling" = yes ||
6986          $as_test_x conftest$ac_exeext
6987        }; then
6988   eval "$as_ac_Lib=yes"
6989 else
6990   $as_echo "$as_me: failed program was:" >&5
6991 sed 's/^/| /' conftest.$ac_ext >&5
6992
6993         eval "$as_ac_Lib=no"
6994 fi
6995
6996 rm -rf conftest.dSYM
6997 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
6998       conftest$ac_exeext conftest.$ac_ext
6999 LIBS=$ac_check_lib_save_LIBS
7000 fi
7001 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7002                  $as_echo "$as_val"'`
7003                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7004 $as_echo "$ac_res" >&6; }
7005 as_val=`eval 'as_val=${'$as_ac_Lib'}
7006                  $as_echo "$as_val"'`
7007    if test "x$as_val" = x""yes; then
7008   apu_has_ldap_netscape_ssl="1"
7009 fi
7010
7011         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
7012 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
7013 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
7014 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7015   $as_echo_n "(cached) " >&6
7016 else
7017   ac_check_lib_save_LIBS=$LIBS
7018 LIBS="-l${ldaplib} ${extralib} $LIBS"
7019 cat >conftest.$ac_ext <<_ACEOF
7020 /* confdefs.h.  */
7021 _ACEOF
7022 cat confdefs.h >>conftest.$ac_ext
7023 cat >>conftest.$ac_ext <<_ACEOF
7024 /* end confdefs.h.  */
7025
7026 /* Override any GCC internal prototype to avoid an error.
7027    Use char because int might match the return type of a GCC
7028    builtin and then its argument prototype would still apply.  */
7029 #ifdef __cplusplus
7030 extern "C"
7031 #endif
7032 char ldap_start_tls_s ();
7033 int
7034 main ()
7035 {
7036 return ldap_start_tls_s ();
7037   ;
7038   return 0;
7039 }
7040 _ACEOF
7041 rm -f conftest.$ac_objext conftest$ac_exeext
7042 if { (ac_try="$ac_link"
7043 case "(($ac_try" in
7044   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7045   *) ac_try_echo=$ac_try;;
7046 esac
7047 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7048 $as_echo "$ac_try_echo") >&5
7049   (eval "$ac_link") 2>conftest.er1
7050   ac_status=$?
7051   grep -v '^ *+' conftest.er1 >conftest.err
7052   rm -f conftest.er1
7053   cat conftest.err >&5
7054   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7055   (exit $ac_status); } && {
7056          test -z "$ac_c_werror_flag" ||
7057          test ! -s conftest.err
7058        } && test -s conftest$ac_exeext && {
7059          test "$cross_compiling" = yes ||
7060          $as_test_x conftest$ac_exeext
7061        }; then
7062   eval "$as_ac_Lib=yes"
7063 else
7064   $as_echo "$as_me: failed program was:" >&5
7065 sed 's/^/| /' conftest.$ac_ext >&5
7066
7067         eval "$as_ac_Lib=no"
7068 fi
7069
7070 rm -rf conftest.dSYM
7071 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7072       conftest$ac_exeext conftest.$ac_ext
7073 LIBS=$ac_check_lib_save_LIBS
7074 fi
7075 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7076                  $as_echo "$as_val"'`
7077                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7078 $as_echo "$ac_res" >&6; }
7079 as_val=`eval 'as_val=${'$as_ac_Lib'}
7080                  $as_echo "$as_val"'`
7081    if test "x$as_val" = x""yes; then
7082   apu_has_ldap_starttls="1"
7083 fi
7084
7085         apu_has_ldap="1";
7086
7087 fi
7088
7089   fi
7090
7091
7092   if test ${apu_has_ldap} != "1"; then
7093     ldaplib=$LIBLDAP
7094     extralib="-lresolv"
7095     unset ac_cv_lib_${ldaplib}_ldap_init
7096     unset ac_cv_lib_${ldaplib}___ldap_init
7097     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
7098 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
7099 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
7100 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7101   $as_echo_n "(cached) " >&6
7102 else
7103   ac_check_lib_save_LIBS=$LIBS
7104 LIBS="-l${ldaplib} ${extralib} $LIBS"
7105 cat >conftest.$ac_ext <<_ACEOF
7106 /* confdefs.h.  */
7107 _ACEOF
7108 cat confdefs.h >>conftest.$ac_ext
7109 cat >>conftest.$ac_ext <<_ACEOF
7110 /* end confdefs.h.  */
7111
7112 /* Override any GCC internal prototype to avoid an error.
7113    Use char because int might match the return type of a GCC
7114    builtin and then its argument prototype would still apply.  */
7115 #ifdef __cplusplus
7116 extern "C"
7117 #endif
7118 char ldap_init ();
7119 int
7120 main ()
7121 {
7122 return ldap_init ();
7123   ;
7124   return 0;
7125 }
7126 _ACEOF
7127 rm -f conftest.$ac_objext conftest$ac_exeext
7128 if { (ac_try="$ac_link"
7129 case "(($ac_try" in
7130   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7131   *) ac_try_echo=$ac_try;;
7132 esac
7133 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7134 $as_echo "$ac_try_echo") >&5
7135   (eval "$ac_link") 2>conftest.er1
7136   ac_status=$?
7137   grep -v '^ *+' conftest.er1 >conftest.err
7138   rm -f conftest.er1
7139   cat conftest.err >&5
7140   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7141   (exit $ac_status); } && {
7142          test -z "$ac_c_werror_flag" ||
7143          test ! -s conftest.err
7144        } && test -s conftest$ac_exeext && {
7145          test "$cross_compiling" = yes ||
7146          $as_test_x conftest$ac_exeext
7147        }; then
7148   eval "$as_ac_Lib=yes"
7149 else
7150   $as_echo "$as_me: failed program was:" >&5
7151 sed 's/^/| /' conftest.$ac_ext >&5
7152
7153         eval "$as_ac_Lib=no"
7154 fi
7155
7156 rm -rf conftest.dSYM
7157 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7158       conftest$ac_exeext conftest.$ac_ext
7159 LIBS=$ac_check_lib_save_LIBS
7160 fi
7161 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7162                  $as_echo "$as_val"'`
7163                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7164 $as_echo "$ac_res" >&6; }
7165 as_val=`eval 'as_val=${'$as_ac_Lib'}
7166                  $as_echo "$as_val"'`
7167    if test "x$as_val" = x""yes; then
7168
7169
7170   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
7171     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
7172     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
7173   else
7174     apr_addto_bugger="-l${ldaplib} ${extralib}"
7175     for i in $apr_addto_bugger; do
7176       apr_addto_duplicate="0"
7177       for j in $APRUTIL_EXPORT_LIBS; do
7178         if test "x$i" = "x$j"; then
7179           apr_addto_duplicate="1"
7180           break
7181         fi
7182       done
7183       if test $apr_addto_duplicate = "0"; then
7184         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
7185         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
7186       fi
7187     done
7188   fi
7189
7190
7191   if test "x$APRUTIL_LIBS" = "x"; then
7192     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
7193     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
7194   else
7195     apr_addto_bugger="-l${ldaplib} ${extralib}"
7196     for i in $apr_addto_bugger; do
7197       apr_addto_duplicate="0"
7198       for j in $APRUTIL_LIBS; do
7199         if test "x$i" = "x$j"; then
7200           apr_addto_duplicate="1"
7201           break
7202         fi
7203       done
7204       if test $apr_addto_duplicate = "0"; then
7205         echo "  adding \"$i\" to APRUTIL_LIBS"
7206         APRUTIL_LIBS="$APRUTIL_LIBS $i"
7207       fi
7208     done
7209   fi
7210
7211         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
7212 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
7213 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
7214 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7215   $as_echo_n "(cached) " >&6
7216 else
7217   ac_check_lib_save_LIBS=$LIBS
7218 LIBS="-l${ldaplib} ${extralib} $LIBS"
7219 cat >conftest.$ac_ext <<_ACEOF
7220 /* confdefs.h.  */
7221 _ACEOF
7222 cat confdefs.h >>conftest.$ac_ext
7223 cat >>conftest.$ac_ext <<_ACEOF
7224 /* end confdefs.h.  */
7225
7226 /* Override any GCC internal prototype to avoid an error.
7227    Use char because int might match the return type of a GCC
7228    builtin and then its argument prototype would still apply.  */
7229 #ifdef __cplusplus
7230 extern "C"
7231 #endif
7232 char ldapssl_install_routines ();
7233 int
7234 main ()
7235 {
7236 return ldapssl_install_routines ();
7237   ;
7238   return 0;
7239 }
7240 _ACEOF
7241 rm -f conftest.$ac_objext conftest$ac_exeext
7242 if { (ac_try="$ac_link"
7243 case "(($ac_try" in
7244   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7245   *) ac_try_echo=$ac_try;;
7246 esac
7247 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7248 $as_echo "$ac_try_echo") >&5
7249   (eval "$ac_link") 2>conftest.er1
7250   ac_status=$?
7251   grep -v '^ *+' conftest.er1 >conftest.err
7252   rm -f conftest.er1
7253   cat conftest.err >&5
7254   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7255   (exit $ac_status); } && {
7256          test -z "$ac_c_werror_flag" ||
7257          test ! -s conftest.err
7258        } && test -s conftest$ac_exeext && {
7259          test "$cross_compiling" = yes ||
7260          $as_test_x conftest$ac_exeext
7261        }; then
7262   eval "$as_ac_Lib=yes"
7263 else
7264   $as_echo "$as_me: failed program was:" >&5
7265 sed 's/^/| /' conftest.$ac_ext >&5
7266
7267         eval "$as_ac_Lib=no"
7268 fi
7269
7270 rm -rf conftest.dSYM
7271 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7272       conftest$ac_exeext conftest.$ac_ext
7273 LIBS=$ac_check_lib_save_LIBS
7274 fi
7275 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7276                  $as_echo "$as_val"'`
7277                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7278 $as_echo "$ac_res" >&6; }
7279 as_val=`eval 'as_val=${'$as_ac_Lib'}
7280                  $as_echo "$as_val"'`
7281    if test "x$as_val" = x""yes; then
7282   apu_has_ldap_netscape_ssl="1"
7283 fi
7284
7285         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
7286 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
7287 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
7288 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7289   $as_echo_n "(cached) " >&6
7290 else
7291   ac_check_lib_save_LIBS=$LIBS
7292 LIBS="-l${ldaplib} ${extralib} $LIBS"
7293 cat >conftest.$ac_ext <<_ACEOF
7294 /* confdefs.h.  */
7295 _ACEOF
7296 cat confdefs.h >>conftest.$ac_ext
7297 cat >>conftest.$ac_ext <<_ACEOF
7298 /* end confdefs.h.  */
7299
7300 /* Override any GCC internal prototype to avoid an error.
7301    Use char because int might match the return type of a GCC
7302    builtin and then its argument prototype would still apply.  */
7303 #ifdef __cplusplus
7304 extern "C"
7305 #endif
7306 char ldap_start_tls_s ();
7307 int
7308 main ()
7309 {
7310 return ldap_start_tls_s ();
7311   ;
7312   return 0;
7313 }
7314 _ACEOF
7315 rm -f conftest.$ac_objext conftest$ac_exeext
7316 if { (ac_try="$ac_link"
7317 case "(($ac_try" in
7318   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7319   *) ac_try_echo=$ac_try;;
7320 esac
7321 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7322 $as_echo "$ac_try_echo") >&5
7323   (eval "$ac_link") 2>conftest.er1
7324   ac_status=$?
7325   grep -v '^ *+' conftest.er1 >conftest.err
7326   rm -f conftest.er1
7327   cat conftest.err >&5
7328   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7329   (exit $ac_status); } && {
7330          test -z "$ac_c_werror_flag" ||
7331          test ! -s conftest.err
7332        } && test -s conftest$ac_exeext && {
7333          test "$cross_compiling" = yes ||
7334          $as_test_x conftest$ac_exeext
7335        }; then
7336   eval "$as_ac_Lib=yes"
7337 else
7338   $as_echo "$as_me: failed program was:" >&5
7339 sed 's/^/| /' conftest.$ac_ext >&5
7340
7341         eval "$as_ac_Lib=no"
7342 fi
7343
7344 rm -rf conftest.dSYM
7345 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7346       conftest$ac_exeext conftest.$ac_ext
7347 LIBS=$ac_check_lib_save_LIBS
7348 fi
7349 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7350                  $as_echo "$as_val"'`
7351                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7352 $as_echo "$ac_res" >&6; }
7353 as_val=`eval 'as_val=${'$as_ac_Lib'}
7354                  $as_echo "$as_val"'`
7355    if test "x$as_val" = x""yes; then
7356   apu_has_ldap_starttls="1"
7357 fi
7358
7359         apu_has_ldap="1";
7360
7361 fi
7362
7363   fi
7364
7365
7366   if test ${apu_has_ldap} != "1"; then
7367     ldaplib=$LIBLDAP
7368     extralib="-lresolv -lsocket -lnsl"
7369     unset ac_cv_lib_${ldaplib}_ldap_init
7370     unset ac_cv_lib_${ldaplib}___ldap_init
7371     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
7372 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
7373 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
7374 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7375   $as_echo_n "(cached) " >&6
7376 else
7377   ac_check_lib_save_LIBS=$LIBS
7378 LIBS="-l${ldaplib} ${extralib} $LIBS"
7379 cat >conftest.$ac_ext <<_ACEOF
7380 /* confdefs.h.  */
7381 _ACEOF
7382 cat confdefs.h >>conftest.$ac_ext
7383 cat >>conftest.$ac_ext <<_ACEOF
7384 /* end confdefs.h.  */
7385
7386 /* Override any GCC internal prototype to avoid an error.
7387    Use char because int might match the return type of a GCC
7388    builtin and then its argument prototype would still apply.  */
7389 #ifdef __cplusplus
7390 extern "C"
7391 #endif
7392 char ldap_init ();
7393 int
7394 main ()
7395 {
7396 return ldap_init ();
7397   ;
7398   return 0;
7399 }
7400 _ACEOF
7401 rm -f conftest.$ac_objext conftest$ac_exeext
7402 if { (ac_try="$ac_link"
7403 case "(($ac_try" in
7404   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7405   *) ac_try_echo=$ac_try;;
7406 esac
7407 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7408 $as_echo "$ac_try_echo") >&5
7409   (eval "$ac_link") 2>conftest.er1
7410   ac_status=$?
7411   grep -v '^ *+' conftest.er1 >conftest.err
7412   rm -f conftest.er1
7413   cat conftest.err >&5
7414   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7415   (exit $ac_status); } && {
7416          test -z "$ac_c_werror_flag" ||
7417          test ! -s conftest.err
7418        } && test -s conftest$ac_exeext && {
7419          test "$cross_compiling" = yes ||
7420          $as_test_x conftest$ac_exeext
7421        }; then
7422   eval "$as_ac_Lib=yes"
7423 else
7424   $as_echo "$as_me: failed program was:" >&5
7425 sed 's/^/| /' conftest.$ac_ext >&5
7426
7427         eval "$as_ac_Lib=no"
7428 fi
7429
7430 rm -rf conftest.dSYM
7431 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7432       conftest$ac_exeext conftest.$ac_ext
7433 LIBS=$ac_check_lib_save_LIBS
7434 fi
7435 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7436                  $as_echo "$as_val"'`
7437                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7438 $as_echo "$ac_res" >&6; }
7439 as_val=`eval 'as_val=${'$as_ac_Lib'}
7440                  $as_echo "$as_val"'`
7441    if test "x$as_val" = x""yes; then
7442
7443
7444   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
7445     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
7446     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
7447   else
7448     apr_addto_bugger="-l${ldaplib} ${extralib}"
7449     for i in $apr_addto_bugger; do
7450       apr_addto_duplicate="0"
7451       for j in $APRUTIL_EXPORT_LIBS; do
7452         if test "x$i" = "x$j"; then
7453           apr_addto_duplicate="1"
7454           break
7455         fi
7456       done
7457       if test $apr_addto_duplicate = "0"; then
7458         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
7459         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
7460       fi
7461     done
7462   fi
7463
7464
7465   if test "x$APRUTIL_LIBS" = "x"; then
7466     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
7467     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
7468   else
7469     apr_addto_bugger="-l${ldaplib} ${extralib}"
7470     for i in $apr_addto_bugger; do
7471       apr_addto_duplicate="0"
7472       for j in $APRUTIL_LIBS; do
7473         if test "x$i" = "x$j"; then
7474           apr_addto_duplicate="1"
7475           break
7476         fi
7477       done
7478       if test $apr_addto_duplicate = "0"; then
7479         echo "  adding \"$i\" to APRUTIL_LIBS"
7480         APRUTIL_LIBS="$APRUTIL_LIBS $i"
7481       fi
7482     done
7483   fi
7484
7485         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
7486 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
7487 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
7488 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7489   $as_echo_n "(cached) " >&6
7490 else
7491   ac_check_lib_save_LIBS=$LIBS
7492 LIBS="-l${ldaplib} ${extralib} $LIBS"
7493 cat >conftest.$ac_ext <<_ACEOF
7494 /* confdefs.h.  */
7495 _ACEOF
7496 cat confdefs.h >>conftest.$ac_ext
7497 cat >>conftest.$ac_ext <<_ACEOF
7498 /* end confdefs.h.  */
7499
7500 /* Override any GCC internal prototype to avoid an error.
7501    Use char because int might match the return type of a GCC
7502    builtin and then its argument prototype would still apply.  */
7503 #ifdef __cplusplus
7504 extern "C"
7505 #endif
7506 char ldapssl_install_routines ();
7507 int
7508 main ()
7509 {
7510 return ldapssl_install_routines ();
7511   ;
7512   return 0;
7513 }
7514 _ACEOF
7515 rm -f conftest.$ac_objext conftest$ac_exeext
7516 if { (ac_try="$ac_link"
7517 case "(($ac_try" in
7518   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7519   *) ac_try_echo=$ac_try;;
7520 esac
7521 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7522 $as_echo "$ac_try_echo") >&5
7523   (eval "$ac_link") 2>conftest.er1
7524   ac_status=$?
7525   grep -v '^ *+' conftest.er1 >conftest.err
7526   rm -f conftest.er1
7527   cat conftest.err >&5
7528   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7529   (exit $ac_status); } && {
7530          test -z "$ac_c_werror_flag" ||
7531          test ! -s conftest.err
7532        } && test -s conftest$ac_exeext && {
7533          test "$cross_compiling" = yes ||
7534          $as_test_x conftest$ac_exeext
7535        }; then
7536   eval "$as_ac_Lib=yes"
7537 else
7538   $as_echo "$as_me: failed program was:" >&5
7539 sed 's/^/| /' conftest.$ac_ext >&5
7540
7541         eval "$as_ac_Lib=no"
7542 fi
7543
7544 rm -rf conftest.dSYM
7545 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7546       conftest$ac_exeext conftest.$ac_ext
7547 LIBS=$ac_check_lib_save_LIBS
7548 fi
7549 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7550                  $as_echo "$as_val"'`
7551                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7552 $as_echo "$ac_res" >&6; }
7553 as_val=`eval 'as_val=${'$as_ac_Lib'}
7554                  $as_echo "$as_val"'`
7555    if test "x$as_val" = x""yes; then
7556   apu_has_ldap_netscape_ssl="1"
7557 fi
7558
7559         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
7560 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
7561 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
7562 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7563   $as_echo_n "(cached) " >&6
7564 else
7565   ac_check_lib_save_LIBS=$LIBS
7566 LIBS="-l${ldaplib} ${extralib} $LIBS"
7567 cat >conftest.$ac_ext <<_ACEOF
7568 /* confdefs.h.  */
7569 _ACEOF
7570 cat confdefs.h >>conftest.$ac_ext
7571 cat >>conftest.$ac_ext <<_ACEOF
7572 /* end confdefs.h.  */
7573
7574 /* Override any GCC internal prototype to avoid an error.
7575    Use char because int might match the return type of a GCC
7576    builtin and then its argument prototype would still apply.  */
7577 #ifdef __cplusplus
7578 extern "C"
7579 #endif
7580 char ldap_start_tls_s ();
7581 int
7582 main ()
7583 {
7584 return ldap_start_tls_s ();
7585   ;
7586   return 0;
7587 }
7588 _ACEOF
7589 rm -f conftest.$ac_objext conftest$ac_exeext
7590 if { (ac_try="$ac_link"
7591 case "(($ac_try" in
7592   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7593   *) ac_try_echo=$ac_try;;
7594 esac
7595 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7596 $as_echo "$ac_try_echo") >&5
7597   (eval "$ac_link") 2>conftest.er1
7598   ac_status=$?
7599   grep -v '^ *+' conftest.er1 >conftest.err
7600   rm -f conftest.er1
7601   cat conftest.err >&5
7602   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7603   (exit $ac_status); } && {
7604          test -z "$ac_c_werror_flag" ||
7605          test ! -s conftest.err
7606        } && test -s conftest$ac_exeext && {
7607          test "$cross_compiling" = yes ||
7608          $as_test_x conftest$ac_exeext
7609        }; then
7610   eval "$as_ac_Lib=yes"
7611 else
7612   $as_echo "$as_me: failed program was:" >&5
7613 sed 's/^/| /' conftest.$ac_ext >&5
7614
7615         eval "$as_ac_Lib=no"
7616 fi
7617
7618 rm -rf conftest.dSYM
7619 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7620       conftest$ac_exeext conftest.$ac_ext
7621 LIBS=$ac_check_lib_save_LIBS
7622 fi
7623 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7624                  $as_echo "$as_val"'`
7625                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7626 $as_echo "$ac_res" >&6; }
7627 as_val=`eval 'as_val=${'$as_ac_Lib'}
7628                  $as_echo "$as_val"'`
7629    if test "x$as_val" = x""yes; then
7630   apu_has_ldap_starttls="1"
7631 fi
7632
7633         apu_has_ldap="1";
7634
7635 fi
7636
7637   fi
7638
7639
7640   if test ${apu_has_ldap} != "1"; then
7641     ldaplib=$LIBLDAP
7642     extralib="-ldl -lpthread"
7643     unset ac_cv_lib_${ldaplib}_ldap_init
7644     unset ac_cv_lib_${ldaplib}___ldap_init
7645     as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_init" | $as_tr_sh`
7646 { $as_echo "$as_me:$LINENO: checking for ldap_init in -l${ldaplib}" >&5
7647 $as_echo_n "checking for ldap_init in -l${ldaplib}... " >&6; }
7648 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7649   $as_echo_n "(cached) " >&6
7650 else
7651   ac_check_lib_save_LIBS=$LIBS
7652 LIBS="-l${ldaplib} ${extralib} $LIBS"
7653 cat >conftest.$ac_ext <<_ACEOF
7654 /* confdefs.h.  */
7655 _ACEOF
7656 cat confdefs.h >>conftest.$ac_ext
7657 cat >>conftest.$ac_ext <<_ACEOF
7658 /* end confdefs.h.  */
7659
7660 /* Override any GCC internal prototype to avoid an error.
7661    Use char because int might match the return type of a GCC
7662    builtin and then its argument prototype would still apply.  */
7663 #ifdef __cplusplus
7664 extern "C"
7665 #endif
7666 char ldap_init ();
7667 int
7668 main ()
7669 {
7670 return ldap_init ();
7671   ;
7672   return 0;
7673 }
7674 _ACEOF
7675 rm -f conftest.$ac_objext conftest$ac_exeext
7676 if { (ac_try="$ac_link"
7677 case "(($ac_try" in
7678   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7679   *) ac_try_echo=$ac_try;;
7680 esac
7681 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7682 $as_echo "$ac_try_echo") >&5
7683   (eval "$ac_link") 2>conftest.er1
7684   ac_status=$?
7685   grep -v '^ *+' conftest.er1 >conftest.err
7686   rm -f conftest.er1
7687   cat conftest.err >&5
7688   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7689   (exit $ac_status); } && {
7690          test -z "$ac_c_werror_flag" ||
7691          test ! -s conftest.err
7692        } && test -s conftest$ac_exeext && {
7693          test "$cross_compiling" = yes ||
7694          $as_test_x conftest$ac_exeext
7695        }; then
7696   eval "$as_ac_Lib=yes"
7697 else
7698   $as_echo "$as_me: failed program was:" >&5
7699 sed 's/^/| /' conftest.$ac_ext >&5
7700
7701         eval "$as_ac_Lib=no"
7702 fi
7703
7704 rm -rf conftest.dSYM
7705 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7706       conftest$ac_exeext conftest.$ac_ext
7707 LIBS=$ac_check_lib_save_LIBS
7708 fi
7709 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7710                  $as_echo "$as_val"'`
7711                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7712 $as_echo "$ac_res" >&6; }
7713 as_val=`eval 'as_val=${'$as_ac_Lib'}
7714                  $as_echo "$as_val"'`
7715    if test "x$as_val" = x""yes; then
7716
7717
7718   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
7719     echo "  setting APRUTIL_EXPORT_LIBS to \"-l${ldaplib} ${extralib}\""
7720     APRUTIL_EXPORT_LIBS="-l${ldaplib} ${extralib}"
7721   else
7722     apr_addto_bugger="-l${ldaplib} ${extralib}"
7723     for i in $apr_addto_bugger; do
7724       apr_addto_duplicate="0"
7725       for j in $APRUTIL_EXPORT_LIBS; do
7726         if test "x$i" = "x$j"; then
7727           apr_addto_duplicate="1"
7728           break
7729         fi
7730       done
7731       if test $apr_addto_duplicate = "0"; then
7732         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
7733         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
7734       fi
7735     done
7736   fi
7737
7738
7739   if test "x$APRUTIL_LIBS" = "x"; then
7740     echo "  setting APRUTIL_LIBS to \"-l${ldaplib} ${extralib}\""
7741     APRUTIL_LIBS="-l${ldaplib} ${extralib}"
7742   else
7743     apr_addto_bugger="-l${ldaplib} ${extralib}"
7744     for i in $apr_addto_bugger; do
7745       apr_addto_duplicate="0"
7746       for j in $APRUTIL_LIBS; do
7747         if test "x$i" = "x$j"; then
7748           apr_addto_duplicate="1"
7749           break
7750         fi
7751       done
7752       if test $apr_addto_duplicate = "0"; then
7753         echo "  adding \"$i\" to APRUTIL_LIBS"
7754         APRUTIL_LIBS="$APRUTIL_LIBS $i"
7755       fi
7756     done
7757   fi
7758
7759         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_install_routines" | $as_tr_sh`
7760 { $as_echo "$as_me:$LINENO: checking for ldapssl_install_routines in -l${ldaplib}" >&5
7761 $as_echo_n "checking for ldapssl_install_routines in -l${ldaplib}... " >&6; }
7762 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7763   $as_echo_n "(cached) " >&6
7764 else
7765   ac_check_lib_save_LIBS=$LIBS
7766 LIBS="-l${ldaplib} ${extralib} $LIBS"
7767 cat >conftest.$ac_ext <<_ACEOF
7768 /* confdefs.h.  */
7769 _ACEOF
7770 cat confdefs.h >>conftest.$ac_ext
7771 cat >>conftest.$ac_ext <<_ACEOF
7772 /* end confdefs.h.  */
7773
7774 /* Override any GCC internal prototype to avoid an error.
7775    Use char because int might match the return type of a GCC
7776    builtin and then its argument prototype would still apply.  */
7777 #ifdef __cplusplus
7778 extern "C"
7779 #endif
7780 char ldapssl_install_routines ();
7781 int
7782 main ()
7783 {
7784 return ldapssl_install_routines ();
7785   ;
7786   return 0;
7787 }
7788 _ACEOF
7789 rm -f conftest.$ac_objext conftest$ac_exeext
7790 if { (ac_try="$ac_link"
7791 case "(($ac_try" in
7792   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7793   *) ac_try_echo=$ac_try;;
7794 esac
7795 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7796 $as_echo "$ac_try_echo") >&5
7797   (eval "$ac_link") 2>conftest.er1
7798   ac_status=$?
7799   grep -v '^ *+' conftest.er1 >conftest.err
7800   rm -f conftest.er1
7801   cat conftest.err >&5
7802   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7803   (exit $ac_status); } && {
7804          test -z "$ac_c_werror_flag" ||
7805          test ! -s conftest.err
7806        } && test -s conftest$ac_exeext && {
7807          test "$cross_compiling" = yes ||
7808          $as_test_x conftest$ac_exeext
7809        }; then
7810   eval "$as_ac_Lib=yes"
7811 else
7812   $as_echo "$as_me: failed program was:" >&5
7813 sed 's/^/| /' conftest.$ac_ext >&5
7814
7815         eval "$as_ac_Lib=no"
7816 fi
7817
7818 rm -rf conftest.dSYM
7819 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7820       conftest$ac_exeext conftest.$ac_ext
7821 LIBS=$ac_check_lib_save_LIBS
7822 fi
7823 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7824                  $as_echo "$as_val"'`
7825                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7826 $as_echo "$ac_res" >&6; }
7827 as_val=`eval 'as_val=${'$as_ac_Lib'}
7828                  $as_echo "$as_val"'`
7829    if test "x$as_val" = x""yes; then
7830   apu_has_ldap_netscape_ssl="1"
7831 fi
7832
7833         as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldap_start_tls_s" | $as_tr_sh`
7834 { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s in -l${ldaplib}" >&5
7835 $as_echo_n "checking for ldap_start_tls_s in -l${ldaplib}... " >&6; }
7836 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
7837   $as_echo_n "(cached) " >&6
7838 else
7839   ac_check_lib_save_LIBS=$LIBS
7840 LIBS="-l${ldaplib} ${extralib} $LIBS"
7841 cat >conftest.$ac_ext <<_ACEOF
7842 /* confdefs.h.  */
7843 _ACEOF
7844 cat confdefs.h >>conftest.$ac_ext
7845 cat >>conftest.$ac_ext <<_ACEOF
7846 /* end confdefs.h.  */
7847
7848 /* Override any GCC internal prototype to avoid an error.
7849    Use char because int might match the return type of a GCC
7850    builtin and then its argument prototype would still apply.  */
7851 #ifdef __cplusplus
7852 extern "C"
7853 #endif
7854 char ldap_start_tls_s ();
7855 int
7856 main ()
7857 {
7858 return ldap_start_tls_s ();
7859   ;
7860   return 0;
7861 }
7862 _ACEOF
7863 rm -f conftest.$ac_objext conftest$ac_exeext
7864 if { (ac_try="$ac_link"
7865 case "(($ac_try" in
7866   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7867   *) ac_try_echo=$ac_try;;
7868 esac
7869 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7870 $as_echo "$ac_try_echo") >&5
7871   (eval "$ac_link") 2>conftest.er1
7872   ac_status=$?
7873   grep -v '^ *+' conftest.er1 >conftest.err
7874   rm -f conftest.er1
7875   cat conftest.err >&5
7876   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7877   (exit $ac_status); } && {
7878          test -z "$ac_c_werror_flag" ||
7879          test ! -s conftest.err
7880        } && test -s conftest$ac_exeext && {
7881          test "$cross_compiling" = yes ||
7882          $as_test_x conftest$ac_exeext
7883        }; then
7884   eval "$as_ac_Lib=yes"
7885 else
7886   $as_echo "$as_me: failed program was:" >&5
7887 sed 's/^/| /' conftest.$ac_ext >&5
7888
7889         eval "$as_ac_Lib=no"
7890 fi
7891
7892 rm -rf conftest.dSYM
7893 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7894       conftest$ac_exeext conftest.$ac_ext
7895 LIBS=$ac_check_lib_save_LIBS
7896 fi
7897 ac_res=`eval 'as_val=${'$as_ac_Lib'}
7898                  $as_echo "$as_val"'`
7899                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7900 $as_echo "$ac_res" >&6; }
7901 as_val=`eval 'as_val=${'$as_ac_Lib'}
7902                  $as_echo "$as_val"'`
7903    if test "x$as_val" = x""yes; then
7904   apu_has_ldap_starttls="1"
7905 fi
7906
7907         apu_has_ldap="1";
7908
7909 fi
7910
7911   fi
7912
7913     fi
7914
7915     test ${apu_has_ldap} != "1" && { { $as_echo "$as_me:$LINENO: error: could not find an LDAP library" >&5
7916 $as_echo "$as_me: error: could not find an LDAP library" >&2;}
7917    { (exit 1); exit 1; }; }
7918
7919 { $as_echo "$as_me:$LINENO: checking for ber_init in -llber" >&5
7920 $as_echo_n "checking for ber_init in -llber... " >&6; }
7921 if test "${ac_cv_lib_lber_ber_init+set}" = set; then
7922   $as_echo_n "(cached) " >&6
7923 else
7924   ac_check_lib_save_LIBS=$LIBS
7925 LIBS="-llber  $LIBS"
7926 cat >conftest.$ac_ext <<_ACEOF
7927 /* confdefs.h.  */
7928 _ACEOF
7929 cat confdefs.h >>conftest.$ac_ext
7930 cat >>conftest.$ac_ext <<_ACEOF
7931 /* end confdefs.h.  */
7932
7933 /* Override any GCC internal prototype to avoid an error.
7934    Use char because int might match the return type of a GCC
7935    builtin and then its argument prototype would still apply.  */
7936 #ifdef __cplusplus
7937 extern "C"
7938 #endif
7939 char ber_init ();
7940 int
7941 main ()
7942 {
7943 return ber_init ();
7944   ;
7945   return 0;
7946 }
7947 _ACEOF
7948 rm -f conftest.$ac_objext conftest$ac_exeext
7949 if { (ac_try="$ac_link"
7950 case "(($ac_try" in
7951   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7952   *) ac_try_echo=$ac_try;;
7953 esac
7954 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7955 $as_echo "$ac_try_echo") >&5
7956   (eval "$ac_link") 2>conftest.er1
7957   ac_status=$?
7958   grep -v '^ *+' conftest.er1 >conftest.err
7959   rm -f conftest.er1
7960   cat conftest.err >&5
7961   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7962   (exit $ac_status); } && {
7963          test -z "$ac_c_werror_flag" ||
7964          test ! -s conftest.err
7965        } && test -s conftest$ac_exeext && {
7966          test "$cross_compiling" = yes ||
7967          $as_test_x conftest$ac_exeext
7968        }; then
7969   ac_cv_lib_lber_ber_init=yes
7970 else
7971   $as_echo "$as_me: failed program was:" >&5
7972 sed 's/^/| /' conftest.$ac_ext >&5
7973
7974         ac_cv_lib_lber_ber_init=no
7975 fi
7976
7977 rm -rf conftest.dSYM
7978 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7979       conftest$ac_exeext conftest.$ac_ext
7980 LIBS=$ac_check_lib_save_LIBS
7981 fi
7982 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lber_ber_init" >&5
7983 $as_echo "$ac_cv_lib_lber_ber_init" >&6; }
7984 if test "x$ac_cv_lib_lber_ber_init" = x""yes; then
7985   cat >>confdefs.h <<_ACEOF
7986 #define HAVE_LIBLBER 1
7987 _ACEOF
7988
7989   LIBS="-llber $LIBS"
7990
7991 fi
7992
7993
7994
7995 for ac_header in lber.h
7996 do
7997 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7998 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
7999   { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
8000 $as_echo_n "checking for $ac_header... " >&6; }
8001 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
8002   $as_echo_n "(cached) " >&6
8003 fi
8004 ac_res=`eval 'as_val=${'$as_ac_Header'}
8005                  $as_echo "$as_val"'`
8006                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
8007 $as_echo "$ac_res" >&6; }
8008 else
8009   # Is the header compilable?
8010 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
8011 $as_echo_n "checking $ac_header usability... " >&6; }
8012 cat >conftest.$ac_ext <<_ACEOF
8013 /* confdefs.h.  */
8014 _ACEOF
8015 cat confdefs.h >>conftest.$ac_ext
8016 cat >>conftest.$ac_ext <<_ACEOF
8017 /* end confdefs.h.  */
8018 $ac_includes_default
8019 #include <$ac_header>
8020 _ACEOF
8021 rm -f conftest.$ac_objext
8022 if { (ac_try="$ac_compile"
8023 case "(($ac_try" in
8024   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8025   *) ac_try_echo=$ac_try;;
8026 esac
8027 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8028 $as_echo "$ac_try_echo") >&5
8029   (eval "$ac_compile") 2>conftest.er1
8030   ac_status=$?
8031   grep -v '^ *+' conftest.er1 >conftest.err
8032   rm -f conftest.er1
8033   cat conftest.err >&5
8034   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8035   (exit $ac_status); } && {
8036          test -z "$ac_c_werror_flag" ||
8037          test ! -s conftest.err
8038        } && test -s conftest.$ac_objext; then
8039   ac_header_compiler=yes
8040 else
8041   $as_echo "$as_me: failed program was:" >&5
8042 sed 's/^/| /' conftest.$ac_ext >&5
8043
8044         ac_header_compiler=no
8045 fi
8046
8047 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8048 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
8049 $as_echo "$ac_header_compiler" >&6; }
8050
8051 # Is the header present?
8052 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
8053 $as_echo_n "checking $ac_header presence... " >&6; }
8054 cat >conftest.$ac_ext <<_ACEOF
8055 /* confdefs.h.  */
8056 _ACEOF
8057 cat confdefs.h >>conftest.$ac_ext
8058 cat >>conftest.$ac_ext <<_ACEOF
8059 /* end confdefs.h.  */
8060 #include <$ac_header>
8061 _ACEOF
8062 if { (ac_try="$ac_cpp conftest.$ac_ext"
8063 case "(($ac_try" in
8064   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8065   *) ac_try_echo=$ac_try;;
8066 esac
8067 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8068 $as_echo "$ac_try_echo") >&5
8069   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8070   ac_status=$?
8071   grep -v '^ *+' conftest.er1 >conftest.err
8072   rm -f conftest.er1
8073   cat conftest.err >&5
8074   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8075   (exit $ac_status); } >/dev/null && {
8076          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
8077          test ! -s conftest.err
8078        }; then
8079   ac_header_preproc=yes
8080 else
8081   $as_echo "$as_me: failed program was:" >&5
8082 sed 's/^/| /' conftest.$ac_ext >&5
8083
8084   ac_header_preproc=no
8085 fi
8086
8087 rm -f conftest.err conftest.$ac_ext
8088 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
8089 $as_echo "$ac_header_preproc" >&6; }
8090
8091 # So?  What about this header?
8092 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
8093   yes:no: )
8094     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
8095 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
8096     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
8097 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
8098     ac_header_preproc=yes
8099     ;;
8100   no:yes:* )
8101     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
8102 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
8103     { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
8104 $as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
8105     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
8106 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
8107     { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
8108 $as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
8109     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
8110 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
8111     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
8112 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
8113
8114     ;;
8115 esac
8116 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
8117 $as_echo_n "checking for $ac_header... " >&6; }
8118 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
8119   $as_echo_n "(cached) " >&6
8120 else
8121   eval "$as_ac_Header=\$ac_header_preproc"
8122 fi
8123 ac_res=`eval 'as_val=${'$as_ac_Header'}
8124                  $as_echo "$as_val"'`
8125                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
8126 $as_echo "$ac_res" >&6; }
8127
8128 fi
8129 as_val=`eval 'as_val=${'$as_ac_Header'}
8130                  $as_echo "$as_val"'`
8131    if test "x$as_val" = x""yes; then
8132   cat >>confdefs.h <<_ACEOF
8133 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
8134 _ACEOF
8135  lber_h="#include <lber.h>"
8136 fi
8137
8138 done
8139
8140
8141 for ac_header in ldap.h
8142 do
8143 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
8144 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
8145 $as_echo_n "checking for $ac_header... " >&6; }
8146 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
8147   $as_echo_n "(cached) " >&6
8148 else
8149   cat >conftest.$ac_ext <<_ACEOF
8150 /* confdefs.h.  */
8151 _ACEOF
8152 cat confdefs.h >>conftest.$ac_ext
8153 cat >>conftest.$ac_ext <<_ACEOF
8154 /* end confdefs.h.  */
8155 #if HAVE_LBER_H
8156 # include <lber.h>
8157 # endif
8158
8159
8160 #include <$ac_header>
8161 _ACEOF
8162 rm -f conftest.$ac_objext
8163 if { (ac_try="$ac_compile"
8164 case "(($ac_try" in
8165   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8166   *) ac_try_echo=$ac_try;;
8167 esac
8168 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8169 $as_echo "$ac_try_echo") >&5
8170   (eval "$ac_compile") 2>conftest.er1
8171   ac_status=$?
8172   grep -v '^ *+' conftest.er1 >conftest.err
8173   rm -f conftest.er1
8174   cat conftest.err >&5
8175   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8176   (exit $ac_status); } && {
8177          test -z "$ac_c_werror_flag" ||
8178          test ! -s conftest.err
8179        } && test -s conftest.$ac_objext; then
8180   eval "$as_ac_Header=yes"
8181 else
8182   $as_echo "$as_me: failed program was:" >&5
8183 sed 's/^/| /' conftest.$ac_ext >&5
8184
8185         eval "$as_ac_Header=no"
8186 fi
8187
8188 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8189 fi
8190 ac_res=`eval 'as_val=${'$as_ac_Header'}
8191                  $as_echo "$as_val"'`
8192                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
8193 $as_echo "$ac_res" >&6; }
8194 as_val=`eval 'as_val=${'$as_ac_Header'}
8195                  $as_echo "$as_val"'`
8196    if test "x$as_val" = x""yes; then
8197   cat >>confdefs.h <<_ACEOF
8198 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
8199 _ACEOF
8200  ldap_h="#include <ldap.h>"
8201 fi
8202
8203 done
8204
8205
8206 for ac_header in ldap_ssl.h
8207 do
8208 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
8209 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
8210   { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
8211 $as_echo_n "checking for $ac_header... " >&6; }
8212 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
8213   $as_echo_n "(cached) " >&6
8214 fi
8215 ac_res=`eval 'as_val=${'$as_ac_Header'}
8216                  $as_echo "$as_val"'`
8217                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
8218 $as_echo "$ac_res" >&6; }
8219 else
8220   # Is the header compilable?
8221 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
8222 $as_echo_n "checking $ac_header usability... " >&6; }
8223 cat >conftest.$ac_ext <<_ACEOF
8224 /* confdefs.h.  */
8225 _ACEOF
8226 cat confdefs.h >>conftest.$ac_ext
8227 cat >>conftest.$ac_ext <<_ACEOF
8228 /* end confdefs.h.  */
8229 $ac_includes_default
8230 #include <$ac_header>
8231 _ACEOF
8232 rm -f conftest.$ac_objext
8233 if { (ac_try="$ac_compile"
8234 case "(($ac_try" in
8235   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8236   *) ac_try_echo=$ac_try;;
8237 esac
8238 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8239 $as_echo "$ac_try_echo") >&5
8240   (eval "$ac_compile") 2>conftest.er1
8241   ac_status=$?
8242   grep -v '^ *+' conftest.er1 >conftest.err
8243   rm -f conftest.er1
8244   cat conftest.err >&5
8245   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8246   (exit $ac_status); } && {
8247          test -z "$ac_c_werror_flag" ||
8248          test ! -s conftest.err
8249        } && test -s conftest.$ac_objext; then
8250   ac_header_compiler=yes
8251 else
8252   $as_echo "$as_me: failed program was:" >&5
8253 sed 's/^/| /' conftest.$ac_ext >&5
8254
8255         ac_header_compiler=no
8256 fi
8257
8258 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8259 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
8260 $as_echo "$ac_header_compiler" >&6; }
8261
8262 # Is the header present?
8263 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
8264 $as_echo_n "checking $ac_header presence... " >&6; }
8265 cat >conftest.$ac_ext <<_ACEOF
8266 /* confdefs.h.  */
8267 _ACEOF
8268 cat confdefs.h >>conftest.$ac_ext
8269 cat >>conftest.$ac_ext <<_ACEOF
8270 /* end confdefs.h.  */
8271 #include <$ac_header>
8272 _ACEOF
8273 if { (ac_try="$ac_cpp conftest.$ac_ext"
8274 case "(($ac_try" in
8275   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8276   *) ac_try_echo=$ac_try;;
8277 esac
8278 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8279 $as_echo "$ac_try_echo") >&5
8280   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8281   ac_status=$?
8282   grep -v '^ *+' conftest.er1 >conftest.err
8283   rm -f conftest.er1
8284   cat conftest.err >&5
8285   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8286   (exit $ac_status); } >/dev/null && {
8287          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
8288          test ! -s conftest.err
8289        }; then
8290   ac_header_preproc=yes
8291 else
8292   $as_echo "$as_me: failed program was:" >&5
8293 sed 's/^/| /' conftest.$ac_ext >&5
8294
8295   ac_header_preproc=no
8296 fi
8297
8298 rm -f conftest.err conftest.$ac_ext
8299 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
8300 $as_echo "$ac_header_preproc" >&6; }
8301
8302 # So?  What about this header?
8303 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
8304   yes:no: )
8305     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
8306 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
8307     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
8308 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
8309     ac_header_preproc=yes
8310     ;;
8311   no:yes:* )
8312     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
8313 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
8314     { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
8315 $as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
8316     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
8317 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
8318     { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
8319 $as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
8320     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
8321 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
8322     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
8323 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
8324
8325     ;;
8326 esac
8327 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
8328 $as_echo_n "checking for $ac_header... " >&6; }
8329 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
8330   $as_echo_n "(cached) " >&6
8331 else
8332   eval "$as_ac_Header=\$ac_header_preproc"
8333 fi
8334 ac_res=`eval 'as_val=${'$as_ac_Header'}
8335                  $as_echo "$as_val"'`
8336                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
8337 $as_echo "$ac_res" >&6; }
8338
8339 fi
8340 as_val=`eval 'as_val=${'$as_ac_Header'}
8341                  $as_echo "$as_val"'`
8342    if test "x$as_val" = x""yes; then
8343   cat >>confdefs.h <<_ACEOF
8344 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
8345 _ACEOF
8346  ldap_ssl_h="#include <ldap_ssl.h>"
8347 fi
8348
8349 done
8350
8351
8352     CPPFLAGS=$save_cppflags
8353     LDFLAGS=$save_ldflags
8354     LIBS=$save_libs
8355
8356 fi
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368   apu_use_sdbm=0
8369   apu_use_ndbm=0
8370   apu_use_gdbm=0
8371   apu_use_db=0
8372     apu_have_sdbm=1
8373   apu_have_gdbm=0
8374   apu_have_ndbm=0
8375   apu_have_db=0
8376
8377   apu_db_header=db.h                # default so apu_select_dbm.h is syntactically correct
8378   apu_db_version=0
8379
8380
8381 # Check whether --with-dbm was given.
8382 if test "${with_dbm+set}" = set; then
8383   withval=$with_dbm;
8384     if test "$withval" = "yes"; then
8385       { { $as_echo "$as_me:$LINENO: error: --with-dbm needs to specify a DBM type to use.
8386         One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48" >&5
8387 $as_echo "$as_me: error: --with-dbm needs to specify a DBM type to use.
8388         One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48" >&2;}
8389    { (exit 1); exit 1; }; }
8390     fi
8391     requested="$withval"
8392
8393 else
8394
8395     requested=default
8396
8397 fi
8398
8399
8400
8401 # Check whether --with-gdbm was given.
8402 if test "${with_gdbm+set}" = set; then
8403   withval=$with_gdbm;
8404     apu_have_gdbm=0
8405     if test "$withval" = "yes"; then
8406       if test "${ac_cv_header_gdbm_h+set}" = set; then
8407   { $as_echo "$as_me:$LINENO: checking for gdbm.h" >&5
8408 $as_echo_n "checking for gdbm.h... " >&6; }
8409 if test "${ac_cv_header_gdbm_h+set}" = set; then
8410   $as_echo_n "(cached) " >&6
8411 fi
8412 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_gdbm_h" >&5
8413 $as_echo "$ac_cv_header_gdbm_h" >&6; }
8414 else
8415   # Is the header compilable?
8416 { $as_echo "$as_me:$LINENO: checking gdbm.h usability" >&5
8417 $as_echo_n "checking gdbm.h usability... " >&6; }
8418 cat >conftest.$ac_ext <<_ACEOF
8419 /* confdefs.h.  */
8420 _ACEOF
8421 cat confdefs.h >>conftest.$ac_ext
8422 cat >>conftest.$ac_ext <<_ACEOF
8423 /* end confdefs.h.  */
8424 $ac_includes_default
8425 #include <gdbm.h>
8426 _ACEOF
8427 rm -f conftest.$ac_objext
8428 if { (ac_try="$ac_compile"
8429 case "(($ac_try" in
8430   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8431   *) ac_try_echo=$ac_try;;
8432 esac
8433 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8434 $as_echo "$ac_try_echo") >&5
8435   (eval "$ac_compile") 2>conftest.er1
8436   ac_status=$?
8437   grep -v '^ *+' conftest.er1 >conftest.err
8438   rm -f conftest.er1
8439   cat conftest.err >&5
8440   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8441   (exit $ac_status); } && {
8442          test -z "$ac_c_werror_flag" ||
8443          test ! -s conftest.err
8444        } && test -s conftest.$ac_objext; then
8445   ac_header_compiler=yes
8446 else
8447   $as_echo "$as_me: failed program was:" >&5
8448 sed 's/^/| /' conftest.$ac_ext >&5
8449
8450         ac_header_compiler=no
8451 fi
8452
8453 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8454 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
8455 $as_echo "$ac_header_compiler" >&6; }
8456
8457 # Is the header present?
8458 { $as_echo "$as_me:$LINENO: checking gdbm.h presence" >&5
8459 $as_echo_n "checking gdbm.h presence... " >&6; }
8460 cat >conftest.$ac_ext <<_ACEOF
8461 /* confdefs.h.  */
8462 _ACEOF
8463 cat confdefs.h >>conftest.$ac_ext
8464 cat >>conftest.$ac_ext <<_ACEOF
8465 /* end confdefs.h.  */
8466 #include <gdbm.h>
8467 _ACEOF
8468 if { (ac_try="$ac_cpp conftest.$ac_ext"
8469 case "(($ac_try" in
8470   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8471   *) ac_try_echo=$ac_try;;
8472 esac
8473 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8474 $as_echo "$ac_try_echo") >&5
8475   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8476   ac_status=$?
8477   grep -v '^ *+' conftest.er1 >conftest.err
8478   rm -f conftest.er1
8479   cat conftest.err >&5
8480   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8481   (exit $ac_status); } >/dev/null && {
8482          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
8483          test ! -s conftest.err
8484        }; then
8485   ac_header_preproc=yes
8486 else
8487   $as_echo "$as_me: failed program was:" >&5
8488 sed 's/^/| /' conftest.$ac_ext >&5
8489
8490   ac_header_preproc=no
8491 fi
8492
8493 rm -f conftest.err conftest.$ac_ext
8494 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
8495 $as_echo "$ac_header_preproc" >&6; }
8496
8497 # So?  What about this header?
8498 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
8499   yes:no: )
8500     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&5
8501 $as_echo "$as_me: WARNING: gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
8502     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: proceeding with the compiler's result" >&5
8503 $as_echo "$as_me: WARNING: gdbm.h: proceeding with the compiler's result" >&2;}
8504     ac_header_preproc=yes
8505     ;;
8506   no:yes:* )
8507     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: present but cannot be compiled" >&5
8508 $as_echo "$as_me: WARNING: gdbm.h: present but cannot be compiled" >&2;}
8509     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h:     check for missing prerequisite headers?" >&5
8510 $as_echo "$as_me: WARNING: gdbm.h:     check for missing prerequisite headers?" >&2;}
8511     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: see the Autoconf documentation" >&5
8512 $as_echo "$as_me: WARNING: gdbm.h: see the Autoconf documentation" >&2;}
8513     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h:     section \"Present But Cannot Be Compiled\"" >&5
8514 $as_echo "$as_me: WARNING: gdbm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
8515     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: proceeding with the preprocessor's result" >&5
8516 $as_echo "$as_me: WARNING: gdbm.h: proceeding with the preprocessor's result" >&2;}
8517     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: in the future, the compiler will take precedence" >&5
8518 $as_echo "$as_me: WARNING: gdbm.h: in the future, the compiler will take precedence" >&2;}
8519
8520     ;;
8521 esac
8522 { $as_echo "$as_me:$LINENO: checking for gdbm.h" >&5
8523 $as_echo_n "checking for gdbm.h... " >&6; }
8524 if test "${ac_cv_header_gdbm_h+set}" = set; then
8525   $as_echo_n "(cached) " >&6
8526 else
8527   ac_cv_header_gdbm_h=$ac_header_preproc
8528 fi
8529 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_gdbm_h" >&5
8530 $as_echo "$ac_cv_header_gdbm_h" >&6; }
8531
8532 fi
8533 if test "x$ac_cv_header_gdbm_h" = x""yes; then
8534   { $as_echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5
8535 $as_echo_n "checking for gdbm_open in -lgdbm... " >&6; }
8536 if test "${ac_cv_lib_gdbm_gdbm_open+set}" = set; then
8537   $as_echo_n "(cached) " >&6
8538 else
8539   ac_check_lib_save_LIBS=$LIBS
8540 LIBS="-lgdbm  $LIBS"
8541 cat >conftest.$ac_ext <<_ACEOF
8542 /* confdefs.h.  */
8543 _ACEOF
8544 cat confdefs.h >>conftest.$ac_ext
8545 cat >>conftest.$ac_ext <<_ACEOF
8546 /* end confdefs.h.  */
8547
8548 /* Override any GCC internal prototype to avoid an error.
8549    Use char because int might match the return type of a GCC
8550    builtin and then its argument prototype would still apply.  */
8551 #ifdef __cplusplus
8552 extern "C"
8553 #endif
8554 char gdbm_open ();
8555 int
8556 main ()
8557 {
8558 return gdbm_open ();
8559   ;
8560   return 0;
8561 }
8562 _ACEOF
8563 rm -f conftest.$ac_objext conftest$ac_exeext
8564 if { (ac_try="$ac_link"
8565 case "(($ac_try" in
8566   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8567   *) ac_try_echo=$ac_try;;
8568 esac
8569 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8570 $as_echo "$ac_try_echo") >&5
8571   (eval "$ac_link") 2>conftest.er1
8572   ac_status=$?
8573   grep -v '^ *+' conftest.er1 >conftest.err
8574   rm -f conftest.er1
8575   cat conftest.err >&5
8576   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8577   (exit $ac_status); } && {
8578          test -z "$ac_c_werror_flag" ||
8579          test ! -s conftest.err
8580        } && test -s conftest$ac_exeext && {
8581          test "$cross_compiling" = yes ||
8582          $as_test_x conftest$ac_exeext
8583        }; then
8584   ac_cv_lib_gdbm_gdbm_open=yes
8585 else
8586   $as_echo "$as_me: failed program was:" >&5
8587 sed 's/^/| /' conftest.$ac_ext >&5
8588
8589         ac_cv_lib_gdbm_gdbm_open=no
8590 fi
8591
8592 rm -rf conftest.dSYM
8593 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
8594       conftest$ac_exeext conftest.$ac_ext
8595 LIBS=$ac_check_lib_save_LIBS
8596 fi
8597 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_gdbm_open" >&5
8598 $as_echo "$ac_cv_lib_gdbm_gdbm_open" >&6; }
8599 if test "x$ac_cv_lib_gdbm_gdbm_open" = x""yes; then
8600   apu_have_gdbm=1
8601 fi
8602
8603 fi
8604
8605
8606     elif test "$withval" = "no"; then
8607       apu_have_gdbm=0
8608     else
8609       CPPFLAGS="-I$withval/include"
8610       LIBS="-L$withval/lib "
8611
8612       { $as_echo "$as_me:$LINENO: checking checking for gdbm in $withval" >&5
8613 $as_echo_n "checking checking for gdbm in $withval... " >&6; }
8614       if test "${ac_cv_header_gdbm_h+set}" = set; then
8615   { $as_echo "$as_me:$LINENO: checking for gdbm.h" >&5
8616 $as_echo_n "checking for gdbm.h... " >&6; }
8617 if test "${ac_cv_header_gdbm_h+set}" = set; then
8618   $as_echo_n "(cached) " >&6
8619 fi
8620 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_gdbm_h" >&5
8621 $as_echo "$ac_cv_header_gdbm_h" >&6; }
8622 else
8623   # Is the header compilable?
8624 { $as_echo "$as_me:$LINENO: checking gdbm.h usability" >&5
8625 $as_echo_n "checking gdbm.h usability... " >&6; }
8626 cat >conftest.$ac_ext <<_ACEOF
8627 /* confdefs.h.  */
8628 _ACEOF
8629 cat confdefs.h >>conftest.$ac_ext
8630 cat >>conftest.$ac_ext <<_ACEOF
8631 /* end confdefs.h.  */
8632 $ac_includes_default
8633 #include <gdbm.h>
8634 _ACEOF
8635 rm -f conftest.$ac_objext
8636 if { (ac_try="$ac_compile"
8637 case "(($ac_try" in
8638   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8639   *) ac_try_echo=$ac_try;;
8640 esac
8641 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8642 $as_echo "$ac_try_echo") >&5
8643   (eval "$ac_compile") 2>conftest.er1
8644   ac_status=$?
8645   grep -v '^ *+' conftest.er1 >conftest.err
8646   rm -f conftest.er1
8647   cat conftest.err >&5
8648   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8649   (exit $ac_status); } && {
8650          test -z "$ac_c_werror_flag" ||
8651          test ! -s conftest.err
8652        } && test -s conftest.$ac_objext; then
8653   ac_header_compiler=yes
8654 else
8655   $as_echo "$as_me: failed program was:" >&5
8656 sed 's/^/| /' conftest.$ac_ext >&5
8657
8658         ac_header_compiler=no
8659 fi
8660
8661 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8662 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
8663 $as_echo "$ac_header_compiler" >&6; }
8664
8665 # Is the header present?
8666 { $as_echo "$as_me:$LINENO: checking gdbm.h presence" >&5
8667 $as_echo_n "checking gdbm.h presence... " >&6; }
8668 cat >conftest.$ac_ext <<_ACEOF
8669 /* confdefs.h.  */
8670 _ACEOF
8671 cat confdefs.h >>conftest.$ac_ext
8672 cat >>conftest.$ac_ext <<_ACEOF
8673 /* end confdefs.h.  */
8674 #include <gdbm.h>
8675 _ACEOF
8676 if { (ac_try="$ac_cpp conftest.$ac_ext"
8677 case "(($ac_try" in
8678   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8679   *) ac_try_echo=$ac_try;;
8680 esac
8681 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8682 $as_echo "$ac_try_echo") >&5
8683   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8684   ac_status=$?
8685   grep -v '^ *+' conftest.er1 >conftest.err
8686   rm -f conftest.er1
8687   cat conftest.err >&5
8688   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8689   (exit $ac_status); } >/dev/null && {
8690          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
8691          test ! -s conftest.err
8692        }; then
8693   ac_header_preproc=yes
8694 else
8695   $as_echo "$as_me: failed program was:" >&5
8696 sed 's/^/| /' conftest.$ac_ext >&5
8697
8698   ac_header_preproc=no
8699 fi
8700
8701 rm -f conftest.err conftest.$ac_ext
8702 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
8703 $as_echo "$ac_header_preproc" >&6; }
8704
8705 # So?  What about this header?
8706 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
8707   yes:no: )
8708     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&5
8709 $as_echo "$as_me: WARNING: gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
8710     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: proceeding with the compiler's result" >&5
8711 $as_echo "$as_me: WARNING: gdbm.h: proceeding with the compiler's result" >&2;}
8712     ac_header_preproc=yes
8713     ;;
8714   no:yes:* )
8715     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: present but cannot be compiled" >&5
8716 $as_echo "$as_me: WARNING: gdbm.h: present but cannot be compiled" >&2;}
8717     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h:     check for missing prerequisite headers?" >&5
8718 $as_echo "$as_me: WARNING: gdbm.h:     check for missing prerequisite headers?" >&2;}
8719     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: see the Autoconf documentation" >&5
8720 $as_echo "$as_me: WARNING: gdbm.h: see the Autoconf documentation" >&2;}
8721     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h:     section \"Present But Cannot Be Compiled\"" >&5
8722 $as_echo "$as_me: WARNING: gdbm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
8723     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: proceeding with the preprocessor's result" >&5
8724 $as_echo "$as_me: WARNING: gdbm.h: proceeding with the preprocessor's result" >&2;}
8725     { $as_echo "$as_me:$LINENO: WARNING: gdbm.h: in the future, the compiler will take precedence" >&5
8726 $as_echo "$as_me: WARNING: gdbm.h: in the future, the compiler will take precedence" >&2;}
8727
8728     ;;
8729 esac
8730 { $as_echo "$as_me:$LINENO: checking for gdbm.h" >&5
8731 $as_echo_n "checking for gdbm.h... " >&6; }
8732 if test "${ac_cv_header_gdbm_h+set}" = set; then
8733   $as_echo_n "(cached) " >&6
8734 else
8735   ac_cv_header_gdbm_h=$ac_header_preproc
8736 fi
8737 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_gdbm_h" >&5
8738 $as_echo "$ac_cv_header_gdbm_h" >&6; }
8739
8740 fi
8741 if test "x$ac_cv_header_gdbm_h" = x""yes; then
8742   { $as_echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5
8743 $as_echo_n "checking for gdbm_open in -lgdbm... " >&6; }
8744 if test "${ac_cv_lib_gdbm_gdbm_open+set}" = set; then
8745   $as_echo_n "(cached) " >&6
8746 else
8747   ac_check_lib_save_LIBS=$LIBS
8748 LIBS="-lgdbm  $LIBS"
8749 cat >conftest.$ac_ext <<_ACEOF
8750 /* confdefs.h.  */
8751 _ACEOF
8752 cat confdefs.h >>conftest.$ac_ext
8753 cat >>conftest.$ac_ext <<_ACEOF
8754 /* end confdefs.h.  */
8755
8756 /* Override any GCC internal prototype to avoid an error.
8757    Use char because int might match the return type of a GCC
8758    builtin and then its argument prototype would still apply.  */
8759 #ifdef __cplusplus
8760 extern "C"
8761 #endif
8762 char gdbm_open ();
8763 int
8764 main ()
8765 {
8766 return gdbm_open ();
8767   ;
8768   return 0;
8769 }
8770 _ACEOF
8771 rm -f conftest.$ac_objext conftest$ac_exeext
8772 if { (ac_try="$ac_link"
8773 case "(($ac_try" in
8774   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8775   *) ac_try_echo=$ac_try;;
8776 esac
8777 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8778 $as_echo "$ac_try_echo") >&5
8779   (eval "$ac_link") 2>conftest.er1
8780   ac_status=$?
8781   grep -v '^ *+' conftest.er1 >conftest.err
8782   rm -f conftest.er1
8783   cat conftest.err >&5
8784   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8785   (exit $ac_status); } && {
8786          test -z "$ac_c_werror_flag" ||
8787          test ! -s conftest.err
8788        } && test -s conftest$ac_exeext && {
8789          test "$cross_compiling" = yes ||
8790          $as_test_x conftest$ac_exeext
8791        }; then
8792   ac_cv_lib_gdbm_gdbm_open=yes
8793 else
8794   $as_echo "$as_me: failed program was:" >&5
8795 sed 's/^/| /' conftest.$ac_ext >&5
8796
8797         ac_cv_lib_gdbm_gdbm_open=no
8798 fi
8799
8800 rm -rf conftest.dSYM
8801 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
8802       conftest$ac_exeext conftest.$ac_ext
8803 LIBS=$ac_check_lib_save_LIBS
8804 fi
8805 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_gdbm_open" >&5
8806 $as_echo "$ac_cv_lib_gdbm_gdbm_open" >&6; }
8807 if test "x$ac_cv_lib_gdbm_gdbm_open" = x""yes; then
8808   apu_have_gdbm=1
8809 fi
8810
8811 fi
8812
8813
8814       if test "$apu_have_gdbm" != "0"; then
8815
8816   if test "x$APRUTIL_LDFLAGS" = "x"; then
8817     echo "  setting APRUTIL_LDFLAGS to \"-L$withval/lib\""
8818     APRUTIL_LDFLAGS="-L$withval/lib"
8819   else
8820     apr_addto_bugger="-L$withval/lib"
8821     for i in $apr_addto_bugger; do
8822       apr_addto_duplicate="0"
8823       for j in $APRUTIL_LDFLAGS; do
8824         if test "x$i" = "x$j"; then
8825           apr_addto_duplicate="1"
8826           break
8827         fi
8828       done
8829       if test $apr_addto_duplicate = "0"; then
8830         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
8831         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
8832       fi
8833     done
8834   fi
8835
8836
8837   if test "x$APRUTIL_INCLUDES" = "x"; then
8838     echo "  setting APRUTIL_INCLUDES to \"-I$withval/include\""
8839     APRUTIL_INCLUDES="-I$withval/include"
8840   else
8841     apr_addto_bugger="-I$withval/include"
8842     for i in $apr_addto_bugger; do
8843       apr_addto_duplicate="0"
8844       for j in $APRUTIL_INCLUDES; do
8845         if test "x$i" = "x$j"; then
8846           apr_addto_duplicate="1"
8847           break
8848         fi
8849       done
8850       if test $apr_addto_duplicate = "0"; then
8851         echo "  adding \"$i\" to APRUTIL_INCLUDES"
8852         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
8853       fi
8854     done
8855   fi
8856
8857       fi
8858     fi
8859
8860 fi
8861
8862
8863
8864 # Check whether --with-ndbm was given.
8865 if test "${with_ndbm+set}" = set; then
8866   withval=$with_ndbm;
8867     apu_have_ndbm=0
8868     if test "$withval" = "yes"; then
8869       { $as_echo "$as_me:$LINENO: checking checking for ndbm in the usual places" >&5
8870 $as_echo_n "checking checking for ndbm in the usual places... " >&6; }
8871       apu_want_ndbm=1
8872       NDBM_INC=""
8873       NDBM_LDFLAGS=""
8874     elif test "$withval" = "no"; then
8875       apu_want_ndbm=0
8876     else
8877       apu_want_ndbm=1
8878       case "$withval" in
8879         *":"*)
8880           NDBM_INC="-I`echo $withval |sed -e 's/:.*$//'`"
8881           NDBM_LDFLAGS="-L`echo $withval |sed -e 's/^.*://'`"
8882           { $as_echo "$as_me:$LINENO: checking checking for ndbm includes with $NDBM_INC libs with $NDBM_LDFLAGS " >&5
8883 $as_echo_n "checking checking for ndbm includes with $NDBM_INC libs with $NDBM_LDFLAGS ... " >&6; }
8884         ;;
8885         *)
8886           NDBM_INC="-I$withval/include"
8887           NDBM_LDFLAGS="-L$withval/lib"
8888           { $as_echo "$as_me:$LINENO: checking checking for ndbm includes in $withval" >&5
8889 $as_echo_n "checking checking for ndbm includes in $withval... " >&6; }
8890         ;;
8891       esac
8892     fi
8893
8894     save_cppflags="$CPPFLAGS"
8895     save_ldflags="$LDFLAGS"
8896     CPPFLAGS="$CPPFLAGS $NDBM_INC"
8897     LDFLAGS="$LDFLAGS $NDBM_LDFLAGS"
8898         if test "$apu_want_ndbm" != "0"; then
8899       if test "${ac_cv_header_ndbm_h+set}" = set; then
8900   { $as_echo "$as_me:$LINENO: checking for ndbm.h" >&5
8901 $as_echo_n "checking for ndbm.h... " >&6; }
8902 if test "${ac_cv_header_ndbm_h+set}" = set; then
8903   $as_echo_n "(cached) " >&6
8904 fi
8905 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_ndbm_h" >&5
8906 $as_echo "$ac_cv_header_ndbm_h" >&6; }
8907 else
8908   # Is the header compilable?
8909 { $as_echo "$as_me:$LINENO: checking ndbm.h usability" >&5
8910 $as_echo_n "checking ndbm.h usability... " >&6; }
8911 cat >conftest.$ac_ext <<_ACEOF
8912 /* confdefs.h.  */
8913 _ACEOF
8914 cat confdefs.h >>conftest.$ac_ext
8915 cat >>conftest.$ac_ext <<_ACEOF
8916 /* end confdefs.h.  */
8917 $ac_includes_default
8918 #include <ndbm.h>
8919 _ACEOF
8920 rm -f conftest.$ac_objext
8921 if { (ac_try="$ac_compile"
8922 case "(($ac_try" in
8923   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8924   *) ac_try_echo=$ac_try;;
8925 esac
8926 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8927 $as_echo "$ac_try_echo") >&5
8928   (eval "$ac_compile") 2>conftest.er1
8929   ac_status=$?
8930   grep -v '^ *+' conftest.er1 >conftest.err
8931   rm -f conftest.er1
8932   cat conftest.err >&5
8933   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8934   (exit $ac_status); } && {
8935          test -z "$ac_c_werror_flag" ||
8936          test ! -s conftest.err
8937        } && test -s conftest.$ac_objext; then
8938   ac_header_compiler=yes
8939 else
8940   $as_echo "$as_me: failed program was:" >&5
8941 sed 's/^/| /' conftest.$ac_ext >&5
8942
8943         ac_header_compiler=no
8944 fi
8945
8946 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8947 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
8948 $as_echo "$ac_header_compiler" >&6; }
8949
8950 # Is the header present?
8951 { $as_echo "$as_me:$LINENO: checking ndbm.h presence" >&5
8952 $as_echo_n "checking ndbm.h presence... " >&6; }
8953 cat >conftest.$ac_ext <<_ACEOF
8954 /* confdefs.h.  */
8955 _ACEOF
8956 cat confdefs.h >>conftest.$ac_ext
8957 cat >>conftest.$ac_ext <<_ACEOF
8958 /* end confdefs.h.  */
8959 #include <ndbm.h>
8960 _ACEOF
8961 if { (ac_try="$ac_cpp conftest.$ac_ext"
8962 case "(($ac_try" in
8963   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8964   *) ac_try_echo=$ac_try;;
8965 esac
8966 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8967 $as_echo "$ac_try_echo") >&5
8968   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8969   ac_status=$?
8970   grep -v '^ *+' conftest.er1 >conftest.err
8971   rm -f conftest.er1
8972   cat conftest.err >&5
8973   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8974   (exit $ac_status); } >/dev/null && {
8975          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
8976          test ! -s conftest.err
8977        }; then
8978   ac_header_preproc=yes
8979 else
8980   $as_echo "$as_me: failed program was:" >&5
8981 sed 's/^/| /' conftest.$ac_ext >&5
8982
8983   ac_header_preproc=no
8984 fi
8985
8986 rm -f conftest.err conftest.$ac_ext
8987 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
8988 $as_echo "$ac_header_preproc" >&6; }
8989
8990 # So?  What about this header?
8991 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
8992   yes:no: )
8993     { $as_echo "$as_me:$LINENO: WARNING: ndbm.h: accepted by the compiler, rejected by the preprocessor!" >&5
8994 $as_echo "$as_me: WARNING: ndbm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
8995     { $as_echo "$as_me:$LINENO: WARNING: ndbm.h: proceeding with the compiler's result" >&5
8996 $as_echo "$as_me: WARNING: ndbm.h: proceeding with the compiler's result" >&2;}
8997     ac_header_preproc=yes
8998     ;;
8999   no:yes:* )
9000     { $as_echo "$as_me:$LINENO: WARNING: ndbm.h: present but cannot be compiled" >&5
9001 $as_echo "$as_me: WARNING: ndbm.h: present but cannot be compiled" >&2;}
9002     { $as_echo "$as_me:$LINENO: WARNING: ndbm.h:     check for missing prerequisite headers?" >&5
9003 $as_echo "$as_me: WARNING: ndbm.h:     check for missing prerequisite headers?" >&2;}
9004     { $as_echo "$as_me:$LINENO: WARNING: ndbm.h: see the Autoconf documentation" >&5
9005 $as_echo "$as_me: WARNING: ndbm.h: see the Autoconf documentation" >&2;}
9006     { $as_echo "$as_me:$LINENO: WARNING: ndbm.h:     section \"Present But Cannot Be Compiled\"" >&5
9007 $as_echo "$as_me: WARNING: ndbm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
9008     { $as_echo "$as_me:$LINENO: WARNING: ndbm.h: proceeding with the preprocessor's result" >&5
9009 $as_echo "$as_me: WARNING: ndbm.h: proceeding with the preprocessor's result" >&2;}
9010     { $as_echo "$as_me:$LINENO: WARNING: ndbm.h: in the future, the compiler will take precedence" >&5
9011 $as_echo "$as_me: WARNING: ndbm.h: in the future, the compiler will take precedence" >&2;}
9012
9013     ;;
9014 esac
9015 { $as_echo "$as_me:$LINENO: checking for ndbm.h" >&5
9016 $as_echo_n "checking for ndbm.h... " >&6; }
9017 if test "${ac_cv_header_ndbm_h+set}" = set; then
9018   $as_echo_n "(cached) " >&6
9019 else
9020   ac_cv_header_ndbm_h=$ac_header_preproc
9021 fi
9022 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_ndbm_h" >&5
9023 $as_echo "$ac_cv_header_ndbm_h" >&6; }
9024
9025 fi
9026 if test "x$ac_cv_header_ndbm_h" = x""yes; then
9027   { $as_echo "$as_me:$LINENO: checking for dbm_open in -lc" >&5
9028 $as_echo_n "checking for dbm_open in -lc... " >&6; }
9029 if test "${ac_cv_lib_c_dbm_open+set}" = set; then
9030   $as_echo_n "(cached) " >&6
9031 else
9032   ac_check_lib_save_LIBS=$LIBS
9033 LIBS="-lc  $LIBS"
9034 cat >conftest.$ac_ext <<_ACEOF
9035 /* confdefs.h.  */
9036 _ACEOF
9037 cat confdefs.h >>conftest.$ac_ext
9038 cat >>conftest.$ac_ext <<_ACEOF
9039 /* end confdefs.h.  */
9040
9041 /* Override any GCC internal prototype to avoid an error.
9042    Use char because int might match the return type of a GCC
9043    builtin and then its argument prototype would still apply.  */
9044 #ifdef __cplusplus
9045 extern "C"
9046 #endif
9047 char dbm_open ();
9048 int
9049 main ()
9050 {
9051 return dbm_open ();
9052   ;
9053   return 0;
9054 }
9055 _ACEOF
9056 rm -f conftest.$ac_objext conftest$ac_exeext
9057 if { (ac_try="$ac_link"
9058 case "(($ac_try" in
9059   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9060   *) ac_try_echo=$ac_try;;
9061 esac
9062 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9063 $as_echo "$ac_try_echo") >&5
9064   (eval "$ac_link") 2>conftest.er1
9065   ac_status=$?
9066   grep -v '^ *+' conftest.er1 >conftest.err
9067   rm -f conftest.er1
9068   cat conftest.err >&5
9069   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9070   (exit $ac_status); } && {
9071          test -z "$ac_c_werror_flag" ||
9072          test ! -s conftest.err
9073        } && test -s conftest$ac_exeext && {
9074          test "$cross_compiling" = yes ||
9075          $as_test_x conftest$ac_exeext
9076        }; then
9077   ac_cv_lib_c_dbm_open=yes
9078 else
9079   $as_echo "$as_me: failed program was:" >&5
9080 sed 's/^/| /' conftest.$ac_ext >&5
9081
9082         ac_cv_lib_c_dbm_open=no
9083 fi
9084
9085 rm -rf conftest.dSYM
9086 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9087       conftest$ac_exeext conftest.$ac_ext
9088 LIBS=$ac_check_lib_save_LIBS
9089 fi
9090 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_dbm_open" >&5
9091 $as_echo "$ac_cv_lib_c_dbm_open" >&6; }
9092 if test "x$ac_cv_lib_c_dbm_open" = x""yes; then
9093   apu_have_ndbm=1;apu_ndbm_lib=c
9094 else
9095   { $as_echo "$as_me:$LINENO: checking for dbm_open in -ldbm" >&5
9096 $as_echo_n "checking for dbm_open in -ldbm... " >&6; }
9097 if test "${ac_cv_lib_dbm_dbm_open+set}" = set; then
9098   $as_echo_n "(cached) " >&6
9099 else
9100   ac_check_lib_save_LIBS=$LIBS
9101 LIBS="-ldbm  $LIBS"
9102 cat >conftest.$ac_ext <<_ACEOF
9103 /* confdefs.h.  */
9104 _ACEOF
9105 cat confdefs.h >>conftest.$ac_ext
9106 cat >>conftest.$ac_ext <<_ACEOF
9107 /* end confdefs.h.  */
9108
9109 /* Override any GCC internal prototype to avoid an error.
9110    Use char because int might match the return type of a GCC
9111    builtin and then its argument prototype would still apply.  */
9112 #ifdef __cplusplus
9113 extern "C"
9114 #endif
9115 char dbm_open ();
9116 int
9117 main ()
9118 {
9119 return dbm_open ();
9120   ;
9121   return 0;
9122 }
9123 _ACEOF
9124 rm -f conftest.$ac_objext conftest$ac_exeext
9125 if { (ac_try="$ac_link"
9126 case "(($ac_try" in
9127   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9128   *) ac_try_echo=$ac_try;;
9129 esac
9130 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9131 $as_echo "$ac_try_echo") >&5
9132   (eval "$ac_link") 2>conftest.er1
9133   ac_status=$?
9134   grep -v '^ *+' conftest.er1 >conftest.err
9135   rm -f conftest.er1
9136   cat conftest.err >&5
9137   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9138   (exit $ac_status); } && {
9139          test -z "$ac_c_werror_flag" ||
9140          test ! -s conftest.err
9141        } && test -s conftest$ac_exeext && {
9142          test "$cross_compiling" = yes ||
9143          $as_test_x conftest$ac_exeext
9144        }; then
9145   ac_cv_lib_dbm_dbm_open=yes
9146 else
9147   $as_echo "$as_me: failed program was:" >&5
9148 sed 's/^/| /' conftest.$ac_ext >&5
9149
9150         ac_cv_lib_dbm_dbm_open=no
9151 fi
9152
9153 rm -rf conftest.dSYM
9154 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9155       conftest$ac_exeext conftest.$ac_ext
9156 LIBS=$ac_check_lib_save_LIBS
9157 fi
9158 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dbm_dbm_open" >&5
9159 $as_echo "$ac_cv_lib_dbm_dbm_open" >&6; }
9160 if test "x$ac_cv_lib_dbm_dbm_open" = x""yes; then
9161   apu_have_ndbm=1;apu_ndbm_lib=dbm
9162 else
9163   { $as_echo "$as_me:$LINENO: checking for dbm_open in -ldb" >&5
9164 $as_echo_n "checking for dbm_open in -ldb... " >&6; }
9165 if test "${ac_cv_lib_db_dbm_open+set}" = set; then
9166   $as_echo_n "(cached) " >&6
9167 else
9168   ac_check_lib_save_LIBS=$LIBS
9169 LIBS="-ldb  $LIBS"
9170 cat >conftest.$ac_ext <<_ACEOF
9171 /* confdefs.h.  */
9172 _ACEOF
9173 cat confdefs.h >>conftest.$ac_ext
9174 cat >>conftest.$ac_ext <<_ACEOF
9175 /* end confdefs.h.  */
9176
9177 /* Override any GCC internal prototype to avoid an error.
9178    Use char because int might match the return type of a GCC
9179    builtin and then its argument prototype would still apply.  */
9180 #ifdef __cplusplus
9181 extern "C"
9182 #endif
9183 char dbm_open ();
9184 int
9185 main ()
9186 {
9187 return dbm_open ();
9188   ;
9189   return 0;
9190 }
9191 _ACEOF
9192 rm -f conftest.$ac_objext conftest$ac_exeext
9193 if { (ac_try="$ac_link"
9194 case "(($ac_try" in
9195   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9196   *) ac_try_echo=$ac_try;;
9197 esac
9198 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9199 $as_echo "$ac_try_echo") >&5
9200   (eval "$ac_link") 2>conftest.er1
9201   ac_status=$?
9202   grep -v '^ *+' conftest.er1 >conftest.err
9203   rm -f conftest.er1
9204   cat conftest.err >&5
9205   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9206   (exit $ac_status); } && {
9207          test -z "$ac_c_werror_flag" ||
9208          test ! -s conftest.err
9209        } && test -s conftest$ac_exeext && {
9210          test "$cross_compiling" = yes ||
9211          $as_test_x conftest$ac_exeext
9212        }; then
9213   ac_cv_lib_db_dbm_open=yes
9214 else
9215   $as_echo "$as_me: failed program was:" >&5
9216 sed 's/^/| /' conftest.$ac_ext >&5
9217
9218         ac_cv_lib_db_dbm_open=no
9219 fi
9220
9221 rm -rf conftest.dSYM
9222 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9223       conftest$ac_exeext conftest.$ac_ext
9224 LIBS=$ac_check_lib_save_LIBS
9225 fi
9226 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_db_dbm_open" >&5
9227 $as_echo "$ac_cv_lib_db_dbm_open" >&6; }
9228 if test "x$ac_cv_lib_db_dbm_open" = x""yes; then
9229   apu_have_ndbm=1;apu_ndbm_lib=db
9230 else
9231   { $as_echo "$as_me:$LINENO: checking for __db_ndbm_open in -ldb" >&5
9232 $as_echo_n "checking for __db_ndbm_open in -ldb... " >&6; }
9233 if test "${ac_cv_lib_db___db_ndbm_open+set}" = set; then
9234   $as_echo_n "(cached) " >&6
9235 else
9236   ac_check_lib_save_LIBS=$LIBS
9237 LIBS="-ldb  $LIBS"
9238 cat >conftest.$ac_ext <<_ACEOF
9239 /* confdefs.h.  */
9240 _ACEOF
9241 cat confdefs.h >>conftest.$ac_ext
9242 cat >>conftest.$ac_ext <<_ACEOF
9243 /* end confdefs.h.  */
9244
9245 /* Override any GCC internal prototype to avoid an error.
9246    Use char because int might match the return type of a GCC
9247    builtin and then its argument prototype would still apply.  */
9248 #ifdef __cplusplus
9249 extern "C"
9250 #endif
9251 char __db_ndbm_open ();
9252 int
9253 main ()
9254 {
9255 return __db_ndbm_open ();
9256   ;
9257   return 0;
9258 }
9259 _ACEOF
9260 rm -f conftest.$ac_objext conftest$ac_exeext
9261 if { (ac_try="$ac_link"
9262 case "(($ac_try" in
9263   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9264   *) ac_try_echo=$ac_try;;
9265 esac
9266 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9267 $as_echo "$ac_try_echo") >&5
9268   (eval "$ac_link") 2>conftest.er1
9269   ac_status=$?
9270   grep -v '^ *+' conftest.er1 >conftest.err
9271   rm -f conftest.er1
9272   cat conftest.err >&5
9273   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9274   (exit $ac_status); } && {
9275          test -z "$ac_c_werror_flag" ||
9276          test ! -s conftest.err
9277        } && test -s conftest$ac_exeext && {
9278          test "$cross_compiling" = yes ||
9279          $as_test_x conftest$ac_exeext
9280        }; then
9281   ac_cv_lib_db___db_ndbm_open=yes
9282 else
9283   $as_echo "$as_me: failed program was:" >&5
9284 sed 's/^/| /' conftest.$ac_ext >&5
9285
9286         ac_cv_lib_db___db_ndbm_open=no
9287 fi
9288
9289 rm -rf conftest.dSYM
9290 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9291       conftest$ac_exeext conftest.$ac_ext
9292 LIBS=$ac_check_lib_save_LIBS
9293 fi
9294 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_db___db_ndbm_open" >&5
9295 $as_echo "$ac_cv_lib_db___db_ndbm_open" >&6; }
9296 if test "x$ac_cv_lib_db___db_ndbm_open" = x""yes; then
9297   apu_have_ndbm=1;apu_ndbm_lib=db
9298 fi
9299
9300
9301 fi
9302
9303
9304 fi
9305
9306
9307 fi
9308
9309
9310 fi
9311
9312
9313       if test "$apu_have_ndbm" != "0";  then
9314         if test "$withval" != "yes"; then
9315
9316   if test "x$APRUTIL_INCLUDES" = "x"; then
9317     echo "  setting APRUTIL_INCLUDES to \"$NDBM_INC\""
9318     APRUTIL_INCLUDES="$NDBM_INC"
9319   else
9320     apr_addto_bugger="$NDBM_INC"
9321     for i in $apr_addto_bugger; do
9322       apr_addto_duplicate="0"
9323       for j in $APRUTIL_INCLUDES; do
9324         if test "x$i" = "x$j"; then
9325           apr_addto_duplicate="1"
9326           break
9327         fi
9328       done
9329       if test $apr_addto_duplicate = "0"; then
9330         echo "  adding \"$i\" to APRUTIL_INCLUDES"
9331         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
9332       fi
9333     done
9334   fi
9335
9336
9337   if test "x$APRUTIL_LDFLAGS" = "x"; then
9338     echo "  setting APRUTIL_LDFLAGS to \"$NDBM_LDFLAGS\""
9339     APRUTIL_LDFLAGS="$NDBM_LDFLAGS"
9340   else
9341     apr_addto_bugger="$NDBM_LDFLAGS"
9342     for i in $apr_addto_bugger; do
9343       apr_addto_duplicate="0"
9344       for j in $APRUTIL_LDFLAGS; do
9345         if test "x$i" = "x$j"; then
9346           apr_addto_duplicate="1"
9347           break
9348         fi
9349       done
9350       if test $apr_addto_duplicate = "0"; then
9351         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
9352         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
9353       fi
9354     done
9355   fi
9356
9357         fi
9358       elif test "$withval" != "yes"; then
9359         { { $as_echo "$as_me:$LINENO: error: NDBM not found in the specified directory" >&5
9360 $as_echo "$as_me: error: NDBM not found in the specified directory" >&2;}
9361    { (exit 1); exit 1; }; }
9362       fi
9363     fi
9364     CPPFLAGS="$save_cppflags"
9365     LDFLAGS="$save_ldflags"
9366
9367 else
9368
9369         apu_have_ndbm=0
9370
9371 fi
9372
9373
9374
9375   if test -n "$apu_db_xtra_libs"; then
9376     saveddbxtralibs="$LIBS"
9377     LIBS="$apu_db_xtra_libs $LIBS"
9378   fi
9379
9380
9381 # Check whether --with-berkeley-db was given.
9382 if test "${with_berkeley_db+set}" = set; then
9383   withval=$with_berkeley_db;
9384     if test "$withval" = "yes"; then
9385       apu_want_db=1
9386       user_places=""
9387     elif test "$withval" = "no"; then
9388       apu_want_db=0
9389     else
9390       apu_want_db=1
9391       user_places="$withval"
9392     fi
9393
9394     if test "$apu_want_db" != "0"; then
9395
9396   requested=$requested
9397   check_places=$user_places
9398
9399   case "$requested" in
9400   db)
9401
9402   all_places="$check_places"
9403
9404
9405   places="$all_places"
9406   if test -z "$places"; then
9407     places="std /usr/local/BerkeleyDB.4.8 /boot/home/config"
9408   fi
9409
9410   bdb_version="4"
9411   if test ""8"" != "-1"; then
9412     bdb_version="$bdb_version."8""
9413     if test ""-1"" != "-1"; then
9414       bdb_version="$bdb_version."-1""
9415     fi
9416   fi
9417   bdb_places="$places"
9418   bdb_default_search_headers="db48/db.h db4/db.h db.h"
9419   bdb_default_search_lib_names="db-4.8 db4-4.8 db48 db4 db"
9420
9421
9422   apu_have_db=0
9423
9424   # Save the original values of the flags we tweak.
9425   apu_check_lib_save_libs="$LIBS"
9426   apu_check_lib_save_ldflags="$LDFLAGS"
9427   apu_check_lib_save_cppflags="$CPPFLAGS"
9428
9429   # The variable `found' is the prefix under which we've found
9430   # Berkeley DB, or `not' if we haven't found it anywhere yet.
9431   found=not
9432   for bdb_place in $bdb_places; do
9433
9434     LDFLAGS="$apu_check_lib_save_ldflags"
9435     CPPFLAGS="$apu_check_lib_save_cppflags"
9436     case "$bdb_place" in
9437       "std" )
9438         description="the standard places"
9439       ;;
9440       *":"* )
9441         header="`echo $bdb_place | sed -e 's/:.*$//'`"
9442         lib="`echo $bdb_place | sed -e 's/^.*://'`"
9443         CPPFLAGS="$CPPFLAGS -I$header"
9444         LDFLAGS="$LDFLAGS -L$lib"
9445         description="$header and $lib"
9446       ;;
9447       * )
9448         if test -d $bdb_place; then
9449           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
9450           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
9451         else
9452           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
9453 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
9454           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
9455 $as_echo "directory not found" >&6; }
9456           continue
9457         fi
9458         description="$bdb_place"
9459       ;;
9460     esac
9461
9462     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
9463     # trick to display a message instead.
9464     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
9465 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
9466     { $as_echo "$as_me:$LINENO: result: " >&5
9467 $as_echo "" >&6; }
9468
9469     for bdb_libname in $bdb_default_search_lib_names; do
9470       for bdb_header in $bdb_default_search_headers; do
9471         # Clear the header cache variable for each location
9472
9473         cache_id="`echo ac_cv_header_${bdb_header} \
9474                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
9475
9476         unset $cache_id
9477         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
9478 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
9479   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
9480 $as_echo_n "checking for $bdb_header... " >&6; }
9481 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
9482   $as_echo_n "(cached) " >&6
9483 fi
9484 ac_res=`eval 'as_val=${'$as_ac_Header'}
9485                  $as_echo "$as_val"'`
9486                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
9487 $as_echo "$ac_res" >&6; }
9488 else
9489   # Is the header compilable?
9490 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
9491 $as_echo_n "checking $bdb_header usability... " >&6; }
9492 cat >conftest.$ac_ext <<_ACEOF
9493 /* confdefs.h.  */
9494 _ACEOF
9495 cat confdefs.h >>conftest.$ac_ext
9496 cat >>conftest.$ac_ext <<_ACEOF
9497 /* end confdefs.h.  */
9498 $ac_includes_default
9499 #include <$bdb_header>
9500 _ACEOF
9501 rm -f conftest.$ac_objext
9502 if { (ac_try="$ac_compile"
9503 case "(($ac_try" in
9504   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9505   *) ac_try_echo=$ac_try;;
9506 esac
9507 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9508 $as_echo "$ac_try_echo") >&5
9509   (eval "$ac_compile") 2>conftest.er1
9510   ac_status=$?
9511   grep -v '^ *+' conftest.er1 >conftest.err
9512   rm -f conftest.er1
9513   cat conftest.err >&5
9514   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9515   (exit $ac_status); } && {
9516          test -z "$ac_c_werror_flag" ||
9517          test ! -s conftest.err
9518        } && test -s conftest.$ac_objext; then
9519   ac_header_compiler=yes
9520 else
9521   $as_echo "$as_me: failed program was:" >&5
9522 sed 's/^/| /' conftest.$ac_ext >&5
9523
9524         ac_header_compiler=no
9525 fi
9526
9527 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9528 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
9529 $as_echo "$ac_header_compiler" >&6; }
9530
9531 # Is the header present?
9532 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
9533 $as_echo_n "checking $bdb_header presence... " >&6; }
9534 cat >conftest.$ac_ext <<_ACEOF
9535 /* confdefs.h.  */
9536 _ACEOF
9537 cat confdefs.h >>conftest.$ac_ext
9538 cat >>conftest.$ac_ext <<_ACEOF
9539 /* end confdefs.h.  */
9540 #include <$bdb_header>
9541 _ACEOF
9542 if { (ac_try="$ac_cpp conftest.$ac_ext"
9543 case "(($ac_try" in
9544   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9545   *) ac_try_echo=$ac_try;;
9546 esac
9547 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9548 $as_echo "$ac_try_echo") >&5
9549   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
9550   ac_status=$?
9551   grep -v '^ *+' conftest.er1 >conftest.err
9552   rm -f conftest.er1
9553   cat conftest.err >&5
9554   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9555   (exit $ac_status); } >/dev/null && {
9556          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
9557          test ! -s conftest.err
9558        }; then
9559   ac_header_preproc=yes
9560 else
9561   $as_echo "$as_me: failed program was:" >&5
9562 sed 's/^/| /' conftest.$ac_ext >&5
9563
9564   ac_header_preproc=no
9565 fi
9566
9567 rm -f conftest.err conftest.$ac_ext
9568 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
9569 $as_echo "$ac_header_preproc" >&6; }
9570
9571 # So?  What about this header?
9572 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
9573   yes:no: )
9574     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
9575 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
9576     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
9577 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
9578     ac_header_preproc=yes
9579     ;;
9580   no:yes:* )
9581     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
9582 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
9583     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
9584 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
9585     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
9586 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
9587     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
9588 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
9589     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
9590 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
9591     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
9592 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
9593
9594     ;;
9595 esac
9596 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
9597 $as_echo_n "checking for $bdb_header... " >&6; }
9598 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
9599   $as_echo_n "(cached) " >&6
9600 else
9601   eval "$as_ac_Header=\$ac_header_preproc"
9602 fi
9603 ac_res=`eval 'as_val=${'$as_ac_Header'}
9604                  $as_echo "$as_val"'`
9605                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
9606 $as_echo "$ac_res" >&6; }
9607
9608 fi
9609 as_val=`eval 'as_val=${'$as_ac_Header'}
9610                  $as_echo "$as_val"'`
9611    if test "x$as_val" = x""yes; then
9612
9613           if test ""4"" = "3" -o ""4"" = "4"; then
9614             # We generate a separate cache variable for each prefix and libname
9615             # we search under.  That way, we avoid caching information that
9616             # changes if the user runs `configure' with a different set of
9617             # switches.
9618
9619             cache_id="`echo apu_cv_check_berkeley_db_"4"_"8"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
9620                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
9621
9622
9623             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
9624 $as_echo_n "checking for -l$bdb_libname... " >&6; }
9625                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
9626   $as_echo_n "(cached) " >&6
9627 else
9628
9629
9630     apu_try_berkeley_db_save_libs="$LIBS"
9631
9632     apu_check_berkeley_db_major="4"
9633     apu_check_berkeley_db_minor="8"
9634     apu_check_berkeley_db_patch="-1"
9635     apu_try_berkeley_db_header=$bdb_header
9636     apu_try_berkeley_db_libname=$bdb_libname
9637
9638     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
9639     if test "$cross_compiling" = yes; then
9640   apu_try_berkeley_db=yes
9641
9642 else
9643   cat >conftest.$ac_ext <<_ACEOF
9644 /* confdefs.h.  */
9645 _ACEOF
9646 cat confdefs.h >>conftest.$ac_ext
9647 cat >>conftest.$ac_ext <<_ACEOF
9648 /* end confdefs.h.  */
9649
9650 #include <stdlib.h>
9651 #include <stdio.h>
9652 #include <$apu_try_berkeley_db_header>
9653 main ()
9654 {
9655   int major, minor, patch;
9656
9657   db_version(&major, &minor, &patch);
9658
9659   /* Sanity check: ensure that db.h constants actually match the db library */
9660   if (major != DB_VERSION_MAJOR
9661       || minor != DB_VERSION_MINOR
9662       || patch != DB_VERSION_PATCH)
9663     exit (1);
9664
9665   /* Run-time check:  ensure the library claims to be the correct version. */
9666
9667   if ($apu_check_berkeley_db_major != -1) {
9668     if (major < $apu_check_berkeley_db_major)
9669       exit (1);
9670     if (major > $apu_check_berkeley_db_major)
9671       exit (0);
9672   }
9673
9674   if ($apu_check_berkeley_db_minor != -1) {
9675     if (minor < $apu_check_berkeley_db_minor)
9676       exit (1);
9677     if (minor > $apu_check_berkeley_db_minor)
9678       exit (0);
9679   }
9680
9681   if ($apu_check_berkeley_db_patch == -1
9682       || patch >= $apu_check_berkeley_db_patch)
9683     exit (0);
9684   else
9685     exit (1);
9686 }
9687
9688 _ACEOF
9689 rm -f conftest$ac_exeext
9690 if { (ac_try="$ac_link"
9691 case "(($ac_try" in
9692   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9693   *) ac_try_echo=$ac_try;;
9694 esac
9695 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9696 $as_echo "$ac_try_echo") >&5
9697   (eval "$ac_link") 2>&5
9698   ac_status=$?
9699   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9700   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9701   { (case "(($ac_try" in
9702   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9703   *) ac_try_echo=$ac_try;;
9704 esac
9705 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9706 $as_echo "$ac_try_echo") >&5
9707   (eval "$ac_try") 2>&5
9708   ac_status=$?
9709   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9710   (exit $ac_status); }; }; then
9711   apu_try_berkeley_db=yes
9712 else
9713   $as_echo "$as_me: program exited with status $ac_status" >&5
9714 $as_echo "$as_me: failed program was:" >&5
9715 sed 's/^/| /' conftest.$ac_ext >&5
9716
9717 ( exit $ac_status )
9718 apu_try_berkeley_db=no
9719 fi
9720 rm -rf conftest.dSYM
9721 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9722 fi
9723
9724
9725
9726     LIBS="$apu_try_berkeley_db_save_libs"
9727
9728
9729                 eval "$cache_id=$apu_try_berkeley_db"
9730
9731 fi
9732
9733             result="`eval echo '$'$cache_id`"
9734             { $as_echo "$as_me:$LINENO: result: $result" >&5
9735 $as_echo "$result" >&6; }
9736           elif test ""4"" = "1"; then
9737             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
9738 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
9739 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
9740 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
9741   $as_echo_n "(cached) " >&6
9742 else
9743   ac_check_lib_save_LIBS=$LIBS
9744 LIBS="-l$bdb_libname  $LIBS"
9745 cat >conftest.$ac_ext <<_ACEOF
9746 /* confdefs.h.  */
9747 _ACEOF
9748 cat confdefs.h >>conftest.$ac_ext
9749 cat >>conftest.$ac_ext <<_ACEOF
9750 /* end confdefs.h.  */
9751
9752 /* Override any GCC internal prototype to avoid an error.
9753    Use char because int might match the return type of a GCC
9754    builtin and then its argument prototype would still apply.  */
9755 #ifdef __cplusplus
9756 extern "C"
9757 #endif
9758 char dbopen ();
9759 int
9760 main ()
9761 {
9762 return dbopen ();
9763   ;
9764   return 0;
9765 }
9766 _ACEOF
9767 rm -f conftest.$ac_objext conftest$ac_exeext
9768 if { (ac_try="$ac_link"
9769 case "(($ac_try" in
9770   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9771   *) ac_try_echo=$ac_try;;
9772 esac
9773 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9774 $as_echo "$ac_try_echo") >&5
9775   (eval "$ac_link") 2>conftest.er1
9776   ac_status=$?
9777   grep -v '^ *+' conftest.er1 >conftest.err
9778   rm -f conftest.er1
9779   cat conftest.err >&5
9780   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9781   (exit $ac_status); } && {
9782          test -z "$ac_c_werror_flag" ||
9783          test ! -s conftest.err
9784        } && test -s conftest$ac_exeext && {
9785          test "$cross_compiling" = yes ||
9786          $as_test_x conftest$ac_exeext
9787        }; then
9788   eval "$as_ac_Lib=yes"
9789 else
9790   $as_echo "$as_me: failed program was:" >&5
9791 sed 's/^/| /' conftest.$ac_ext >&5
9792
9793         eval "$as_ac_Lib=no"
9794 fi
9795
9796 rm -rf conftest.dSYM
9797 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9798       conftest$ac_exeext conftest.$ac_ext
9799 LIBS=$ac_check_lib_save_LIBS
9800 fi
9801 ac_res=`eval 'as_val=${'$as_ac_Lib'}
9802                  $as_echo "$as_val"'`
9803                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
9804 $as_echo "$ac_res" >&6; }
9805 as_val=`eval 'as_val=${'$as_ac_Lib'}
9806                  $as_echo "$as_val"'`
9807    if test "x$as_val" = x""yes; then
9808   result=yes
9809 else
9810   result=no
9811
9812 fi
9813
9814           elif test ""4"" = "2"; then
9815             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
9816 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
9817 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
9818 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
9819   $as_echo_n "(cached) " >&6
9820 else
9821   ac_check_lib_save_LIBS=$LIBS
9822 LIBS="-l$bdb_libname  $LIBS"
9823 cat >conftest.$ac_ext <<_ACEOF
9824 /* confdefs.h.  */
9825 _ACEOF
9826 cat confdefs.h >>conftest.$ac_ext
9827 cat >>conftest.$ac_ext <<_ACEOF
9828 /* end confdefs.h.  */
9829
9830 /* Override any GCC internal prototype to avoid an error.
9831    Use char because int might match the return type of a GCC
9832    builtin and then its argument prototype would still apply.  */
9833 #ifdef __cplusplus
9834 extern "C"
9835 #endif
9836 char db_open ();
9837 int
9838 main ()
9839 {
9840 return db_open ();
9841   ;
9842   return 0;
9843 }
9844 _ACEOF
9845 rm -f conftest.$ac_objext conftest$ac_exeext
9846 if { (ac_try="$ac_link"
9847 case "(($ac_try" in
9848   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9849   *) ac_try_echo=$ac_try;;
9850 esac
9851 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
9852 $as_echo "$ac_try_echo") >&5
9853   (eval "$ac_link") 2>conftest.er1
9854   ac_status=$?
9855   grep -v '^ *+' conftest.er1 >conftest.err
9856   rm -f conftest.er1
9857   cat conftest.err >&5
9858   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
9859   (exit $ac_status); } && {
9860          test -z "$ac_c_werror_flag" ||
9861          test ! -s conftest.err
9862        } && test -s conftest$ac_exeext && {
9863          test "$cross_compiling" = yes ||
9864          $as_test_x conftest$ac_exeext
9865        }; then
9866   eval "$as_ac_Lib=yes"
9867 else
9868   $as_echo "$as_me: failed program was:" >&5
9869 sed 's/^/| /' conftest.$ac_ext >&5
9870
9871         eval "$as_ac_Lib=no"
9872 fi
9873
9874 rm -rf conftest.dSYM
9875 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9876       conftest$ac_exeext conftest.$ac_ext
9877 LIBS=$ac_check_lib_save_LIBS
9878 fi
9879 ac_res=`eval 'as_val=${'$as_ac_Lib'}
9880                  $as_echo "$as_val"'`
9881                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
9882 $as_echo "$ac_res" >&6; }
9883 as_val=`eval 'as_val=${'$as_ac_Lib'}
9884                  $as_echo "$as_val"'`
9885    if test "x$as_val" = x""yes; then
9886   result=yes
9887 else
9888   result=no
9889
9890 fi
9891
9892           fi
9893
9894 else
9895   result="no"
9896 fi
9897
9898
9899
9900         # If we found it, no need to search any more.
9901         if test "$result" = "yes"; then
9902           found="$bdb_place"
9903           break
9904         fi
9905       done
9906       test "$found" != "not" && break
9907     done
9908     test "$found" != "not" && break
9909   done
9910
9911   # Restore the original values of the flags we tweak.
9912   LDFLAGS="$apu_check_lib_save_ldflags"
9913   CPPFLAGS="$apu_check_lib_save_cppflags"
9914
9915   case "$found" in
9916   "not")
9917     apu_have_db=0
9918     ;;
9919   "std")
9920     apu_db_header=$bdb_header
9921     apu_db_lib=$bdb_libname
9922     apu_have_db=1
9923     ;;
9924   *":"*)
9925     header="`echo $found | sed -e 's/:.*$//'`"
9926     lib="`echo $found | sed -e 's/^.*://'`"
9927
9928
9929   if test "x$APRUTIL_INCLUDES" = "x"; then
9930     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
9931     APRUTIL_INCLUDES="-I$header"
9932   else
9933     apr_addto_bugger="-I$header"
9934     for i in $apr_addto_bugger; do
9935       apr_addto_duplicate="0"
9936       for j in $APRUTIL_INCLUDES; do
9937         if test "x$i" = "x$j"; then
9938           apr_addto_duplicate="1"
9939           break
9940         fi
9941       done
9942       if test $apr_addto_duplicate = "0"; then
9943         echo "  adding \"$i\" to APRUTIL_INCLUDES"
9944         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
9945       fi
9946     done
9947   fi
9948
9949
9950   if test "x$APRUTIL_LDFLAGS" = "x"; then
9951     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
9952     APRUTIL_LDFLAGS="-L$lib"
9953   else
9954     apr_addto_bugger="-L$lib"
9955     for i in $apr_addto_bugger; do
9956       apr_addto_duplicate="0"
9957       for j in $APRUTIL_LDFLAGS; do
9958         if test "x$i" = "x$j"; then
9959           apr_addto_duplicate="1"
9960           break
9961         fi
9962       done
9963       if test $apr_addto_duplicate = "0"; then
9964         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
9965         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
9966       fi
9967     done
9968   fi
9969
9970     apu_db_header=$bdb_header
9971     apu_db_lib=$bdb_libname
9972     apu_have_db=1
9973     ;;
9974   *)
9975
9976   if test "x$APRUTIL_INCLUDES" = "x"; then
9977     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
9978     APRUTIL_INCLUDES="-I$found/include"
9979   else
9980     apr_addto_bugger="-I$found/include"
9981     for i in $apr_addto_bugger; do
9982       apr_addto_duplicate="0"
9983       for j in $APRUTIL_INCLUDES; do
9984         if test "x$i" = "x$j"; then
9985           apr_addto_duplicate="1"
9986           break
9987         fi
9988       done
9989       if test $apr_addto_duplicate = "0"; then
9990         echo "  adding \"$i\" to APRUTIL_INCLUDES"
9991         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
9992       fi
9993     done
9994   fi
9995
9996
9997   if test "x$APRUTIL_LDFLAGS" = "x"; then
9998     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
9999     APRUTIL_LDFLAGS="-L$found/lib"
10000   else
10001     apr_addto_bugger="-L$found/lib"
10002     for i in $apr_addto_bugger; do
10003       apr_addto_duplicate="0"
10004       for j in $APRUTIL_LDFLAGS; do
10005         if test "x$i" = "x$j"; then
10006           apr_addto_duplicate="1"
10007           break
10008         fi
10009       done
10010       if test $apr_addto_duplicate = "0"; then
10011         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
10012         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
10013       fi
10014     done
10015   fi
10016
10017     apu_db_header=$bdb_header
10018     apu_db_lib=$bdb_libname
10019     apu_have_db=1
10020     ;;
10021   esac
10022
10023   if test "$apu_have_db" = "1"; then
10024     apu_db_version=4
10025   fi
10026
10027   if test "$apu_db_version" != "4"; then
10028
10029   places="$all_places"
10030   if test -z "$places"; then
10031     places="std /usr/local/BerkeleyDB.4.7 /boot/home/config"
10032   fi
10033
10034   bdb_version="4"
10035   if test ""7"" != "-1"; then
10036     bdb_version="$bdb_version."7""
10037     if test ""-1"" != "-1"; then
10038       bdb_version="$bdb_version."-1""
10039     fi
10040   fi
10041   bdb_places="$places"
10042   bdb_default_search_headers="db47/db.h db4/db.h db.h"
10043   bdb_default_search_lib_names="db-4.7 db4-4.7 db47 db4 db"
10044
10045
10046   apu_have_db=0
10047
10048   # Save the original values of the flags we tweak.
10049   apu_check_lib_save_libs="$LIBS"
10050   apu_check_lib_save_ldflags="$LDFLAGS"
10051   apu_check_lib_save_cppflags="$CPPFLAGS"
10052
10053   # The variable `found' is the prefix under which we've found
10054   # Berkeley DB, or `not' if we haven't found it anywhere yet.
10055   found=not
10056   for bdb_place in $bdb_places; do
10057
10058     LDFLAGS="$apu_check_lib_save_ldflags"
10059     CPPFLAGS="$apu_check_lib_save_cppflags"
10060     case "$bdb_place" in
10061       "std" )
10062         description="the standard places"
10063       ;;
10064       *":"* )
10065         header="`echo $bdb_place | sed -e 's/:.*$//'`"
10066         lib="`echo $bdb_place | sed -e 's/^.*://'`"
10067         CPPFLAGS="$CPPFLAGS -I$header"
10068         LDFLAGS="$LDFLAGS -L$lib"
10069         description="$header and $lib"
10070       ;;
10071       * )
10072         if test -d $bdb_place; then
10073           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
10074           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
10075         else
10076           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
10077 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
10078           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
10079 $as_echo "directory not found" >&6; }
10080           continue
10081         fi
10082         description="$bdb_place"
10083       ;;
10084     esac
10085
10086     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
10087     # trick to display a message instead.
10088     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
10089 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
10090     { $as_echo "$as_me:$LINENO: result: " >&5
10091 $as_echo "" >&6; }
10092
10093     for bdb_libname in $bdb_default_search_lib_names; do
10094       for bdb_header in $bdb_default_search_headers; do
10095         # Clear the header cache variable for each location
10096
10097         cache_id="`echo ac_cv_header_${bdb_header} \
10098                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
10099
10100         unset $cache_id
10101         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
10102 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
10103   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
10104 $as_echo_n "checking for $bdb_header... " >&6; }
10105 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
10106   $as_echo_n "(cached) " >&6
10107 fi
10108 ac_res=`eval 'as_val=${'$as_ac_Header'}
10109                  $as_echo "$as_val"'`
10110                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
10111 $as_echo "$ac_res" >&6; }
10112 else
10113   # Is the header compilable?
10114 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
10115 $as_echo_n "checking $bdb_header usability... " >&6; }
10116 cat >conftest.$ac_ext <<_ACEOF
10117 /* confdefs.h.  */
10118 _ACEOF
10119 cat confdefs.h >>conftest.$ac_ext
10120 cat >>conftest.$ac_ext <<_ACEOF
10121 /* end confdefs.h.  */
10122 $ac_includes_default
10123 #include <$bdb_header>
10124 _ACEOF
10125 rm -f conftest.$ac_objext
10126 if { (ac_try="$ac_compile"
10127 case "(($ac_try" in
10128   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10129   *) ac_try_echo=$ac_try;;
10130 esac
10131 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10132 $as_echo "$ac_try_echo") >&5
10133   (eval "$ac_compile") 2>conftest.er1
10134   ac_status=$?
10135   grep -v '^ *+' conftest.er1 >conftest.err
10136   rm -f conftest.er1
10137   cat conftest.err >&5
10138   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10139   (exit $ac_status); } && {
10140          test -z "$ac_c_werror_flag" ||
10141          test ! -s conftest.err
10142        } && test -s conftest.$ac_objext; then
10143   ac_header_compiler=yes
10144 else
10145   $as_echo "$as_me: failed program was:" >&5
10146 sed 's/^/| /' conftest.$ac_ext >&5
10147
10148         ac_header_compiler=no
10149 fi
10150
10151 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10152 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
10153 $as_echo "$ac_header_compiler" >&6; }
10154
10155 # Is the header present?
10156 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
10157 $as_echo_n "checking $bdb_header presence... " >&6; }
10158 cat >conftest.$ac_ext <<_ACEOF
10159 /* confdefs.h.  */
10160 _ACEOF
10161 cat confdefs.h >>conftest.$ac_ext
10162 cat >>conftest.$ac_ext <<_ACEOF
10163 /* end confdefs.h.  */
10164 #include <$bdb_header>
10165 _ACEOF
10166 if { (ac_try="$ac_cpp conftest.$ac_ext"
10167 case "(($ac_try" in
10168   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10169   *) ac_try_echo=$ac_try;;
10170 esac
10171 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10172 $as_echo "$ac_try_echo") >&5
10173   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
10174   ac_status=$?
10175   grep -v '^ *+' conftest.er1 >conftest.err
10176   rm -f conftest.er1
10177   cat conftest.err >&5
10178   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10179   (exit $ac_status); } >/dev/null && {
10180          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
10181          test ! -s conftest.err
10182        }; then
10183   ac_header_preproc=yes
10184 else
10185   $as_echo "$as_me: failed program was:" >&5
10186 sed 's/^/| /' conftest.$ac_ext >&5
10187
10188   ac_header_preproc=no
10189 fi
10190
10191 rm -f conftest.err conftest.$ac_ext
10192 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
10193 $as_echo "$ac_header_preproc" >&6; }
10194
10195 # So?  What about this header?
10196 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
10197   yes:no: )
10198     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
10199 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
10200     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
10201 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
10202     ac_header_preproc=yes
10203     ;;
10204   no:yes:* )
10205     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
10206 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
10207     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
10208 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
10209     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
10210 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
10211     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
10212 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
10213     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
10214 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
10215     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
10216 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
10217
10218     ;;
10219 esac
10220 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
10221 $as_echo_n "checking for $bdb_header... " >&6; }
10222 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
10223   $as_echo_n "(cached) " >&6
10224 else
10225   eval "$as_ac_Header=\$ac_header_preproc"
10226 fi
10227 ac_res=`eval 'as_val=${'$as_ac_Header'}
10228                  $as_echo "$as_val"'`
10229                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
10230 $as_echo "$ac_res" >&6; }
10231
10232 fi
10233 as_val=`eval 'as_val=${'$as_ac_Header'}
10234                  $as_echo "$as_val"'`
10235    if test "x$as_val" = x""yes; then
10236
10237           if test ""4"" = "3" -o ""4"" = "4"; then
10238             # We generate a separate cache variable for each prefix and libname
10239             # we search under.  That way, we avoid caching information that
10240             # changes if the user runs `configure' with a different set of
10241             # switches.
10242
10243             cache_id="`echo apu_cv_check_berkeley_db_"4"_"7"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
10244                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
10245
10246
10247             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
10248 $as_echo_n "checking for -l$bdb_libname... " >&6; }
10249                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
10250   $as_echo_n "(cached) " >&6
10251 else
10252
10253
10254     apu_try_berkeley_db_save_libs="$LIBS"
10255
10256     apu_check_berkeley_db_major="4"
10257     apu_check_berkeley_db_minor="7"
10258     apu_check_berkeley_db_patch="-1"
10259     apu_try_berkeley_db_header=$bdb_header
10260     apu_try_berkeley_db_libname=$bdb_libname
10261
10262     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
10263     if test "$cross_compiling" = yes; then
10264   apu_try_berkeley_db=yes
10265
10266 else
10267   cat >conftest.$ac_ext <<_ACEOF
10268 /* confdefs.h.  */
10269 _ACEOF
10270 cat confdefs.h >>conftest.$ac_ext
10271 cat >>conftest.$ac_ext <<_ACEOF
10272 /* end confdefs.h.  */
10273
10274 #include <stdlib.h>
10275 #include <stdio.h>
10276 #include <$apu_try_berkeley_db_header>
10277 main ()
10278 {
10279   int major, minor, patch;
10280
10281   db_version(&major, &minor, &patch);
10282
10283   /* Sanity check: ensure that db.h constants actually match the db library */
10284   if (major != DB_VERSION_MAJOR
10285       || minor != DB_VERSION_MINOR
10286       || patch != DB_VERSION_PATCH)
10287     exit (1);
10288
10289   /* Run-time check:  ensure the library claims to be the correct version. */
10290
10291   if ($apu_check_berkeley_db_major != -1) {
10292     if (major < $apu_check_berkeley_db_major)
10293       exit (1);
10294     if (major > $apu_check_berkeley_db_major)
10295       exit (0);
10296   }
10297
10298   if ($apu_check_berkeley_db_minor != -1) {
10299     if (minor < $apu_check_berkeley_db_minor)
10300       exit (1);
10301     if (minor > $apu_check_berkeley_db_minor)
10302       exit (0);
10303   }
10304
10305   if ($apu_check_berkeley_db_patch == -1
10306       || patch >= $apu_check_berkeley_db_patch)
10307     exit (0);
10308   else
10309     exit (1);
10310 }
10311
10312 _ACEOF
10313 rm -f conftest$ac_exeext
10314 if { (ac_try="$ac_link"
10315 case "(($ac_try" in
10316   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10317   *) ac_try_echo=$ac_try;;
10318 esac
10319 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10320 $as_echo "$ac_try_echo") >&5
10321   (eval "$ac_link") 2>&5
10322   ac_status=$?
10323   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10324   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10325   { (case "(($ac_try" in
10326   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10327   *) ac_try_echo=$ac_try;;
10328 esac
10329 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10330 $as_echo "$ac_try_echo") >&5
10331   (eval "$ac_try") 2>&5
10332   ac_status=$?
10333   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10334   (exit $ac_status); }; }; then
10335   apu_try_berkeley_db=yes
10336 else
10337   $as_echo "$as_me: program exited with status $ac_status" >&5
10338 $as_echo "$as_me: failed program was:" >&5
10339 sed 's/^/| /' conftest.$ac_ext >&5
10340
10341 ( exit $ac_status )
10342 apu_try_berkeley_db=no
10343 fi
10344 rm -rf conftest.dSYM
10345 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10346 fi
10347
10348
10349
10350     LIBS="$apu_try_berkeley_db_save_libs"
10351
10352
10353                 eval "$cache_id=$apu_try_berkeley_db"
10354
10355 fi
10356
10357             result="`eval echo '$'$cache_id`"
10358             { $as_echo "$as_me:$LINENO: result: $result" >&5
10359 $as_echo "$result" >&6; }
10360           elif test ""4"" = "1"; then
10361             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
10362 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
10363 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
10364 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
10365   $as_echo_n "(cached) " >&6
10366 else
10367   ac_check_lib_save_LIBS=$LIBS
10368 LIBS="-l$bdb_libname  $LIBS"
10369 cat >conftest.$ac_ext <<_ACEOF
10370 /* confdefs.h.  */
10371 _ACEOF
10372 cat confdefs.h >>conftest.$ac_ext
10373 cat >>conftest.$ac_ext <<_ACEOF
10374 /* end confdefs.h.  */
10375
10376 /* Override any GCC internal prototype to avoid an error.
10377    Use char because int might match the return type of a GCC
10378    builtin and then its argument prototype would still apply.  */
10379 #ifdef __cplusplus
10380 extern "C"
10381 #endif
10382 char dbopen ();
10383 int
10384 main ()
10385 {
10386 return dbopen ();
10387   ;
10388   return 0;
10389 }
10390 _ACEOF
10391 rm -f conftest.$ac_objext conftest$ac_exeext
10392 if { (ac_try="$ac_link"
10393 case "(($ac_try" in
10394   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10395   *) ac_try_echo=$ac_try;;
10396 esac
10397 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10398 $as_echo "$ac_try_echo") >&5
10399   (eval "$ac_link") 2>conftest.er1
10400   ac_status=$?
10401   grep -v '^ *+' conftest.er1 >conftest.err
10402   rm -f conftest.er1
10403   cat conftest.err >&5
10404   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10405   (exit $ac_status); } && {
10406          test -z "$ac_c_werror_flag" ||
10407          test ! -s conftest.err
10408        } && test -s conftest$ac_exeext && {
10409          test "$cross_compiling" = yes ||
10410          $as_test_x conftest$ac_exeext
10411        }; then
10412   eval "$as_ac_Lib=yes"
10413 else
10414   $as_echo "$as_me: failed program was:" >&5
10415 sed 's/^/| /' conftest.$ac_ext >&5
10416
10417         eval "$as_ac_Lib=no"
10418 fi
10419
10420 rm -rf conftest.dSYM
10421 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
10422       conftest$ac_exeext conftest.$ac_ext
10423 LIBS=$ac_check_lib_save_LIBS
10424 fi
10425 ac_res=`eval 'as_val=${'$as_ac_Lib'}
10426                  $as_echo "$as_val"'`
10427                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
10428 $as_echo "$ac_res" >&6; }
10429 as_val=`eval 'as_val=${'$as_ac_Lib'}
10430                  $as_echo "$as_val"'`
10431    if test "x$as_val" = x""yes; then
10432   result=yes
10433 else
10434   result=no
10435
10436 fi
10437
10438           elif test ""4"" = "2"; then
10439             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
10440 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
10441 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
10442 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
10443   $as_echo_n "(cached) " >&6
10444 else
10445   ac_check_lib_save_LIBS=$LIBS
10446 LIBS="-l$bdb_libname  $LIBS"
10447 cat >conftest.$ac_ext <<_ACEOF
10448 /* confdefs.h.  */
10449 _ACEOF
10450 cat confdefs.h >>conftest.$ac_ext
10451 cat >>conftest.$ac_ext <<_ACEOF
10452 /* end confdefs.h.  */
10453
10454 /* Override any GCC internal prototype to avoid an error.
10455    Use char because int might match the return type of a GCC
10456    builtin and then its argument prototype would still apply.  */
10457 #ifdef __cplusplus
10458 extern "C"
10459 #endif
10460 char db_open ();
10461 int
10462 main ()
10463 {
10464 return db_open ();
10465   ;
10466   return 0;
10467 }
10468 _ACEOF
10469 rm -f conftest.$ac_objext conftest$ac_exeext
10470 if { (ac_try="$ac_link"
10471 case "(($ac_try" in
10472   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10473   *) ac_try_echo=$ac_try;;
10474 esac
10475 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10476 $as_echo "$ac_try_echo") >&5
10477   (eval "$ac_link") 2>conftest.er1
10478   ac_status=$?
10479   grep -v '^ *+' conftest.er1 >conftest.err
10480   rm -f conftest.er1
10481   cat conftest.err >&5
10482   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10483   (exit $ac_status); } && {
10484          test -z "$ac_c_werror_flag" ||
10485          test ! -s conftest.err
10486        } && test -s conftest$ac_exeext && {
10487          test "$cross_compiling" = yes ||
10488          $as_test_x conftest$ac_exeext
10489        }; then
10490   eval "$as_ac_Lib=yes"
10491 else
10492   $as_echo "$as_me: failed program was:" >&5
10493 sed 's/^/| /' conftest.$ac_ext >&5
10494
10495         eval "$as_ac_Lib=no"
10496 fi
10497
10498 rm -rf conftest.dSYM
10499 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
10500       conftest$ac_exeext conftest.$ac_ext
10501 LIBS=$ac_check_lib_save_LIBS
10502 fi
10503 ac_res=`eval 'as_val=${'$as_ac_Lib'}
10504                  $as_echo "$as_val"'`
10505                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
10506 $as_echo "$ac_res" >&6; }
10507 as_val=`eval 'as_val=${'$as_ac_Lib'}
10508                  $as_echo "$as_val"'`
10509    if test "x$as_val" = x""yes; then
10510   result=yes
10511 else
10512   result=no
10513
10514 fi
10515
10516           fi
10517
10518 else
10519   result="no"
10520 fi
10521
10522
10523
10524         # If we found it, no need to search any more.
10525         if test "$result" = "yes"; then
10526           found="$bdb_place"
10527           break
10528         fi
10529       done
10530       test "$found" != "not" && break
10531     done
10532     test "$found" != "not" && break
10533   done
10534
10535   # Restore the original values of the flags we tweak.
10536   LDFLAGS="$apu_check_lib_save_ldflags"
10537   CPPFLAGS="$apu_check_lib_save_cppflags"
10538
10539   case "$found" in
10540   "not")
10541     apu_have_db=0
10542     ;;
10543   "std")
10544     apu_db_header=$bdb_header
10545     apu_db_lib=$bdb_libname
10546     apu_have_db=1
10547     ;;
10548   *":"*)
10549     header="`echo $found | sed -e 's/:.*$//'`"
10550     lib="`echo $found | sed -e 's/^.*://'`"
10551
10552
10553   if test "x$APRUTIL_INCLUDES" = "x"; then
10554     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
10555     APRUTIL_INCLUDES="-I$header"
10556   else
10557     apr_addto_bugger="-I$header"
10558     for i in $apr_addto_bugger; do
10559       apr_addto_duplicate="0"
10560       for j in $APRUTIL_INCLUDES; do
10561         if test "x$i" = "x$j"; then
10562           apr_addto_duplicate="1"
10563           break
10564         fi
10565       done
10566       if test $apr_addto_duplicate = "0"; then
10567         echo "  adding \"$i\" to APRUTIL_INCLUDES"
10568         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
10569       fi
10570     done
10571   fi
10572
10573
10574   if test "x$APRUTIL_LDFLAGS" = "x"; then
10575     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
10576     APRUTIL_LDFLAGS="-L$lib"
10577   else
10578     apr_addto_bugger="-L$lib"
10579     for i in $apr_addto_bugger; do
10580       apr_addto_duplicate="0"
10581       for j in $APRUTIL_LDFLAGS; do
10582         if test "x$i" = "x$j"; then
10583           apr_addto_duplicate="1"
10584           break
10585         fi
10586       done
10587       if test $apr_addto_duplicate = "0"; then
10588         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
10589         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
10590       fi
10591     done
10592   fi
10593
10594     apu_db_header=$bdb_header
10595     apu_db_lib=$bdb_libname
10596     apu_have_db=1
10597     ;;
10598   *)
10599
10600   if test "x$APRUTIL_INCLUDES" = "x"; then
10601     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
10602     APRUTIL_INCLUDES="-I$found/include"
10603   else
10604     apr_addto_bugger="-I$found/include"
10605     for i in $apr_addto_bugger; do
10606       apr_addto_duplicate="0"
10607       for j in $APRUTIL_INCLUDES; do
10608         if test "x$i" = "x$j"; then
10609           apr_addto_duplicate="1"
10610           break
10611         fi
10612       done
10613       if test $apr_addto_duplicate = "0"; then
10614         echo "  adding \"$i\" to APRUTIL_INCLUDES"
10615         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
10616       fi
10617     done
10618   fi
10619
10620
10621   if test "x$APRUTIL_LDFLAGS" = "x"; then
10622     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
10623     APRUTIL_LDFLAGS="-L$found/lib"
10624   else
10625     apr_addto_bugger="-L$found/lib"
10626     for i in $apr_addto_bugger; do
10627       apr_addto_duplicate="0"
10628       for j in $APRUTIL_LDFLAGS; do
10629         if test "x$i" = "x$j"; then
10630           apr_addto_duplicate="1"
10631           break
10632         fi
10633       done
10634       if test $apr_addto_duplicate = "0"; then
10635         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
10636         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
10637       fi
10638     done
10639   fi
10640
10641     apu_db_header=$bdb_header
10642     apu_db_lib=$bdb_libname
10643     apu_have_db=1
10644     ;;
10645   esac
10646
10647   if test "$apu_have_db" = "1"; then
10648     apu_db_version=4
10649   fi
10650
10651     if test "$apu_db_version" != "4"; then
10652
10653   places="$all_places"
10654   if test -z "$places"; then
10655     places="std /usr/local/BerkeleyDB.4.6 /boot/home/config"
10656   fi
10657
10658   bdb_version="4"
10659   if test ""6"" != "-1"; then
10660     bdb_version="$bdb_version."6""
10661     if test ""-1"" != "-1"; then
10662       bdb_version="$bdb_version."-1""
10663     fi
10664   fi
10665   bdb_places="$places"
10666   bdb_default_search_headers="db46/db.h db4/db.h db.h"
10667   bdb_default_search_lib_names="db-4.6 db4-4.6 db46 db4 db"
10668
10669
10670   apu_have_db=0
10671
10672   # Save the original values of the flags we tweak.
10673   apu_check_lib_save_libs="$LIBS"
10674   apu_check_lib_save_ldflags="$LDFLAGS"
10675   apu_check_lib_save_cppflags="$CPPFLAGS"
10676
10677   # The variable `found' is the prefix under which we've found
10678   # Berkeley DB, or `not' if we haven't found it anywhere yet.
10679   found=not
10680   for bdb_place in $bdb_places; do
10681
10682     LDFLAGS="$apu_check_lib_save_ldflags"
10683     CPPFLAGS="$apu_check_lib_save_cppflags"
10684     case "$bdb_place" in
10685       "std" )
10686         description="the standard places"
10687       ;;
10688       *":"* )
10689         header="`echo $bdb_place | sed -e 's/:.*$//'`"
10690         lib="`echo $bdb_place | sed -e 's/^.*://'`"
10691         CPPFLAGS="$CPPFLAGS -I$header"
10692         LDFLAGS="$LDFLAGS -L$lib"
10693         description="$header and $lib"
10694       ;;
10695       * )
10696         if test -d $bdb_place; then
10697           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
10698           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
10699         else
10700           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
10701 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
10702           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
10703 $as_echo "directory not found" >&6; }
10704           continue
10705         fi
10706         description="$bdb_place"
10707       ;;
10708     esac
10709
10710     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
10711     # trick to display a message instead.
10712     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
10713 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
10714     { $as_echo "$as_me:$LINENO: result: " >&5
10715 $as_echo "" >&6; }
10716
10717     for bdb_libname in $bdb_default_search_lib_names; do
10718       for bdb_header in $bdb_default_search_headers; do
10719         # Clear the header cache variable for each location
10720
10721         cache_id="`echo ac_cv_header_${bdb_header} \
10722                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
10723
10724         unset $cache_id
10725         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
10726 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
10727   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
10728 $as_echo_n "checking for $bdb_header... " >&6; }
10729 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
10730   $as_echo_n "(cached) " >&6
10731 fi
10732 ac_res=`eval 'as_val=${'$as_ac_Header'}
10733                  $as_echo "$as_val"'`
10734                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
10735 $as_echo "$ac_res" >&6; }
10736 else
10737   # Is the header compilable?
10738 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
10739 $as_echo_n "checking $bdb_header usability... " >&6; }
10740 cat >conftest.$ac_ext <<_ACEOF
10741 /* confdefs.h.  */
10742 _ACEOF
10743 cat confdefs.h >>conftest.$ac_ext
10744 cat >>conftest.$ac_ext <<_ACEOF
10745 /* end confdefs.h.  */
10746 $ac_includes_default
10747 #include <$bdb_header>
10748 _ACEOF
10749 rm -f conftest.$ac_objext
10750 if { (ac_try="$ac_compile"
10751 case "(($ac_try" in
10752   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10753   *) ac_try_echo=$ac_try;;
10754 esac
10755 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10756 $as_echo "$ac_try_echo") >&5
10757   (eval "$ac_compile") 2>conftest.er1
10758   ac_status=$?
10759   grep -v '^ *+' conftest.er1 >conftest.err
10760   rm -f conftest.er1
10761   cat conftest.err >&5
10762   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10763   (exit $ac_status); } && {
10764          test -z "$ac_c_werror_flag" ||
10765          test ! -s conftest.err
10766        } && test -s conftest.$ac_objext; then
10767   ac_header_compiler=yes
10768 else
10769   $as_echo "$as_me: failed program was:" >&5
10770 sed 's/^/| /' conftest.$ac_ext >&5
10771
10772         ac_header_compiler=no
10773 fi
10774
10775 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10776 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
10777 $as_echo "$ac_header_compiler" >&6; }
10778
10779 # Is the header present?
10780 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
10781 $as_echo_n "checking $bdb_header presence... " >&6; }
10782 cat >conftest.$ac_ext <<_ACEOF
10783 /* confdefs.h.  */
10784 _ACEOF
10785 cat confdefs.h >>conftest.$ac_ext
10786 cat >>conftest.$ac_ext <<_ACEOF
10787 /* end confdefs.h.  */
10788 #include <$bdb_header>
10789 _ACEOF
10790 if { (ac_try="$ac_cpp conftest.$ac_ext"
10791 case "(($ac_try" in
10792   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10793   *) ac_try_echo=$ac_try;;
10794 esac
10795 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10796 $as_echo "$ac_try_echo") >&5
10797   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
10798   ac_status=$?
10799   grep -v '^ *+' conftest.er1 >conftest.err
10800   rm -f conftest.er1
10801   cat conftest.err >&5
10802   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10803   (exit $ac_status); } >/dev/null && {
10804          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
10805          test ! -s conftest.err
10806        }; then
10807   ac_header_preproc=yes
10808 else
10809   $as_echo "$as_me: failed program was:" >&5
10810 sed 's/^/| /' conftest.$ac_ext >&5
10811
10812   ac_header_preproc=no
10813 fi
10814
10815 rm -f conftest.err conftest.$ac_ext
10816 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
10817 $as_echo "$ac_header_preproc" >&6; }
10818
10819 # So?  What about this header?
10820 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
10821   yes:no: )
10822     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
10823 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
10824     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
10825 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
10826     ac_header_preproc=yes
10827     ;;
10828   no:yes:* )
10829     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
10830 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
10831     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
10832 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
10833     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
10834 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
10835     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
10836 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
10837     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
10838 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
10839     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
10840 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
10841
10842     ;;
10843 esac
10844 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
10845 $as_echo_n "checking for $bdb_header... " >&6; }
10846 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
10847   $as_echo_n "(cached) " >&6
10848 else
10849   eval "$as_ac_Header=\$ac_header_preproc"
10850 fi
10851 ac_res=`eval 'as_val=${'$as_ac_Header'}
10852                  $as_echo "$as_val"'`
10853                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
10854 $as_echo "$ac_res" >&6; }
10855
10856 fi
10857 as_val=`eval 'as_val=${'$as_ac_Header'}
10858                  $as_echo "$as_val"'`
10859    if test "x$as_val" = x""yes; then
10860
10861           if test ""4"" = "3" -o ""4"" = "4"; then
10862             # We generate a separate cache variable for each prefix and libname
10863             # we search under.  That way, we avoid caching information that
10864             # changes if the user runs `configure' with a different set of
10865             # switches.
10866
10867             cache_id="`echo apu_cv_check_berkeley_db_"4"_"6"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
10868                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
10869
10870
10871             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
10872 $as_echo_n "checking for -l$bdb_libname... " >&6; }
10873                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
10874   $as_echo_n "(cached) " >&6
10875 else
10876
10877
10878     apu_try_berkeley_db_save_libs="$LIBS"
10879
10880     apu_check_berkeley_db_major="4"
10881     apu_check_berkeley_db_minor="6"
10882     apu_check_berkeley_db_patch="-1"
10883     apu_try_berkeley_db_header=$bdb_header
10884     apu_try_berkeley_db_libname=$bdb_libname
10885
10886     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
10887     if test "$cross_compiling" = yes; then
10888   apu_try_berkeley_db=yes
10889
10890 else
10891   cat >conftest.$ac_ext <<_ACEOF
10892 /* confdefs.h.  */
10893 _ACEOF
10894 cat confdefs.h >>conftest.$ac_ext
10895 cat >>conftest.$ac_ext <<_ACEOF
10896 /* end confdefs.h.  */
10897
10898 #include <stdlib.h>
10899 #include <stdio.h>
10900 #include <$apu_try_berkeley_db_header>
10901 main ()
10902 {
10903   int major, minor, patch;
10904
10905   db_version(&major, &minor, &patch);
10906
10907   /* Sanity check: ensure that db.h constants actually match the db library */
10908   if (major != DB_VERSION_MAJOR
10909       || minor != DB_VERSION_MINOR
10910       || patch != DB_VERSION_PATCH)
10911     exit (1);
10912
10913   /* Run-time check:  ensure the library claims to be the correct version. */
10914
10915   if ($apu_check_berkeley_db_major != -1) {
10916     if (major < $apu_check_berkeley_db_major)
10917       exit (1);
10918     if (major > $apu_check_berkeley_db_major)
10919       exit (0);
10920   }
10921
10922   if ($apu_check_berkeley_db_minor != -1) {
10923     if (minor < $apu_check_berkeley_db_minor)
10924       exit (1);
10925     if (minor > $apu_check_berkeley_db_minor)
10926       exit (0);
10927   }
10928
10929   if ($apu_check_berkeley_db_patch == -1
10930       || patch >= $apu_check_berkeley_db_patch)
10931     exit (0);
10932   else
10933     exit (1);
10934 }
10935
10936 _ACEOF
10937 rm -f conftest$ac_exeext
10938 if { (ac_try="$ac_link"
10939 case "(($ac_try" in
10940   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10941   *) ac_try_echo=$ac_try;;
10942 esac
10943 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10944 $as_echo "$ac_try_echo") >&5
10945   (eval "$ac_link") 2>&5
10946   ac_status=$?
10947   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10948   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10949   { (case "(($ac_try" in
10950   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10951   *) ac_try_echo=$ac_try;;
10952 esac
10953 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10954 $as_echo "$ac_try_echo") >&5
10955   (eval "$ac_try") 2>&5
10956   ac_status=$?
10957   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10958   (exit $ac_status); }; }; then
10959   apu_try_berkeley_db=yes
10960 else
10961   $as_echo "$as_me: program exited with status $ac_status" >&5
10962 $as_echo "$as_me: failed program was:" >&5
10963 sed 's/^/| /' conftest.$ac_ext >&5
10964
10965 ( exit $ac_status )
10966 apu_try_berkeley_db=no
10967 fi
10968 rm -rf conftest.dSYM
10969 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10970 fi
10971
10972
10973
10974     LIBS="$apu_try_berkeley_db_save_libs"
10975
10976
10977                 eval "$cache_id=$apu_try_berkeley_db"
10978
10979 fi
10980
10981             result="`eval echo '$'$cache_id`"
10982             { $as_echo "$as_me:$LINENO: result: $result" >&5
10983 $as_echo "$result" >&6; }
10984           elif test ""4"" = "1"; then
10985             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
10986 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
10987 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
10988 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
10989   $as_echo_n "(cached) " >&6
10990 else
10991   ac_check_lib_save_LIBS=$LIBS
10992 LIBS="-l$bdb_libname  $LIBS"
10993 cat >conftest.$ac_ext <<_ACEOF
10994 /* confdefs.h.  */
10995 _ACEOF
10996 cat confdefs.h >>conftest.$ac_ext
10997 cat >>conftest.$ac_ext <<_ACEOF
10998 /* end confdefs.h.  */
10999
11000 /* Override any GCC internal prototype to avoid an error.
11001    Use char because int might match the return type of a GCC
11002    builtin and then its argument prototype would still apply.  */
11003 #ifdef __cplusplus
11004 extern "C"
11005 #endif
11006 char dbopen ();
11007 int
11008 main ()
11009 {
11010 return dbopen ();
11011   ;
11012   return 0;
11013 }
11014 _ACEOF
11015 rm -f conftest.$ac_objext conftest$ac_exeext
11016 if { (ac_try="$ac_link"
11017 case "(($ac_try" in
11018   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11019   *) ac_try_echo=$ac_try;;
11020 esac
11021 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11022 $as_echo "$ac_try_echo") >&5
11023   (eval "$ac_link") 2>conftest.er1
11024   ac_status=$?
11025   grep -v '^ *+' conftest.er1 >conftest.err
11026   rm -f conftest.er1
11027   cat conftest.err >&5
11028   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11029   (exit $ac_status); } && {
11030          test -z "$ac_c_werror_flag" ||
11031          test ! -s conftest.err
11032        } && test -s conftest$ac_exeext && {
11033          test "$cross_compiling" = yes ||
11034          $as_test_x conftest$ac_exeext
11035        }; then
11036   eval "$as_ac_Lib=yes"
11037 else
11038   $as_echo "$as_me: failed program was:" >&5
11039 sed 's/^/| /' conftest.$ac_ext >&5
11040
11041         eval "$as_ac_Lib=no"
11042 fi
11043
11044 rm -rf conftest.dSYM
11045 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11046       conftest$ac_exeext conftest.$ac_ext
11047 LIBS=$ac_check_lib_save_LIBS
11048 fi
11049 ac_res=`eval 'as_val=${'$as_ac_Lib'}
11050                  $as_echo "$as_val"'`
11051                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
11052 $as_echo "$ac_res" >&6; }
11053 as_val=`eval 'as_val=${'$as_ac_Lib'}
11054                  $as_echo "$as_val"'`
11055    if test "x$as_val" = x""yes; then
11056   result=yes
11057 else
11058   result=no
11059
11060 fi
11061
11062           elif test ""4"" = "2"; then
11063             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
11064 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
11065 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
11066 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
11067   $as_echo_n "(cached) " >&6
11068 else
11069   ac_check_lib_save_LIBS=$LIBS
11070 LIBS="-l$bdb_libname  $LIBS"
11071 cat >conftest.$ac_ext <<_ACEOF
11072 /* confdefs.h.  */
11073 _ACEOF
11074 cat confdefs.h >>conftest.$ac_ext
11075 cat >>conftest.$ac_ext <<_ACEOF
11076 /* end confdefs.h.  */
11077
11078 /* Override any GCC internal prototype to avoid an error.
11079    Use char because int might match the return type of a GCC
11080    builtin and then its argument prototype would still apply.  */
11081 #ifdef __cplusplus
11082 extern "C"
11083 #endif
11084 char db_open ();
11085 int
11086 main ()
11087 {
11088 return db_open ();
11089   ;
11090   return 0;
11091 }
11092 _ACEOF
11093 rm -f conftest.$ac_objext conftest$ac_exeext
11094 if { (ac_try="$ac_link"
11095 case "(($ac_try" in
11096   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11097   *) ac_try_echo=$ac_try;;
11098 esac
11099 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11100 $as_echo "$ac_try_echo") >&5
11101   (eval "$ac_link") 2>conftest.er1
11102   ac_status=$?
11103   grep -v '^ *+' conftest.er1 >conftest.err
11104   rm -f conftest.er1
11105   cat conftest.err >&5
11106   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11107   (exit $ac_status); } && {
11108          test -z "$ac_c_werror_flag" ||
11109          test ! -s conftest.err
11110        } && test -s conftest$ac_exeext && {
11111          test "$cross_compiling" = yes ||
11112          $as_test_x conftest$ac_exeext
11113        }; then
11114   eval "$as_ac_Lib=yes"
11115 else
11116   $as_echo "$as_me: failed program was:" >&5
11117 sed 's/^/| /' conftest.$ac_ext >&5
11118
11119         eval "$as_ac_Lib=no"
11120 fi
11121
11122 rm -rf conftest.dSYM
11123 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11124       conftest$ac_exeext conftest.$ac_ext
11125 LIBS=$ac_check_lib_save_LIBS
11126 fi
11127 ac_res=`eval 'as_val=${'$as_ac_Lib'}
11128                  $as_echo "$as_val"'`
11129                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
11130 $as_echo "$ac_res" >&6; }
11131 as_val=`eval 'as_val=${'$as_ac_Lib'}
11132                  $as_echo "$as_val"'`
11133    if test "x$as_val" = x""yes; then
11134   result=yes
11135 else
11136   result=no
11137
11138 fi
11139
11140           fi
11141
11142 else
11143   result="no"
11144 fi
11145
11146
11147
11148         # If we found it, no need to search any more.
11149         if test "$result" = "yes"; then
11150           found="$bdb_place"
11151           break
11152         fi
11153       done
11154       test "$found" != "not" && break
11155     done
11156     test "$found" != "not" && break
11157   done
11158
11159   # Restore the original values of the flags we tweak.
11160   LDFLAGS="$apu_check_lib_save_ldflags"
11161   CPPFLAGS="$apu_check_lib_save_cppflags"
11162
11163   case "$found" in
11164   "not")
11165     apu_have_db=0
11166     ;;
11167   "std")
11168     apu_db_header=$bdb_header
11169     apu_db_lib=$bdb_libname
11170     apu_have_db=1
11171     ;;
11172   *":"*)
11173     header="`echo $found | sed -e 's/:.*$//'`"
11174     lib="`echo $found | sed -e 's/^.*://'`"
11175
11176
11177   if test "x$APRUTIL_INCLUDES" = "x"; then
11178     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
11179     APRUTIL_INCLUDES="-I$header"
11180   else
11181     apr_addto_bugger="-I$header"
11182     for i in $apr_addto_bugger; do
11183       apr_addto_duplicate="0"
11184       for j in $APRUTIL_INCLUDES; do
11185         if test "x$i" = "x$j"; then
11186           apr_addto_duplicate="1"
11187           break
11188         fi
11189       done
11190       if test $apr_addto_duplicate = "0"; then
11191         echo "  adding \"$i\" to APRUTIL_INCLUDES"
11192         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
11193       fi
11194     done
11195   fi
11196
11197
11198   if test "x$APRUTIL_LDFLAGS" = "x"; then
11199     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
11200     APRUTIL_LDFLAGS="-L$lib"
11201   else
11202     apr_addto_bugger="-L$lib"
11203     for i in $apr_addto_bugger; do
11204       apr_addto_duplicate="0"
11205       for j in $APRUTIL_LDFLAGS; do
11206         if test "x$i" = "x$j"; then
11207           apr_addto_duplicate="1"
11208           break
11209         fi
11210       done
11211       if test $apr_addto_duplicate = "0"; then
11212         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
11213         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
11214       fi
11215     done
11216   fi
11217
11218     apu_db_header=$bdb_header
11219     apu_db_lib=$bdb_libname
11220     apu_have_db=1
11221     ;;
11222   *)
11223
11224   if test "x$APRUTIL_INCLUDES" = "x"; then
11225     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
11226     APRUTIL_INCLUDES="-I$found/include"
11227   else
11228     apr_addto_bugger="-I$found/include"
11229     for i in $apr_addto_bugger; do
11230       apr_addto_duplicate="0"
11231       for j in $APRUTIL_INCLUDES; do
11232         if test "x$i" = "x$j"; then
11233           apr_addto_duplicate="1"
11234           break
11235         fi
11236       done
11237       if test $apr_addto_duplicate = "0"; then
11238         echo "  adding \"$i\" to APRUTIL_INCLUDES"
11239         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
11240       fi
11241     done
11242   fi
11243
11244
11245   if test "x$APRUTIL_LDFLAGS" = "x"; then
11246     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
11247     APRUTIL_LDFLAGS="-L$found/lib"
11248   else
11249     apr_addto_bugger="-L$found/lib"
11250     for i in $apr_addto_bugger; do
11251       apr_addto_duplicate="0"
11252       for j in $APRUTIL_LDFLAGS; do
11253         if test "x$i" = "x$j"; then
11254           apr_addto_duplicate="1"
11255           break
11256         fi
11257       done
11258       if test $apr_addto_duplicate = "0"; then
11259         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
11260         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
11261       fi
11262     done
11263   fi
11264
11265     apu_db_header=$bdb_header
11266     apu_db_lib=$bdb_libname
11267     apu_have_db=1
11268     ;;
11269   esac
11270
11271   if test "$apu_have_db" = "1"; then
11272     apu_db_version=4
11273   fi
11274
11275       if test "$apu_db_version" != "4"; then
11276
11277   places="$all_places"
11278   if test -z "$places"; then
11279     places="std /usr/local/BerkeleyDB.4.5 /boot/home/config"
11280   fi
11281
11282   bdb_version="4"
11283   if test ""5"" != "-1"; then
11284     bdb_version="$bdb_version."5""
11285     if test ""-1"" != "-1"; then
11286       bdb_version="$bdb_version."-1""
11287     fi
11288   fi
11289   bdb_places="$places"
11290   bdb_default_search_headers="db45/db.h db4/db.h db.h"
11291   bdb_default_search_lib_names="db-4.5 db4-4.5 db45 db4 db"
11292
11293
11294   apu_have_db=0
11295
11296   # Save the original values of the flags we tweak.
11297   apu_check_lib_save_libs="$LIBS"
11298   apu_check_lib_save_ldflags="$LDFLAGS"
11299   apu_check_lib_save_cppflags="$CPPFLAGS"
11300
11301   # The variable `found' is the prefix under which we've found
11302   # Berkeley DB, or `not' if we haven't found it anywhere yet.
11303   found=not
11304   for bdb_place in $bdb_places; do
11305
11306     LDFLAGS="$apu_check_lib_save_ldflags"
11307     CPPFLAGS="$apu_check_lib_save_cppflags"
11308     case "$bdb_place" in
11309       "std" )
11310         description="the standard places"
11311       ;;
11312       *":"* )
11313         header="`echo $bdb_place | sed -e 's/:.*$//'`"
11314         lib="`echo $bdb_place | sed -e 's/^.*://'`"
11315         CPPFLAGS="$CPPFLAGS -I$header"
11316         LDFLAGS="$LDFLAGS -L$lib"
11317         description="$header and $lib"
11318       ;;
11319       * )
11320         if test -d $bdb_place; then
11321           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
11322           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
11323         else
11324           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
11325 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
11326           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
11327 $as_echo "directory not found" >&6; }
11328           continue
11329         fi
11330         description="$bdb_place"
11331       ;;
11332     esac
11333
11334     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
11335     # trick to display a message instead.
11336     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
11337 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
11338     { $as_echo "$as_me:$LINENO: result: " >&5
11339 $as_echo "" >&6; }
11340
11341     for bdb_libname in $bdb_default_search_lib_names; do
11342       for bdb_header in $bdb_default_search_headers; do
11343         # Clear the header cache variable for each location
11344
11345         cache_id="`echo ac_cv_header_${bdb_header} \
11346                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
11347
11348         unset $cache_id
11349         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
11350 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
11351   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
11352 $as_echo_n "checking for $bdb_header... " >&6; }
11353 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
11354   $as_echo_n "(cached) " >&6
11355 fi
11356 ac_res=`eval 'as_val=${'$as_ac_Header'}
11357                  $as_echo "$as_val"'`
11358                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
11359 $as_echo "$ac_res" >&6; }
11360 else
11361   # Is the header compilable?
11362 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
11363 $as_echo_n "checking $bdb_header usability... " >&6; }
11364 cat >conftest.$ac_ext <<_ACEOF
11365 /* confdefs.h.  */
11366 _ACEOF
11367 cat confdefs.h >>conftest.$ac_ext
11368 cat >>conftest.$ac_ext <<_ACEOF
11369 /* end confdefs.h.  */
11370 $ac_includes_default
11371 #include <$bdb_header>
11372 _ACEOF
11373 rm -f conftest.$ac_objext
11374 if { (ac_try="$ac_compile"
11375 case "(($ac_try" in
11376   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11377   *) ac_try_echo=$ac_try;;
11378 esac
11379 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11380 $as_echo "$ac_try_echo") >&5
11381   (eval "$ac_compile") 2>conftest.er1
11382   ac_status=$?
11383   grep -v '^ *+' conftest.er1 >conftest.err
11384   rm -f conftest.er1
11385   cat conftest.err >&5
11386   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11387   (exit $ac_status); } && {
11388          test -z "$ac_c_werror_flag" ||
11389          test ! -s conftest.err
11390        } && test -s conftest.$ac_objext; then
11391   ac_header_compiler=yes
11392 else
11393   $as_echo "$as_me: failed program was:" >&5
11394 sed 's/^/| /' conftest.$ac_ext >&5
11395
11396         ac_header_compiler=no
11397 fi
11398
11399 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11400 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
11401 $as_echo "$ac_header_compiler" >&6; }
11402
11403 # Is the header present?
11404 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
11405 $as_echo_n "checking $bdb_header presence... " >&6; }
11406 cat >conftest.$ac_ext <<_ACEOF
11407 /* confdefs.h.  */
11408 _ACEOF
11409 cat confdefs.h >>conftest.$ac_ext
11410 cat >>conftest.$ac_ext <<_ACEOF
11411 /* end confdefs.h.  */
11412 #include <$bdb_header>
11413 _ACEOF
11414 if { (ac_try="$ac_cpp conftest.$ac_ext"
11415 case "(($ac_try" in
11416   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11417   *) ac_try_echo=$ac_try;;
11418 esac
11419 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11420 $as_echo "$ac_try_echo") >&5
11421   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
11422   ac_status=$?
11423   grep -v '^ *+' conftest.er1 >conftest.err
11424   rm -f conftest.er1
11425   cat conftest.err >&5
11426   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11427   (exit $ac_status); } >/dev/null && {
11428          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
11429          test ! -s conftest.err
11430        }; then
11431   ac_header_preproc=yes
11432 else
11433   $as_echo "$as_me: failed program was:" >&5
11434 sed 's/^/| /' conftest.$ac_ext >&5
11435
11436   ac_header_preproc=no
11437 fi
11438
11439 rm -f conftest.err conftest.$ac_ext
11440 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
11441 $as_echo "$ac_header_preproc" >&6; }
11442
11443 # So?  What about this header?
11444 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
11445   yes:no: )
11446     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
11447 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
11448     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
11449 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
11450     ac_header_preproc=yes
11451     ;;
11452   no:yes:* )
11453     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
11454 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
11455     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
11456 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
11457     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
11458 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
11459     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
11460 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
11461     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
11462 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
11463     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
11464 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
11465
11466     ;;
11467 esac
11468 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
11469 $as_echo_n "checking for $bdb_header... " >&6; }
11470 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
11471   $as_echo_n "(cached) " >&6
11472 else
11473   eval "$as_ac_Header=\$ac_header_preproc"
11474 fi
11475 ac_res=`eval 'as_val=${'$as_ac_Header'}
11476                  $as_echo "$as_val"'`
11477                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
11478 $as_echo "$ac_res" >&6; }
11479
11480 fi
11481 as_val=`eval 'as_val=${'$as_ac_Header'}
11482                  $as_echo "$as_val"'`
11483    if test "x$as_val" = x""yes; then
11484
11485           if test ""4"" = "3" -o ""4"" = "4"; then
11486             # We generate a separate cache variable for each prefix and libname
11487             # we search under.  That way, we avoid caching information that
11488             # changes if the user runs `configure' with a different set of
11489             # switches.
11490
11491             cache_id="`echo apu_cv_check_berkeley_db_"4"_"5"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
11492                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
11493
11494
11495             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
11496 $as_echo_n "checking for -l$bdb_libname... " >&6; }
11497                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
11498   $as_echo_n "(cached) " >&6
11499 else
11500
11501
11502     apu_try_berkeley_db_save_libs="$LIBS"
11503
11504     apu_check_berkeley_db_major="4"
11505     apu_check_berkeley_db_minor="5"
11506     apu_check_berkeley_db_patch="-1"
11507     apu_try_berkeley_db_header=$bdb_header
11508     apu_try_berkeley_db_libname=$bdb_libname
11509
11510     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
11511     if test "$cross_compiling" = yes; then
11512   apu_try_berkeley_db=yes
11513
11514 else
11515   cat >conftest.$ac_ext <<_ACEOF
11516 /* confdefs.h.  */
11517 _ACEOF
11518 cat confdefs.h >>conftest.$ac_ext
11519 cat >>conftest.$ac_ext <<_ACEOF
11520 /* end confdefs.h.  */
11521
11522 #include <stdlib.h>
11523 #include <stdio.h>
11524 #include <$apu_try_berkeley_db_header>
11525 main ()
11526 {
11527   int major, minor, patch;
11528
11529   db_version(&major, &minor, &patch);
11530
11531   /* Sanity check: ensure that db.h constants actually match the db library */
11532   if (major != DB_VERSION_MAJOR
11533       || minor != DB_VERSION_MINOR
11534       || patch != DB_VERSION_PATCH)
11535     exit (1);
11536
11537   /* Run-time check:  ensure the library claims to be the correct version. */
11538
11539   if ($apu_check_berkeley_db_major != -1) {
11540     if (major < $apu_check_berkeley_db_major)
11541       exit (1);
11542     if (major > $apu_check_berkeley_db_major)
11543       exit (0);
11544   }
11545
11546   if ($apu_check_berkeley_db_minor != -1) {
11547     if (minor < $apu_check_berkeley_db_minor)
11548       exit (1);
11549     if (minor > $apu_check_berkeley_db_minor)
11550       exit (0);
11551   }
11552
11553   if ($apu_check_berkeley_db_patch == -1
11554       || patch >= $apu_check_berkeley_db_patch)
11555     exit (0);
11556   else
11557     exit (1);
11558 }
11559
11560 _ACEOF
11561 rm -f conftest$ac_exeext
11562 if { (ac_try="$ac_link"
11563 case "(($ac_try" in
11564   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11565   *) ac_try_echo=$ac_try;;
11566 esac
11567 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11568 $as_echo "$ac_try_echo") >&5
11569   (eval "$ac_link") 2>&5
11570   ac_status=$?
11571   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11572   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11573   { (case "(($ac_try" in
11574   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11575   *) ac_try_echo=$ac_try;;
11576 esac
11577 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11578 $as_echo "$ac_try_echo") >&5
11579   (eval "$ac_try") 2>&5
11580   ac_status=$?
11581   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11582   (exit $ac_status); }; }; then
11583   apu_try_berkeley_db=yes
11584 else
11585   $as_echo "$as_me: program exited with status $ac_status" >&5
11586 $as_echo "$as_me: failed program was:" >&5
11587 sed 's/^/| /' conftest.$ac_ext >&5
11588
11589 ( exit $ac_status )
11590 apu_try_berkeley_db=no
11591 fi
11592 rm -rf conftest.dSYM
11593 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11594 fi
11595
11596
11597
11598     LIBS="$apu_try_berkeley_db_save_libs"
11599
11600
11601                 eval "$cache_id=$apu_try_berkeley_db"
11602
11603 fi
11604
11605             result="`eval echo '$'$cache_id`"
11606             { $as_echo "$as_me:$LINENO: result: $result" >&5
11607 $as_echo "$result" >&6; }
11608           elif test ""4"" = "1"; then
11609             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
11610 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
11611 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
11612 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
11613   $as_echo_n "(cached) " >&6
11614 else
11615   ac_check_lib_save_LIBS=$LIBS
11616 LIBS="-l$bdb_libname  $LIBS"
11617 cat >conftest.$ac_ext <<_ACEOF
11618 /* confdefs.h.  */
11619 _ACEOF
11620 cat confdefs.h >>conftest.$ac_ext
11621 cat >>conftest.$ac_ext <<_ACEOF
11622 /* end confdefs.h.  */
11623
11624 /* Override any GCC internal prototype to avoid an error.
11625    Use char because int might match the return type of a GCC
11626    builtin and then its argument prototype would still apply.  */
11627 #ifdef __cplusplus
11628 extern "C"
11629 #endif
11630 char dbopen ();
11631 int
11632 main ()
11633 {
11634 return dbopen ();
11635   ;
11636   return 0;
11637 }
11638 _ACEOF
11639 rm -f conftest.$ac_objext conftest$ac_exeext
11640 if { (ac_try="$ac_link"
11641 case "(($ac_try" in
11642   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11643   *) ac_try_echo=$ac_try;;
11644 esac
11645 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11646 $as_echo "$ac_try_echo") >&5
11647   (eval "$ac_link") 2>conftest.er1
11648   ac_status=$?
11649   grep -v '^ *+' conftest.er1 >conftest.err
11650   rm -f conftest.er1
11651   cat conftest.err >&5
11652   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11653   (exit $ac_status); } && {
11654          test -z "$ac_c_werror_flag" ||
11655          test ! -s conftest.err
11656        } && test -s conftest$ac_exeext && {
11657          test "$cross_compiling" = yes ||
11658          $as_test_x conftest$ac_exeext
11659        }; then
11660   eval "$as_ac_Lib=yes"
11661 else
11662   $as_echo "$as_me: failed program was:" >&5
11663 sed 's/^/| /' conftest.$ac_ext >&5
11664
11665         eval "$as_ac_Lib=no"
11666 fi
11667
11668 rm -rf conftest.dSYM
11669 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11670       conftest$ac_exeext conftest.$ac_ext
11671 LIBS=$ac_check_lib_save_LIBS
11672 fi
11673 ac_res=`eval 'as_val=${'$as_ac_Lib'}
11674                  $as_echo "$as_val"'`
11675                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
11676 $as_echo "$ac_res" >&6; }
11677 as_val=`eval 'as_val=${'$as_ac_Lib'}
11678                  $as_echo "$as_val"'`
11679    if test "x$as_val" = x""yes; then
11680   result=yes
11681 else
11682   result=no
11683
11684 fi
11685
11686           elif test ""4"" = "2"; then
11687             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
11688 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
11689 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
11690 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
11691   $as_echo_n "(cached) " >&6
11692 else
11693   ac_check_lib_save_LIBS=$LIBS
11694 LIBS="-l$bdb_libname  $LIBS"
11695 cat >conftest.$ac_ext <<_ACEOF
11696 /* confdefs.h.  */
11697 _ACEOF
11698 cat confdefs.h >>conftest.$ac_ext
11699 cat >>conftest.$ac_ext <<_ACEOF
11700 /* end confdefs.h.  */
11701
11702 /* Override any GCC internal prototype to avoid an error.
11703    Use char because int might match the return type of a GCC
11704    builtin and then its argument prototype would still apply.  */
11705 #ifdef __cplusplus
11706 extern "C"
11707 #endif
11708 char db_open ();
11709 int
11710 main ()
11711 {
11712 return db_open ();
11713   ;
11714   return 0;
11715 }
11716 _ACEOF
11717 rm -f conftest.$ac_objext conftest$ac_exeext
11718 if { (ac_try="$ac_link"
11719 case "(($ac_try" in
11720   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11721   *) ac_try_echo=$ac_try;;
11722 esac
11723 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11724 $as_echo "$ac_try_echo") >&5
11725   (eval "$ac_link") 2>conftest.er1
11726   ac_status=$?
11727   grep -v '^ *+' conftest.er1 >conftest.err
11728   rm -f conftest.er1
11729   cat conftest.err >&5
11730   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11731   (exit $ac_status); } && {
11732          test -z "$ac_c_werror_flag" ||
11733          test ! -s conftest.err
11734        } && test -s conftest$ac_exeext && {
11735          test "$cross_compiling" = yes ||
11736          $as_test_x conftest$ac_exeext
11737        }; then
11738   eval "$as_ac_Lib=yes"
11739 else
11740   $as_echo "$as_me: failed program was:" >&5
11741 sed 's/^/| /' conftest.$ac_ext >&5
11742
11743         eval "$as_ac_Lib=no"
11744 fi
11745
11746 rm -rf conftest.dSYM
11747 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11748       conftest$ac_exeext conftest.$ac_ext
11749 LIBS=$ac_check_lib_save_LIBS
11750 fi
11751 ac_res=`eval 'as_val=${'$as_ac_Lib'}
11752                  $as_echo "$as_val"'`
11753                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
11754 $as_echo "$ac_res" >&6; }
11755 as_val=`eval 'as_val=${'$as_ac_Lib'}
11756                  $as_echo "$as_val"'`
11757    if test "x$as_val" = x""yes; then
11758   result=yes
11759 else
11760   result=no
11761
11762 fi
11763
11764           fi
11765
11766 else
11767   result="no"
11768 fi
11769
11770
11771
11772         # If we found it, no need to search any more.
11773         if test "$result" = "yes"; then
11774           found="$bdb_place"
11775           break
11776         fi
11777       done
11778       test "$found" != "not" && break
11779     done
11780     test "$found" != "not" && break
11781   done
11782
11783   # Restore the original values of the flags we tweak.
11784   LDFLAGS="$apu_check_lib_save_ldflags"
11785   CPPFLAGS="$apu_check_lib_save_cppflags"
11786
11787   case "$found" in
11788   "not")
11789     apu_have_db=0
11790     ;;
11791   "std")
11792     apu_db_header=$bdb_header
11793     apu_db_lib=$bdb_libname
11794     apu_have_db=1
11795     ;;
11796   *":"*)
11797     header="`echo $found | sed -e 's/:.*$//'`"
11798     lib="`echo $found | sed -e 's/^.*://'`"
11799
11800
11801   if test "x$APRUTIL_INCLUDES" = "x"; then
11802     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
11803     APRUTIL_INCLUDES="-I$header"
11804   else
11805     apr_addto_bugger="-I$header"
11806     for i in $apr_addto_bugger; do
11807       apr_addto_duplicate="0"
11808       for j in $APRUTIL_INCLUDES; do
11809         if test "x$i" = "x$j"; then
11810           apr_addto_duplicate="1"
11811           break
11812         fi
11813       done
11814       if test $apr_addto_duplicate = "0"; then
11815         echo "  adding \"$i\" to APRUTIL_INCLUDES"
11816         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
11817       fi
11818     done
11819   fi
11820
11821
11822   if test "x$APRUTIL_LDFLAGS" = "x"; then
11823     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
11824     APRUTIL_LDFLAGS="-L$lib"
11825   else
11826     apr_addto_bugger="-L$lib"
11827     for i in $apr_addto_bugger; do
11828       apr_addto_duplicate="0"
11829       for j in $APRUTIL_LDFLAGS; do
11830         if test "x$i" = "x$j"; then
11831           apr_addto_duplicate="1"
11832           break
11833         fi
11834       done
11835       if test $apr_addto_duplicate = "0"; then
11836         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
11837         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
11838       fi
11839     done
11840   fi
11841
11842     apu_db_header=$bdb_header
11843     apu_db_lib=$bdb_libname
11844     apu_have_db=1
11845     ;;
11846   *)
11847
11848   if test "x$APRUTIL_INCLUDES" = "x"; then
11849     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
11850     APRUTIL_INCLUDES="-I$found/include"
11851   else
11852     apr_addto_bugger="-I$found/include"
11853     for i in $apr_addto_bugger; do
11854       apr_addto_duplicate="0"
11855       for j in $APRUTIL_INCLUDES; do
11856         if test "x$i" = "x$j"; then
11857           apr_addto_duplicate="1"
11858           break
11859         fi
11860       done
11861       if test $apr_addto_duplicate = "0"; then
11862         echo "  adding \"$i\" to APRUTIL_INCLUDES"
11863         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
11864       fi
11865     done
11866   fi
11867
11868
11869   if test "x$APRUTIL_LDFLAGS" = "x"; then
11870     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
11871     APRUTIL_LDFLAGS="-L$found/lib"
11872   else
11873     apr_addto_bugger="-L$found/lib"
11874     for i in $apr_addto_bugger; do
11875       apr_addto_duplicate="0"
11876       for j in $APRUTIL_LDFLAGS; do
11877         if test "x$i" = "x$j"; then
11878           apr_addto_duplicate="1"
11879           break
11880         fi
11881       done
11882       if test $apr_addto_duplicate = "0"; then
11883         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
11884         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
11885       fi
11886     done
11887   fi
11888
11889     apu_db_header=$bdb_header
11890     apu_db_lib=$bdb_libname
11891     apu_have_db=1
11892     ;;
11893   esac
11894
11895   if test "$apu_have_db" = "1"; then
11896     apu_db_version=4
11897   fi
11898
11899         if test "$apu_db_version" != "4"; then
11900
11901   places="$all_places"
11902   if test -z "$places"; then
11903     places="std /usr/local/BerkeleyDB.4.4 /boot/home/config"
11904   fi
11905
11906   bdb_version="4"
11907   if test ""4"" != "-1"; then
11908     bdb_version="$bdb_version."4""
11909     if test ""-1"" != "-1"; then
11910       bdb_version="$bdb_version."-1""
11911     fi
11912   fi
11913   bdb_places="$places"
11914   bdb_default_search_headers="db44/db.h db4/db.h db.h"
11915   bdb_default_search_lib_names="db-4.4 db4-4.4 db44 db4 db"
11916
11917
11918   apu_have_db=0
11919
11920   # Save the original values of the flags we tweak.
11921   apu_check_lib_save_libs="$LIBS"
11922   apu_check_lib_save_ldflags="$LDFLAGS"
11923   apu_check_lib_save_cppflags="$CPPFLAGS"
11924
11925   # The variable `found' is the prefix under which we've found
11926   # Berkeley DB, or `not' if we haven't found it anywhere yet.
11927   found=not
11928   for bdb_place in $bdb_places; do
11929
11930     LDFLAGS="$apu_check_lib_save_ldflags"
11931     CPPFLAGS="$apu_check_lib_save_cppflags"
11932     case "$bdb_place" in
11933       "std" )
11934         description="the standard places"
11935       ;;
11936       *":"* )
11937         header="`echo $bdb_place | sed -e 's/:.*$//'`"
11938         lib="`echo $bdb_place | sed -e 's/^.*://'`"
11939         CPPFLAGS="$CPPFLAGS -I$header"
11940         LDFLAGS="$LDFLAGS -L$lib"
11941         description="$header and $lib"
11942       ;;
11943       * )
11944         if test -d $bdb_place; then
11945           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
11946           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
11947         else
11948           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
11949 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
11950           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
11951 $as_echo "directory not found" >&6; }
11952           continue
11953         fi
11954         description="$bdb_place"
11955       ;;
11956     esac
11957
11958     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
11959     # trick to display a message instead.
11960     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
11961 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
11962     { $as_echo "$as_me:$LINENO: result: " >&5
11963 $as_echo "" >&6; }
11964
11965     for bdb_libname in $bdb_default_search_lib_names; do
11966       for bdb_header in $bdb_default_search_headers; do
11967         # Clear the header cache variable for each location
11968
11969         cache_id="`echo ac_cv_header_${bdb_header} \
11970                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
11971
11972         unset $cache_id
11973         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
11974 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
11975   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
11976 $as_echo_n "checking for $bdb_header... " >&6; }
11977 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
11978   $as_echo_n "(cached) " >&6
11979 fi
11980 ac_res=`eval 'as_val=${'$as_ac_Header'}
11981                  $as_echo "$as_val"'`
11982                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
11983 $as_echo "$ac_res" >&6; }
11984 else
11985   # Is the header compilable?
11986 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
11987 $as_echo_n "checking $bdb_header usability... " >&6; }
11988 cat >conftest.$ac_ext <<_ACEOF
11989 /* confdefs.h.  */
11990 _ACEOF
11991 cat confdefs.h >>conftest.$ac_ext
11992 cat >>conftest.$ac_ext <<_ACEOF
11993 /* end confdefs.h.  */
11994 $ac_includes_default
11995 #include <$bdb_header>
11996 _ACEOF
11997 rm -f conftest.$ac_objext
11998 if { (ac_try="$ac_compile"
11999 case "(($ac_try" in
12000   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12001   *) ac_try_echo=$ac_try;;
12002 esac
12003 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12004 $as_echo "$ac_try_echo") >&5
12005   (eval "$ac_compile") 2>conftest.er1
12006   ac_status=$?
12007   grep -v '^ *+' conftest.er1 >conftest.err
12008   rm -f conftest.er1
12009   cat conftest.err >&5
12010   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12011   (exit $ac_status); } && {
12012          test -z "$ac_c_werror_flag" ||
12013          test ! -s conftest.err
12014        } && test -s conftest.$ac_objext; then
12015   ac_header_compiler=yes
12016 else
12017   $as_echo "$as_me: failed program was:" >&5
12018 sed 's/^/| /' conftest.$ac_ext >&5
12019
12020         ac_header_compiler=no
12021 fi
12022
12023 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12024 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
12025 $as_echo "$ac_header_compiler" >&6; }
12026
12027 # Is the header present?
12028 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
12029 $as_echo_n "checking $bdb_header presence... " >&6; }
12030 cat >conftest.$ac_ext <<_ACEOF
12031 /* confdefs.h.  */
12032 _ACEOF
12033 cat confdefs.h >>conftest.$ac_ext
12034 cat >>conftest.$ac_ext <<_ACEOF
12035 /* end confdefs.h.  */
12036 #include <$bdb_header>
12037 _ACEOF
12038 if { (ac_try="$ac_cpp conftest.$ac_ext"
12039 case "(($ac_try" in
12040   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12041   *) ac_try_echo=$ac_try;;
12042 esac
12043 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12044 $as_echo "$ac_try_echo") >&5
12045   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
12046   ac_status=$?
12047   grep -v '^ *+' conftest.er1 >conftest.err
12048   rm -f conftest.er1
12049   cat conftest.err >&5
12050   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12051   (exit $ac_status); } >/dev/null && {
12052          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
12053          test ! -s conftest.err
12054        }; then
12055   ac_header_preproc=yes
12056 else
12057   $as_echo "$as_me: failed program was:" >&5
12058 sed 's/^/| /' conftest.$ac_ext >&5
12059
12060   ac_header_preproc=no
12061 fi
12062
12063 rm -f conftest.err conftest.$ac_ext
12064 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
12065 $as_echo "$ac_header_preproc" >&6; }
12066
12067 # So?  What about this header?
12068 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
12069   yes:no: )
12070     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
12071 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
12072     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
12073 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
12074     ac_header_preproc=yes
12075     ;;
12076   no:yes:* )
12077     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
12078 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
12079     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
12080 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
12081     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
12082 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
12083     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
12084 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
12085     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
12086 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
12087     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
12088 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
12089
12090     ;;
12091 esac
12092 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
12093 $as_echo_n "checking for $bdb_header... " >&6; }
12094 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
12095   $as_echo_n "(cached) " >&6
12096 else
12097   eval "$as_ac_Header=\$ac_header_preproc"
12098 fi
12099 ac_res=`eval 'as_val=${'$as_ac_Header'}
12100                  $as_echo "$as_val"'`
12101                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
12102 $as_echo "$ac_res" >&6; }
12103
12104 fi
12105 as_val=`eval 'as_val=${'$as_ac_Header'}
12106                  $as_echo "$as_val"'`
12107    if test "x$as_val" = x""yes; then
12108
12109           if test ""4"" = "3" -o ""4"" = "4"; then
12110             # We generate a separate cache variable for each prefix and libname
12111             # we search under.  That way, we avoid caching information that
12112             # changes if the user runs `configure' with a different set of
12113             # switches.
12114
12115             cache_id="`echo apu_cv_check_berkeley_db_"4"_"4"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
12116                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
12117
12118
12119             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
12120 $as_echo_n "checking for -l$bdb_libname... " >&6; }
12121                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
12122   $as_echo_n "(cached) " >&6
12123 else
12124
12125
12126     apu_try_berkeley_db_save_libs="$LIBS"
12127
12128     apu_check_berkeley_db_major="4"
12129     apu_check_berkeley_db_minor="4"
12130     apu_check_berkeley_db_patch="-1"
12131     apu_try_berkeley_db_header=$bdb_header
12132     apu_try_berkeley_db_libname=$bdb_libname
12133
12134     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
12135     if test "$cross_compiling" = yes; then
12136   apu_try_berkeley_db=yes
12137
12138 else
12139   cat >conftest.$ac_ext <<_ACEOF
12140 /* confdefs.h.  */
12141 _ACEOF
12142 cat confdefs.h >>conftest.$ac_ext
12143 cat >>conftest.$ac_ext <<_ACEOF
12144 /* end confdefs.h.  */
12145
12146 #include <stdlib.h>
12147 #include <stdio.h>
12148 #include <$apu_try_berkeley_db_header>
12149 main ()
12150 {
12151   int major, minor, patch;
12152
12153   db_version(&major, &minor, &patch);
12154
12155   /* Sanity check: ensure that db.h constants actually match the db library */
12156   if (major != DB_VERSION_MAJOR
12157       || minor != DB_VERSION_MINOR
12158       || patch != DB_VERSION_PATCH)
12159     exit (1);
12160
12161   /* Run-time check:  ensure the library claims to be the correct version. */
12162
12163   if ($apu_check_berkeley_db_major != -1) {
12164     if (major < $apu_check_berkeley_db_major)
12165       exit (1);
12166     if (major > $apu_check_berkeley_db_major)
12167       exit (0);
12168   }
12169
12170   if ($apu_check_berkeley_db_minor != -1) {
12171     if (minor < $apu_check_berkeley_db_minor)
12172       exit (1);
12173     if (minor > $apu_check_berkeley_db_minor)
12174       exit (0);
12175   }
12176
12177   if ($apu_check_berkeley_db_patch == -1
12178       || patch >= $apu_check_berkeley_db_patch)
12179     exit (0);
12180   else
12181     exit (1);
12182 }
12183
12184 _ACEOF
12185 rm -f conftest$ac_exeext
12186 if { (ac_try="$ac_link"
12187 case "(($ac_try" in
12188   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12189   *) ac_try_echo=$ac_try;;
12190 esac
12191 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12192 $as_echo "$ac_try_echo") >&5
12193   (eval "$ac_link") 2>&5
12194   ac_status=$?
12195   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12196   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12197   { (case "(($ac_try" in
12198   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12199   *) ac_try_echo=$ac_try;;
12200 esac
12201 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12202 $as_echo "$ac_try_echo") >&5
12203   (eval "$ac_try") 2>&5
12204   ac_status=$?
12205   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12206   (exit $ac_status); }; }; then
12207   apu_try_berkeley_db=yes
12208 else
12209   $as_echo "$as_me: program exited with status $ac_status" >&5
12210 $as_echo "$as_me: failed program was:" >&5
12211 sed 's/^/| /' conftest.$ac_ext >&5
12212
12213 ( exit $ac_status )
12214 apu_try_berkeley_db=no
12215 fi
12216 rm -rf conftest.dSYM
12217 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12218 fi
12219
12220
12221
12222     LIBS="$apu_try_berkeley_db_save_libs"
12223
12224
12225                 eval "$cache_id=$apu_try_berkeley_db"
12226
12227 fi
12228
12229             result="`eval echo '$'$cache_id`"
12230             { $as_echo "$as_me:$LINENO: result: $result" >&5
12231 $as_echo "$result" >&6; }
12232           elif test ""4"" = "1"; then
12233             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
12234 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
12235 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
12236 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
12237   $as_echo_n "(cached) " >&6
12238 else
12239   ac_check_lib_save_LIBS=$LIBS
12240 LIBS="-l$bdb_libname  $LIBS"
12241 cat >conftest.$ac_ext <<_ACEOF
12242 /* confdefs.h.  */
12243 _ACEOF
12244 cat confdefs.h >>conftest.$ac_ext
12245 cat >>conftest.$ac_ext <<_ACEOF
12246 /* end confdefs.h.  */
12247
12248 /* Override any GCC internal prototype to avoid an error.
12249    Use char because int might match the return type of a GCC
12250    builtin and then its argument prototype would still apply.  */
12251 #ifdef __cplusplus
12252 extern "C"
12253 #endif
12254 char dbopen ();
12255 int
12256 main ()
12257 {
12258 return dbopen ();
12259   ;
12260   return 0;
12261 }
12262 _ACEOF
12263 rm -f conftest.$ac_objext conftest$ac_exeext
12264 if { (ac_try="$ac_link"
12265 case "(($ac_try" in
12266   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12267   *) ac_try_echo=$ac_try;;
12268 esac
12269 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12270 $as_echo "$ac_try_echo") >&5
12271   (eval "$ac_link") 2>conftest.er1
12272   ac_status=$?
12273   grep -v '^ *+' conftest.er1 >conftest.err
12274   rm -f conftest.er1
12275   cat conftest.err >&5
12276   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12277   (exit $ac_status); } && {
12278          test -z "$ac_c_werror_flag" ||
12279          test ! -s conftest.err
12280        } && test -s conftest$ac_exeext && {
12281          test "$cross_compiling" = yes ||
12282          $as_test_x conftest$ac_exeext
12283        }; then
12284   eval "$as_ac_Lib=yes"
12285 else
12286   $as_echo "$as_me: failed program was:" >&5
12287 sed 's/^/| /' conftest.$ac_ext >&5
12288
12289         eval "$as_ac_Lib=no"
12290 fi
12291
12292 rm -rf conftest.dSYM
12293 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12294       conftest$ac_exeext conftest.$ac_ext
12295 LIBS=$ac_check_lib_save_LIBS
12296 fi
12297 ac_res=`eval 'as_val=${'$as_ac_Lib'}
12298                  $as_echo "$as_val"'`
12299                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
12300 $as_echo "$ac_res" >&6; }
12301 as_val=`eval 'as_val=${'$as_ac_Lib'}
12302                  $as_echo "$as_val"'`
12303    if test "x$as_val" = x""yes; then
12304   result=yes
12305 else
12306   result=no
12307
12308 fi
12309
12310           elif test ""4"" = "2"; then
12311             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
12312 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
12313 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
12314 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
12315   $as_echo_n "(cached) " >&6
12316 else
12317   ac_check_lib_save_LIBS=$LIBS
12318 LIBS="-l$bdb_libname  $LIBS"
12319 cat >conftest.$ac_ext <<_ACEOF
12320 /* confdefs.h.  */
12321 _ACEOF
12322 cat confdefs.h >>conftest.$ac_ext
12323 cat >>conftest.$ac_ext <<_ACEOF
12324 /* end confdefs.h.  */
12325
12326 /* Override any GCC internal prototype to avoid an error.
12327    Use char because int might match the return type of a GCC
12328    builtin and then its argument prototype would still apply.  */
12329 #ifdef __cplusplus
12330 extern "C"
12331 #endif
12332 char db_open ();
12333 int
12334 main ()
12335 {
12336 return db_open ();
12337   ;
12338   return 0;
12339 }
12340 _ACEOF
12341 rm -f conftest.$ac_objext conftest$ac_exeext
12342 if { (ac_try="$ac_link"
12343 case "(($ac_try" in
12344   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12345   *) ac_try_echo=$ac_try;;
12346 esac
12347 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12348 $as_echo "$ac_try_echo") >&5
12349   (eval "$ac_link") 2>conftest.er1
12350   ac_status=$?
12351   grep -v '^ *+' conftest.er1 >conftest.err
12352   rm -f conftest.er1
12353   cat conftest.err >&5
12354   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12355   (exit $ac_status); } && {
12356          test -z "$ac_c_werror_flag" ||
12357          test ! -s conftest.err
12358        } && test -s conftest$ac_exeext && {
12359          test "$cross_compiling" = yes ||
12360          $as_test_x conftest$ac_exeext
12361        }; then
12362   eval "$as_ac_Lib=yes"
12363 else
12364   $as_echo "$as_me: failed program was:" >&5
12365 sed 's/^/| /' conftest.$ac_ext >&5
12366
12367         eval "$as_ac_Lib=no"
12368 fi
12369
12370 rm -rf conftest.dSYM
12371 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12372       conftest$ac_exeext conftest.$ac_ext
12373 LIBS=$ac_check_lib_save_LIBS
12374 fi
12375 ac_res=`eval 'as_val=${'$as_ac_Lib'}
12376                  $as_echo "$as_val"'`
12377                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
12378 $as_echo "$ac_res" >&6; }
12379 as_val=`eval 'as_val=${'$as_ac_Lib'}
12380                  $as_echo "$as_val"'`
12381    if test "x$as_val" = x""yes; then
12382   result=yes
12383 else
12384   result=no
12385
12386 fi
12387
12388           fi
12389
12390 else
12391   result="no"
12392 fi
12393
12394
12395
12396         # If we found it, no need to search any more.
12397         if test "$result" = "yes"; then
12398           found="$bdb_place"
12399           break
12400         fi
12401       done
12402       test "$found" != "not" && break
12403     done
12404     test "$found" != "not" && break
12405   done
12406
12407   # Restore the original values of the flags we tweak.
12408   LDFLAGS="$apu_check_lib_save_ldflags"
12409   CPPFLAGS="$apu_check_lib_save_cppflags"
12410
12411   case "$found" in
12412   "not")
12413     apu_have_db=0
12414     ;;
12415   "std")
12416     apu_db_header=$bdb_header
12417     apu_db_lib=$bdb_libname
12418     apu_have_db=1
12419     ;;
12420   *":"*)
12421     header="`echo $found | sed -e 's/:.*$//'`"
12422     lib="`echo $found | sed -e 's/^.*://'`"
12423
12424
12425   if test "x$APRUTIL_INCLUDES" = "x"; then
12426     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
12427     APRUTIL_INCLUDES="-I$header"
12428   else
12429     apr_addto_bugger="-I$header"
12430     for i in $apr_addto_bugger; do
12431       apr_addto_duplicate="0"
12432       for j in $APRUTIL_INCLUDES; do
12433         if test "x$i" = "x$j"; then
12434           apr_addto_duplicate="1"
12435           break
12436         fi
12437       done
12438       if test $apr_addto_duplicate = "0"; then
12439         echo "  adding \"$i\" to APRUTIL_INCLUDES"
12440         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
12441       fi
12442     done
12443   fi
12444
12445
12446   if test "x$APRUTIL_LDFLAGS" = "x"; then
12447     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
12448     APRUTIL_LDFLAGS="-L$lib"
12449   else
12450     apr_addto_bugger="-L$lib"
12451     for i in $apr_addto_bugger; do
12452       apr_addto_duplicate="0"
12453       for j in $APRUTIL_LDFLAGS; do
12454         if test "x$i" = "x$j"; then
12455           apr_addto_duplicate="1"
12456           break
12457         fi
12458       done
12459       if test $apr_addto_duplicate = "0"; then
12460         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
12461         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
12462       fi
12463     done
12464   fi
12465
12466     apu_db_header=$bdb_header
12467     apu_db_lib=$bdb_libname
12468     apu_have_db=1
12469     ;;
12470   *)
12471
12472   if test "x$APRUTIL_INCLUDES" = "x"; then
12473     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
12474     APRUTIL_INCLUDES="-I$found/include"
12475   else
12476     apr_addto_bugger="-I$found/include"
12477     for i in $apr_addto_bugger; do
12478       apr_addto_duplicate="0"
12479       for j in $APRUTIL_INCLUDES; do
12480         if test "x$i" = "x$j"; then
12481           apr_addto_duplicate="1"
12482           break
12483         fi
12484       done
12485       if test $apr_addto_duplicate = "0"; then
12486         echo "  adding \"$i\" to APRUTIL_INCLUDES"
12487         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
12488       fi
12489     done
12490   fi
12491
12492
12493   if test "x$APRUTIL_LDFLAGS" = "x"; then
12494     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
12495     APRUTIL_LDFLAGS="-L$found/lib"
12496   else
12497     apr_addto_bugger="-L$found/lib"
12498     for i in $apr_addto_bugger; do
12499       apr_addto_duplicate="0"
12500       for j in $APRUTIL_LDFLAGS; do
12501         if test "x$i" = "x$j"; then
12502           apr_addto_duplicate="1"
12503           break
12504         fi
12505       done
12506       if test $apr_addto_duplicate = "0"; then
12507         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
12508         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
12509       fi
12510     done
12511   fi
12512
12513     apu_db_header=$bdb_header
12514     apu_db_lib=$bdb_libname
12515     apu_have_db=1
12516     ;;
12517   esac
12518
12519   if test "$apu_have_db" = "1"; then
12520     apu_db_version=4
12521   fi
12522
12523           if test "$apu_db_version" != "4"; then
12524
12525   places="$all_places"
12526   if test -z "$places"; then
12527     places="std /usr/local/BerkeleyDB.4.3 /boot/home/config"
12528   fi
12529
12530   bdb_version="4"
12531   if test ""3"" != "-1"; then
12532     bdb_version="$bdb_version."3""
12533     if test ""-1"" != "-1"; then
12534       bdb_version="$bdb_version."-1""
12535     fi
12536   fi
12537   bdb_places="$places"
12538   bdb_default_search_headers="db43/db.h db4/db.h db.h"
12539   bdb_default_search_lib_names="db-4.3 db4-4.3 db43 db4 db"
12540
12541
12542   apu_have_db=0
12543
12544   # Save the original values of the flags we tweak.
12545   apu_check_lib_save_libs="$LIBS"
12546   apu_check_lib_save_ldflags="$LDFLAGS"
12547   apu_check_lib_save_cppflags="$CPPFLAGS"
12548
12549   # The variable `found' is the prefix under which we've found
12550   # Berkeley DB, or `not' if we haven't found it anywhere yet.
12551   found=not
12552   for bdb_place in $bdb_places; do
12553
12554     LDFLAGS="$apu_check_lib_save_ldflags"
12555     CPPFLAGS="$apu_check_lib_save_cppflags"
12556     case "$bdb_place" in
12557       "std" )
12558         description="the standard places"
12559       ;;
12560       *":"* )
12561         header="`echo $bdb_place | sed -e 's/:.*$//'`"
12562         lib="`echo $bdb_place | sed -e 's/^.*://'`"
12563         CPPFLAGS="$CPPFLAGS -I$header"
12564         LDFLAGS="$LDFLAGS -L$lib"
12565         description="$header and $lib"
12566       ;;
12567       * )
12568         if test -d $bdb_place; then
12569           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
12570           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
12571         else
12572           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
12573 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
12574           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
12575 $as_echo "directory not found" >&6; }
12576           continue
12577         fi
12578         description="$bdb_place"
12579       ;;
12580     esac
12581
12582     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
12583     # trick to display a message instead.
12584     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
12585 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
12586     { $as_echo "$as_me:$LINENO: result: " >&5
12587 $as_echo "" >&6; }
12588
12589     for bdb_libname in $bdb_default_search_lib_names; do
12590       for bdb_header in $bdb_default_search_headers; do
12591         # Clear the header cache variable for each location
12592
12593         cache_id="`echo ac_cv_header_${bdb_header} \
12594                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
12595
12596         unset $cache_id
12597         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
12598 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
12599   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
12600 $as_echo_n "checking for $bdb_header... " >&6; }
12601 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
12602   $as_echo_n "(cached) " >&6
12603 fi
12604 ac_res=`eval 'as_val=${'$as_ac_Header'}
12605                  $as_echo "$as_val"'`
12606                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
12607 $as_echo "$ac_res" >&6; }
12608 else
12609   # Is the header compilable?
12610 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
12611 $as_echo_n "checking $bdb_header usability... " >&6; }
12612 cat >conftest.$ac_ext <<_ACEOF
12613 /* confdefs.h.  */
12614 _ACEOF
12615 cat confdefs.h >>conftest.$ac_ext
12616 cat >>conftest.$ac_ext <<_ACEOF
12617 /* end confdefs.h.  */
12618 $ac_includes_default
12619 #include <$bdb_header>
12620 _ACEOF
12621 rm -f conftest.$ac_objext
12622 if { (ac_try="$ac_compile"
12623 case "(($ac_try" in
12624   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12625   *) ac_try_echo=$ac_try;;
12626 esac
12627 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12628 $as_echo "$ac_try_echo") >&5
12629   (eval "$ac_compile") 2>conftest.er1
12630   ac_status=$?
12631   grep -v '^ *+' conftest.er1 >conftest.err
12632   rm -f conftest.er1
12633   cat conftest.err >&5
12634   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12635   (exit $ac_status); } && {
12636          test -z "$ac_c_werror_flag" ||
12637          test ! -s conftest.err
12638        } && test -s conftest.$ac_objext; then
12639   ac_header_compiler=yes
12640 else
12641   $as_echo "$as_me: failed program was:" >&5
12642 sed 's/^/| /' conftest.$ac_ext >&5
12643
12644         ac_header_compiler=no
12645 fi
12646
12647 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12648 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
12649 $as_echo "$ac_header_compiler" >&6; }
12650
12651 # Is the header present?
12652 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
12653 $as_echo_n "checking $bdb_header presence... " >&6; }
12654 cat >conftest.$ac_ext <<_ACEOF
12655 /* confdefs.h.  */
12656 _ACEOF
12657 cat confdefs.h >>conftest.$ac_ext
12658 cat >>conftest.$ac_ext <<_ACEOF
12659 /* end confdefs.h.  */
12660 #include <$bdb_header>
12661 _ACEOF
12662 if { (ac_try="$ac_cpp conftest.$ac_ext"
12663 case "(($ac_try" in
12664   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12665   *) ac_try_echo=$ac_try;;
12666 esac
12667 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12668 $as_echo "$ac_try_echo") >&5
12669   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
12670   ac_status=$?
12671   grep -v '^ *+' conftest.er1 >conftest.err
12672   rm -f conftest.er1
12673   cat conftest.err >&5
12674   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12675   (exit $ac_status); } >/dev/null && {
12676          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
12677          test ! -s conftest.err
12678        }; then
12679   ac_header_preproc=yes
12680 else
12681   $as_echo "$as_me: failed program was:" >&5
12682 sed 's/^/| /' conftest.$ac_ext >&5
12683
12684   ac_header_preproc=no
12685 fi
12686
12687 rm -f conftest.err conftest.$ac_ext
12688 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
12689 $as_echo "$ac_header_preproc" >&6; }
12690
12691 # So?  What about this header?
12692 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
12693   yes:no: )
12694     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
12695 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
12696     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
12697 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
12698     ac_header_preproc=yes
12699     ;;
12700   no:yes:* )
12701     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
12702 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
12703     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
12704 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
12705     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
12706 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
12707     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
12708 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
12709     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
12710 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
12711     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
12712 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
12713
12714     ;;
12715 esac
12716 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
12717 $as_echo_n "checking for $bdb_header... " >&6; }
12718 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
12719   $as_echo_n "(cached) " >&6
12720 else
12721   eval "$as_ac_Header=\$ac_header_preproc"
12722 fi
12723 ac_res=`eval 'as_val=${'$as_ac_Header'}
12724                  $as_echo "$as_val"'`
12725                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
12726 $as_echo "$ac_res" >&6; }
12727
12728 fi
12729 as_val=`eval 'as_val=${'$as_ac_Header'}
12730                  $as_echo "$as_val"'`
12731    if test "x$as_val" = x""yes; then
12732
12733           if test ""4"" = "3" -o ""4"" = "4"; then
12734             # We generate a separate cache variable for each prefix and libname
12735             # we search under.  That way, we avoid caching information that
12736             # changes if the user runs `configure' with a different set of
12737             # switches.
12738
12739             cache_id="`echo apu_cv_check_berkeley_db_"4"_"3"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
12740                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
12741
12742
12743             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
12744 $as_echo_n "checking for -l$bdb_libname... " >&6; }
12745                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
12746   $as_echo_n "(cached) " >&6
12747 else
12748
12749
12750     apu_try_berkeley_db_save_libs="$LIBS"
12751
12752     apu_check_berkeley_db_major="4"
12753     apu_check_berkeley_db_minor="3"
12754     apu_check_berkeley_db_patch="-1"
12755     apu_try_berkeley_db_header=$bdb_header
12756     apu_try_berkeley_db_libname=$bdb_libname
12757
12758     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
12759     if test "$cross_compiling" = yes; then
12760   apu_try_berkeley_db=yes
12761
12762 else
12763   cat >conftest.$ac_ext <<_ACEOF
12764 /* confdefs.h.  */
12765 _ACEOF
12766 cat confdefs.h >>conftest.$ac_ext
12767 cat >>conftest.$ac_ext <<_ACEOF
12768 /* end confdefs.h.  */
12769
12770 #include <stdlib.h>
12771 #include <stdio.h>
12772 #include <$apu_try_berkeley_db_header>
12773 main ()
12774 {
12775   int major, minor, patch;
12776
12777   db_version(&major, &minor, &patch);
12778
12779   /* Sanity check: ensure that db.h constants actually match the db library */
12780   if (major != DB_VERSION_MAJOR
12781       || minor != DB_VERSION_MINOR
12782       || patch != DB_VERSION_PATCH)
12783     exit (1);
12784
12785   /* Run-time check:  ensure the library claims to be the correct version. */
12786
12787   if ($apu_check_berkeley_db_major != -1) {
12788     if (major < $apu_check_berkeley_db_major)
12789       exit (1);
12790     if (major > $apu_check_berkeley_db_major)
12791       exit (0);
12792   }
12793
12794   if ($apu_check_berkeley_db_minor != -1) {
12795     if (minor < $apu_check_berkeley_db_minor)
12796       exit (1);
12797     if (minor > $apu_check_berkeley_db_minor)
12798       exit (0);
12799   }
12800
12801   if ($apu_check_berkeley_db_patch == -1
12802       || patch >= $apu_check_berkeley_db_patch)
12803     exit (0);
12804   else
12805     exit (1);
12806 }
12807
12808 _ACEOF
12809 rm -f conftest$ac_exeext
12810 if { (ac_try="$ac_link"
12811 case "(($ac_try" in
12812   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12813   *) ac_try_echo=$ac_try;;
12814 esac
12815 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12816 $as_echo "$ac_try_echo") >&5
12817   (eval "$ac_link") 2>&5
12818   ac_status=$?
12819   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12820   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12821   { (case "(($ac_try" in
12822   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12823   *) ac_try_echo=$ac_try;;
12824 esac
12825 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12826 $as_echo "$ac_try_echo") >&5
12827   (eval "$ac_try") 2>&5
12828   ac_status=$?
12829   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12830   (exit $ac_status); }; }; then
12831   apu_try_berkeley_db=yes
12832 else
12833   $as_echo "$as_me: program exited with status $ac_status" >&5
12834 $as_echo "$as_me: failed program was:" >&5
12835 sed 's/^/| /' conftest.$ac_ext >&5
12836
12837 ( exit $ac_status )
12838 apu_try_berkeley_db=no
12839 fi
12840 rm -rf conftest.dSYM
12841 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12842 fi
12843
12844
12845
12846     LIBS="$apu_try_berkeley_db_save_libs"
12847
12848
12849                 eval "$cache_id=$apu_try_berkeley_db"
12850
12851 fi
12852
12853             result="`eval echo '$'$cache_id`"
12854             { $as_echo "$as_me:$LINENO: result: $result" >&5
12855 $as_echo "$result" >&6; }
12856           elif test ""4"" = "1"; then
12857             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
12858 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
12859 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
12860 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
12861   $as_echo_n "(cached) " >&6
12862 else
12863   ac_check_lib_save_LIBS=$LIBS
12864 LIBS="-l$bdb_libname  $LIBS"
12865 cat >conftest.$ac_ext <<_ACEOF
12866 /* confdefs.h.  */
12867 _ACEOF
12868 cat confdefs.h >>conftest.$ac_ext
12869 cat >>conftest.$ac_ext <<_ACEOF
12870 /* end confdefs.h.  */
12871
12872 /* Override any GCC internal prototype to avoid an error.
12873    Use char because int might match the return type of a GCC
12874    builtin and then its argument prototype would still apply.  */
12875 #ifdef __cplusplus
12876 extern "C"
12877 #endif
12878 char dbopen ();
12879 int
12880 main ()
12881 {
12882 return dbopen ();
12883   ;
12884   return 0;
12885 }
12886 _ACEOF
12887 rm -f conftest.$ac_objext conftest$ac_exeext
12888 if { (ac_try="$ac_link"
12889 case "(($ac_try" in
12890   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12891   *) ac_try_echo=$ac_try;;
12892 esac
12893 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12894 $as_echo "$ac_try_echo") >&5
12895   (eval "$ac_link") 2>conftest.er1
12896   ac_status=$?
12897   grep -v '^ *+' conftest.er1 >conftest.err
12898   rm -f conftest.er1
12899   cat conftest.err >&5
12900   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12901   (exit $ac_status); } && {
12902          test -z "$ac_c_werror_flag" ||
12903          test ! -s conftest.err
12904        } && test -s conftest$ac_exeext && {
12905          test "$cross_compiling" = yes ||
12906          $as_test_x conftest$ac_exeext
12907        }; then
12908   eval "$as_ac_Lib=yes"
12909 else
12910   $as_echo "$as_me: failed program was:" >&5
12911 sed 's/^/| /' conftest.$ac_ext >&5
12912
12913         eval "$as_ac_Lib=no"
12914 fi
12915
12916 rm -rf conftest.dSYM
12917 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12918       conftest$ac_exeext conftest.$ac_ext
12919 LIBS=$ac_check_lib_save_LIBS
12920 fi
12921 ac_res=`eval 'as_val=${'$as_ac_Lib'}
12922                  $as_echo "$as_val"'`
12923                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
12924 $as_echo "$ac_res" >&6; }
12925 as_val=`eval 'as_val=${'$as_ac_Lib'}
12926                  $as_echo "$as_val"'`
12927    if test "x$as_val" = x""yes; then
12928   result=yes
12929 else
12930   result=no
12931
12932 fi
12933
12934           elif test ""4"" = "2"; then
12935             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
12936 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
12937 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
12938 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
12939   $as_echo_n "(cached) " >&6
12940 else
12941   ac_check_lib_save_LIBS=$LIBS
12942 LIBS="-l$bdb_libname  $LIBS"
12943 cat >conftest.$ac_ext <<_ACEOF
12944 /* confdefs.h.  */
12945 _ACEOF
12946 cat confdefs.h >>conftest.$ac_ext
12947 cat >>conftest.$ac_ext <<_ACEOF
12948 /* end confdefs.h.  */
12949
12950 /* Override any GCC internal prototype to avoid an error.
12951    Use char because int might match the return type of a GCC
12952    builtin and then its argument prototype would still apply.  */
12953 #ifdef __cplusplus
12954 extern "C"
12955 #endif
12956 char db_open ();
12957 int
12958 main ()
12959 {
12960 return db_open ();
12961   ;
12962   return 0;
12963 }
12964 _ACEOF
12965 rm -f conftest.$ac_objext conftest$ac_exeext
12966 if { (ac_try="$ac_link"
12967 case "(($ac_try" in
12968   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12969   *) ac_try_echo=$ac_try;;
12970 esac
12971 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12972 $as_echo "$ac_try_echo") >&5
12973   (eval "$ac_link") 2>conftest.er1
12974   ac_status=$?
12975   grep -v '^ *+' conftest.er1 >conftest.err
12976   rm -f conftest.er1
12977   cat conftest.err >&5
12978   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12979   (exit $ac_status); } && {
12980          test -z "$ac_c_werror_flag" ||
12981          test ! -s conftest.err
12982        } && test -s conftest$ac_exeext && {
12983          test "$cross_compiling" = yes ||
12984          $as_test_x conftest$ac_exeext
12985        }; then
12986   eval "$as_ac_Lib=yes"
12987 else
12988   $as_echo "$as_me: failed program was:" >&5
12989 sed 's/^/| /' conftest.$ac_ext >&5
12990
12991         eval "$as_ac_Lib=no"
12992 fi
12993
12994 rm -rf conftest.dSYM
12995 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12996       conftest$ac_exeext conftest.$ac_ext
12997 LIBS=$ac_check_lib_save_LIBS
12998 fi
12999 ac_res=`eval 'as_val=${'$as_ac_Lib'}
13000                  $as_echo "$as_val"'`
13001                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
13002 $as_echo "$ac_res" >&6; }
13003 as_val=`eval 'as_val=${'$as_ac_Lib'}
13004                  $as_echo "$as_val"'`
13005    if test "x$as_val" = x""yes; then
13006   result=yes
13007 else
13008   result=no
13009
13010 fi
13011
13012           fi
13013
13014 else
13015   result="no"
13016 fi
13017
13018
13019
13020         # If we found it, no need to search any more.
13021         if test "$result" = "yes"; then
13022           found="$bdb_place"
13023           break
13024         fi
13025       done
13026       test "$found" != "not" && break
13027     done
13028     test "$found" != "not" && break
13029   done
13030
13031   # Restore the original values of the flags we tweak.
13032   LDFLAGS="$apu_check_lib_save_ldflags"
13033   CPPFLAGS="$apu_check_lib_save_cppflags"
13034
13035   case "$found" in
13036   "not")
13037     apu_have_db=0
13038     ;;
13039   "std")
13040     apu_db_header=$bdb_header
13041     apu_db_lib=$bdb_libname
13042     apu_have_db=1
13043     ;;
13044   *":"*)
13045     header="`echo $found | sed -e 's/:.*$//'`"
13046     lib="`echo $found | sed -e 's/^.*://'`"
13047
13048
13049   if test "x$APRUTIL_INCLUDES" = "x"; then
13050     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
13051     APRUTIL_INCLUDES="-I$header"
13052   else
13053     apr_addto_bugger="-I$header"
13054     for i in $apr_addto_bugger; do
13055       apr_addto_duplicate="0"
13056       for j in $APRUTIL_INCLUDES; do
13057         if test "x$i" = "x$j"; then
13058           apr_addto_duplicate="1"
13059           break
13060         fi
13061       done
13062       if test $apr_addto_duplicate = "0"; then
13063         echo "  adding \"$i\" to APRUTIL_INCLUDES"
13064         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
13065       fi
13066     done
13067   fi
13068
13069
13070   if test "x$APRUTIL_LDFLAGS" = "x"; then
13071     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
13072     APRUTIL_LDFLAGS="-L$lib"
13073   else
13074     apr_addto_bugger="-L$lib"
13075     for i in $apr_addto_bugger; do
13076       apr_addto_duplicate="0"
13077       for j in $APRUTIL_LDFLAGS; do
13078         if test "x$i" = "x$j"; then
13079           apr_addto_duplicate="1"
13080           break
13081         fi
13082       done
13083       if test $apr_addto_duplicate = "0"; then
13084         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
13085         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
13086       fi
13087     done
13088   fi
13089
13090     apu_db_header=$bdb_header
13091     apu_db_lib=$bdb_libname
13092     apu_have_db=1
13093     ;;
13094   *)
13095
13096   if test "x$APRUTIL_INCLUDES" = "x"; then
13097     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
13098     APRUTIL_INCLUDES="-I$found/include"
13099   else
13100     apr_addto_bugger="-I$found/include"
13101     for i in $apr_addto_bugger; do
13102       apr_addto_duplicate="0"
13103       for j in $APRUTIL_INCLUDES; do
13104         if test "x$i" = "x$j"; then
13105           apr_addto_duplicate="1"
13106           break
13107         fi
13108       done
13109       if test $apr_addto_duplicate = "0"; then
13110         echo "  adding \"$i\" to APRUTIL_INCLUDES"
13111         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
13112       fi
13113     done
13114   fi
13115
13116
13117   if test "x$APRUTIL_LDFLAGS" = "x"; then
13118     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
13119     APRUTIL_LDFLAGS="-L$found/lib"
13120   else
13121     apr_addto_bugger="-L$found/lib"
13122     for i in $apr_addto_bugger; do
13123       apr_addto_duplicate="0"
13124       for j in $APRUTIL_LDFLAGS; do
13125         if test "x$i" = "x$j"; then
13126           apr_addto_duplicate="1"
13127           break
13128         fi
13129       done
13130       if test $apr_addto_duplicate = "0"; then
13131         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
13132         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
13133       fi
13134     done
13135   fi
13136
13137     apu_db_header=$bdb_header
13138     apu_db_lib=$bdb_libname
13139     apu_have_db=1
13140     ;;
13141   esac
13142
13143   if test "$apu_have_db" = "1"; then
13144     apu_db_version=4
13145   fi
13146
13147             if test "$apu_db_version" != "4"; then
13148
13149   places="$all_places"
13150   if test -z "$places"; then
13151     places="std /usr/local /usr/local/BerkeleyDB.4.2 /boot/home/config"
13152   fi
13153
13154   bdb_version="4"
13155   if test ""2"" != "-1"; then
13156     bdb_version="$bdb_version."2""
13157     if test ""-1"" != "-1"; then
13158       bdb_version="$bdb_version."-1""
13159     fi
13160   fi
13161   bdb_places="$places"
13162   bdb_default_search_headers="db42/db.h db4/db.h db.h"
13163   bdb_default_search_lib_names="db-4.2 db42 db4 db"
13164
13165
13166   apu_have_db=0
13167
13168   # Save the original values of the flags we tweak.
13169   apu_check_lib_save_libs="$LIBS"
13170   apu_check_lib_save_ldflags="$LDFLAGS"
13171   apu_check_lib_save_cppflags="$CPPFLAGS"
13172
13173   # The variable `found' is the prefix under which we've found
13174   # Berkeley DB, or `not' if we haven't found it anywhere yet.
13175   found=not
13176   for bdb_place in $bdb_places; do
13177
13178     LDFLAGS="$apu_check_lib_save_ldflags"
13179     CPPFLAGS="$apu_check_lib_save_cppflags"
13180     case "$bdb_place" in
13181       "std" )
13182         description="the standard places"
13183       ;;
13184       *":"* )
13185         header="`echo $bdb_place | sed -e 's/:.*$//'`"
13186         lib="`echo $bdb_place | sed -e 's/^.*://'`"
13187         CPPFLAGS="$CPPFLAGS -I$header"
13188         LDFLAGS="$LDFLAGS -L$lib"
13189         description="$header and $lib"
13190       ;;
13191       * )
13192         if test -d $bdb_place; then
13193           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
13194           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
13195         else
13196           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
13197 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
13198           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
13199 $as_echo "directory not found" >&6; }
13200           continue
13201         fi
13202         description="$bdb_place"
13203       ;;
13204     esac
13205
13206     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
13207     # trick to display a message instead.
13208     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
13209 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
13210     { $as_echo "$as_me:$LINENO: result: " >&5
13211 $as_echo "" >&6; }
13212
13213     for bdb_libname in $bdb_default_search_lib_names; do
13214       for bdb_header in $bdb_default_search_headers; do
13215         # Clear the header cache variable for each location
13216
13217         cache_id="`echo ac_cv_header_${bdb_header} \
13218                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
13219
13220         unset $cache_id
13221         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
13222 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13223   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
13224 $as_echo_n "checking for $bdb_header... " >&6; }
13225 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13226   $as_echo_n "(cached) " >&6
13227 fi
13228 ac_res=`eval 'as_val=${'$as_ac_Header'}
13229                  $as_echo "$as_val"'`
13230                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
13231 $as_echo "$ac_res" >&6; }
13232 else
13233   # Is the header compilable?
13234 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
13235 $as_echo_n "checking $bdb_header usability... " >&6; }
13236 cat >conftest.$ac_ext <<_ACEOF
13237 /* confdefs.h.  */
13238 _ACEOF
13239 cat confdefs.h >>conftest.$ac_ext
13240 cat >>conftest.$ac_ext <<_ACEOF
13241 /* end confdefs.h.  */
13242 $ac_includes_default
13243 #include <$bdb_header>
13244 _ACEOF
13245 rm -f conftest.$ac_objext
13246 if { (ac_try="$ac_compile"
13247 case "(($ac_try" in
13248   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13249   *) ac_try_echo=$ac_try;;
13250 esac
13251 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13252 $as_echo "$ac_try_echo") >&5
13253   (eval "$ac_compile") 2>conftest.er1
13254   ac_status=$?
13255   grep -v '^ *+' conftest.er1 >conftest.err
13256   rm -f conftest.er1
13257   cat conftest.err >&5
13258   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13259   (exit $ac_status); } && {
13260          test -z "$ac_c_werror_flag" ||
13261          test ! -s conftest.err
13262        } && test -s conftest.$ac_objext; then
13263   ac_header_compiler=yes
13264 else
13265   $as_echo "$as_me: failed program was:" >&5
13266 sed 's/^/| /' conftest.$ac_ext >&5
13267
13268         ac_header_compiler=no
13269 fi
13270
13271 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13272 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
13273 $as_echo "$ac_header_compiler" >&6; }
13274
13275 # Is the header present?
13276 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
13277 $as_echo_n "checking $bdb_header presence... " >&6; }
13278 cat >conftest.$ac_ext <<_ACEOF
13279 /* confdefs.h.  */
13280 _ACEOF
13281 cat confdefs.h >>conftest.$ac_ext
13282 cat >>conftest.$ac_ext <<_ACEOF
13283 /* end confdefs.h.  */
13284 #include <$bdb_header>
13285 _ACEOF
13286 if { (ac_try="$ac_cpp conftest.$ac_ext"
13287 case "(($ac_try" in
13288   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13289   *) ac_try_echo=$ac_try;;
13290 esac
13291 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13292 $as_echo "$ac_try_echo") >&5
13293   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
13294   ac_status=$?
13295   grep -v '^ *+' conftest.er1 >conftest.err
13296   rm -f conftest.er1
13297   cat conftest.err >&5
13298   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13299   (exit $ac_status); } >/dev/null && {
13300          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
13301          test ! -s conftest.err
13302        }; then
13303   ac_header_preproc=yes
13304 else
13305   $as_echo "$as_me: failed program was:" >&5
13306 sed 's/^/| /' conftest.$ac_ext >&5
13307
13308   ac_header_preproc=no
13309 fi
13310
13311 rm -f conftest.err conftest.$ac_ext
13312 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
13313 $as_echo "$ac_header_preproc" >&6; }
13314
13315 # So?  What about this header?
13316 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
13317   yes:no: )
13318     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
13319 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
13320     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
13321 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
13322     ac_header_preproc=yes
13323     ;;
13324   no:yes:* )
13325     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
13326 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
13327     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
13328 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
13329     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
13330 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
13331     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
13332 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
13333     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
13334 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
13335     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
13336 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
13337
13338     ;;
13339 esac
13340 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
13341 $as_echo_n "checking for $bdb_header... " >&6; }
13342 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13343   $as_echo_n "(cached) " >&6
13344 else
13345   eval "$as_ac_Header=\$ac_header_preproc"
13346 fi
13347 ac_res=`eval 'as_val=${'$as_ac_Header'}
13348                  $as_echo "$as_val"'`
13349                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
13350 $as_echo "$ac_res" >&6; }
13351
13352 fi
13353 as_val=`eval 'as_val=${'$as_ac_Header'}
13354                  $as_echo "$as_val"'`
13355    if test "x$as_val" = x""yes; then
13356
13357           if test ""4"" = "3" -o ""4"" = "4"; then
13358             # We generate a separate cache variable for each prefix and libname
13359             # we search under.  That way, we avoid caching information that
13360             # changes if the user runs `configure' with a different set of
13361             # switches.
13362
13363             cache_id="`echo apu_cv_check_berkeley_db_"4"_"2"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
13364                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
13365
13366
13367             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
13368 $as_echo_n "checking for -l$bdb_libname... " >&6; }
13369                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
13370   $as_echo_n "(cached) " >&6
13371 else
13372
13373
13374     apu_try_berkeley_db_save_libs="$LIBS"
13375
13376     apu_check_berkeley_db_major="4"
13377     apu_check_berkeley_db_minor="2"
13378     apu_check_berkeley_db_patch="-1"
13379     apu_try_berkeley_db_header=$bdb_header
13380     apu_try_berkeley_db_libname=$bdb_libname
13381
13382     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
13383     if test "$cross_compiling" = yes; then
13384   apu_try_berkeley_db=yes
13385
13386 else
13387   cat >conftest.$ac_ext <<_ACEOF
13388 /* confdefs.h.  */
13389 _ACEOF
13390 cat confdefs.h >>conftest.$ac_ext
13391 cat >>conftest.$ac_ext <<_ACEOF
13392 /* end confdefs.h.  */
13393
13394 #include <stdlib.h>
13395 #include <stdio.h>
13396 #include <$apu_try_berkeley_db_header>
13397 main ()
13398 {
13399   int major, minor, patch;
13400
13401   db_version(&major, &minor, &patch);
13402
13403   /* Sanity check: ensure that db.h constants actually match the db library */
13404   if (major != DB_VERSION_MAJOR
13405       || minor != DB_VERSION_MINOR
13406       || patch != DB_VERSION_PATCH)
13407     exit (1);
13408
13409   /* Run-time check:  ensure the library claims to be the correct version. */
13410
13411   if ($apu_check_berkeley_db_major != -1) {
13412     if (major < $apu_check_berkeley_db_major)
13413       exit (1);
13414     if (major > $apu_check_berkeley_db_major)
13415       exit (0);
13416   }
13417
13418   if ($apu_check_berkeley_db_minor != -1) {
13419     if (minor < $apu_check_berkeley_db_minor)
13420       exit (1);
13421     if (minor > $apu_check_berkeley_db_minor)
13422       exit (0);
13423   }
13424
13425   if ($apu_check_berkeley_db_patch == -1
13426       || patch >= $apu_check_berkeley_db_patch)
13427     exit (0);
13428   else
13429     exit (1);
13430 }
13431
13432 _ACEOF
13433 rm -f conftest$ac_exeext
13434 if { (ac_try="$ac_link"
13435 case "(($ac_try" in
13436   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13437   *) ac_try_echo=$ac_try;;
13438 esac
13439 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13440 $as_echo "$ac_try_echo") >&5
13441   (eval "$ac_link") 2>&5
13442   ac_status=$?
13443   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13444   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13445   { (case "(($ac_try" in
13446   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13447   *) ac_try_echo=$ac_try;;
13448 esac
13449 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13450 $as_echo "$ac_try_echo") >&5
13451   (eval "$ac_try") 2>&5
13452   ac_status=$?
13453   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13454   (exit $ac_status); }; }; then
13455   apu_try_berkeley_db=yes
13456 else
13457   $as_echo "$as_me: program exited with status $ac_status" >&5
13458 $as_echo "$as_me: failed program was:" >&5
13459 sed 's/^/| /' conftest.$ac_ext >&5
13460
13461 ( exit $ac_status )
13462 apu_try_berkeley_db=no
13463 fi
13464 rm -rf conftest.dSYM
13465 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13466 fi
13467
13468
13469
13470     LIBS="$apu_try_berkeley_db_save_libs"
13471
13472
13473                 eval "$cache_id=$apu_try_berkeley_db"
13474
13475 fi
13476
13477             result="`eval echo '$'$cache_id`"
13478             { $as_echo "$as_me:$LINENO: result: $result" >&5
13479 $as_echo "$result" >&6; }
13480           elif test ""4"" = "1"; then
13481             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
13482 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
13483 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
13484 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
13485   $as_echo_n "(cached) " >&6
13486 else
13487   ac_check_lib_save_LIBS=$LIBS
13488 LIBS="-l$bdb_libname  $LIBS"
13489 cat >conftest.$ac_ext <<_ACEOF
13490 /* confdefs.h.  */
13491 _ACEOF
13492 cat confdefs.h >>conftest.$ac_ext
13493 cat >>conftest.$ac_ext <<_ACEOF
13494 /* end confdefs.h.  */
13495
13496 /* Override any GCC internal prototype to avoid an error.
13497    Use char because int might match the return type of a GCC
13498    builtin and then its argument prototype would still apply.  */
13499 #ifdef __cplusplus
13500 extern "C"
13501 #endif
13502 char dbopen ();
13503 int
13504 main ()
13505 {
13506 return dbopen ();
13507   ;
13508   return 0;
13509 }
13510 _ACEOF
13511 rm -f conftest.$ac_objext conftest$ac_exeext
13512 if { (ac_try="$ac_link"
13513 case "(($ac_try" in
13514   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13515   *) ac_try_echo=$ac_try;;
13516 esac
13517 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13518 $as_echo "$ac_try_echo") >&5
13519   (eval "$ac_link") 2>conftest.er1
13520   ac_status=$?
13521   grep -v '^ *+' conftest.er1 >conftest.err
13522   rm -f conftest.er1
13523   cat conftest.err >&5
13524   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13525   (exit $ac_status); } && {
13526          test -z "$ac_c_werror_flag" ||
13527          test ! -s conftest.err
13528        } && test -s conftest$ac_exeext && {
13529          test "$cross_compiling" = yes ||
13530          $as_test_x conftest$ac_exeext
13531        }; then
13532   eval "$as_ac_Lib=yes"
13533 else
13534   $as_echo "$as_me: failed program was:" >&5
13535 sed 's/^/| /' conftest.$ac_ext >&5
13536
13537         eval "$as_ac_Lib=no"
13538 fi
13539
13540 rm -rf conftest.dSYM
13541 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
13542       conftest$ac_exeext conftest.$ac_ext
13543 LIBS=$ac_check_lib_save_LIBS
13544 fi
13545 ac_res=`eval 'as_val=${'$as_ac_Lib'}
13546                  $as_echo "$as_val"'`
13547                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
13548 $as_echo "$ac_res" >&6; }
13549 as_val=`eval 'as_val=${'$as_ac_Lib'}
13550                  $as_echo "$as_val"'`
13551    if test "x$as_val" = x""yes; then
13552   result=yes
13553 else
13554   result=no
13555
13556 fi
13557
13558           elif test ""4"" = "2"; then
13559             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
13560 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
13561 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
13562 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
13563   $as_echo_n "(cached) " >&6
13564 else
13565   ac_check_lib_save_LIBS=$LIBS
13566 LIBS="-l$bdb_libname  $LIBS"
13567 cat >conftest.$ac_ext <<_ACEOF
13568 /* confdefs.h.  */
13569 _ACEOF
13570 cat confdefs.h >>conftest.$ac_ext
13571 cat >>conftest.$ac_ext <<_ACEOF
13572 /* end confdefs.h.  */
13573
13574 /* Override any GCC internal prototype to avoid an error.
13575    Use char because int might match the return type of a GCC
13576    builtin and then its argument prototype would still apply.  */
13577 #ifdef __cplusplus
13578 extern "C"
13579 #endif
13580 char db_open ();
13581 int
13582 main ()
13583 {
13584 return db_open ();
13585   ;
13586   return 0;
13587 }
13588 _ACEOF
13589 rm -f conftest.$ac_objext conftest$ac_exeext
13590 if { (ac_try="$ac_link"
13591 case "(($ac_try" in
13592   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13593   *) ac_try_echo=$ac_try;;
13594 esac
13595 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13596 $as_echo "$ac_try_echo") >&5
13597   (eval "$ac_link") 2>conftest.er1
13598   ac_status=$?
13599   grep -v '^ *+' conftest.er1 >conftest.err
13600   rm -f conftest.er1
13601   cat conftest.err >&5
13602   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13603   (exit $ac_status); } && {
13604          test -z "$ac_c_werror_flag" ||
13605          test ! -s conftest.err
13606        } && test -s conftest$ac_exeext && {
13607          test "$cross_compiling" = yes ||
13608          $as_test_x conftest$ac_exeext
13609        }; then
13610   eval "$as_ac_Lib=yes"
13611 else
13612   $as_echo "$as_me: failed program was:" >&5
13613 sed 's/^/| /' conftest.$ac_ext >&5
13614
13615         eval "$as_ac_Lib=no"
13616 fi
13617
13618 rm -rf conftest.dSYM
13619 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
13620       conftest$ac_exeext conftest.$ac_ext
13621 LIBS=$ac_check_lib_save_LIBS
13622 fi
13623 ac_res=`eval 'as_val=${'$as_ac_Lib'}
13624                  $as_echo "$as_val"'`
13625                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
13626 $as_echo "$ac_res" >&6; }
13627 as_val=`eval 'as_val=${'$as_ac_Lib'}
13628                  $as_echo "$as_val"'`
13629    if test "x$as_val" = x""yes; then
13630   result=yes
13631 else
13632   result=no
13633
13634 fi
13635
13636           fi
13637
13638 else
13639   result="no"
13640 fi
13641
13642
13643
13644         # If we found it, no need to search any more.
13645         if test "$result" = "yes"; then
13646           found="$bdb_place"
13647           break
13648         fi
13649       done
13650       test "$found" != "not" && break
13651     done
13652     test "$found" != "not" && break
13653   done
13654
13655   # Restore the original values of the flags we tweak.
13656   LDFLAGS="$apu_check_lib_save_ldflags"
13657   CPPFLAGS="$apu_check_lib_save_cppflags"
13658
13659   case "$found" in
13660   "not")
13661     apu_have_db=0
13662     ;;
13663   "std")
13664     apu_db_header=$bdb_header
13665     apu_db_lib=$bdb_libname
13666     apu_have_db=1
13667     ;;
13668   *":"*)
13669     header="`echo $found | sed -e 's/:.*$//'`"
13670     lib="`echo $found | sed -e 's/^.*://'`"
13671
13672
13673   if test "x$APRUTIL_INCLUDES" = "x"; then
13674     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
13675     APRUTIL_INCLUDES="-I$header"
13676   else
13677     apr_addto_bugger="-I$header"
13678     for i in $apr_addto_bugger; do
13679       apr_addto_duplicate="0"
13680       for j in $APRUTIL_INCLUDES; do
13681         if test "x$i" = "x$j"; then
13682           apr_addto_duplicate="1"
13683           break
13684         fi
13685       done
13686       if test $apr_addto_duplicate = "0"; then
13687         echo "  adding \"$i\" to APRUTIL_INCLUDES"
13688         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
13689       fi
13690     done
13691   fi
13692
13693
13694   if test "x$APRUTIL_LDFLAGS" = "x"; then
13695     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
13696     APRUTIL_LDFLAGS="-L$lib"
13697   else
13698     apr_addto_bugger="-L$lib"
13699     for i in $apr_addto_bugger; do
13700       apr_addto_duplicate="0"
13701       for j in $APRUTIL_LDFLAGS; do
13702         if test "x$i" = "x$j"; then
13703           apr_addto_duplicate="1"
13704           break
13705         fi
13706       done
13707       if test $apr_addto_duplicate = "0"; then
13708         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
13709         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
13710       fi
13711     done
13712   fi
13713
13714     apu_db_header=$bdb_header
13715     apu_db_lib=$bdb_libname
13716     apu_have_db=1
13717     ;;
13718   *)
13719
13720   if test "x$APRUTIL_INCLUDES" = "x"; then
13721     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
13722     APRUTIL_INCLUDES="-I$found/include"
13723   else
13724     apr_addto_bugger="-I$found/include"
13725     for i in $apr_addto_bugger; do
13726       apr_addto_duplicate="0"
13727       for j in $APRUTIL_INCLUDES; do
13728         if test "x$i" = "x$j"; then
13729           apr_addto_duplicate="1"
13730           break
13731         fi
13732       done
13733       if test $apr_addto_duplicate = "0"; then
13734         echo "  adding \"$i\" to APRUTIL_INCLUDES"
13735         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
13736       fi
13737     done
13738   fi
13739
13740
13741   if test "x$APRUTIL_LDFLAGS" = "x"; then
13742     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
13743     APRUTIL_LDFLAGS="-L$found/lib"
13744   else
13745     apr_addto_bugger="-L$found/lib"
13746     for i in $apr_addto_bugger; do
13747       apr_addto_duplicate="0"
13748       for j in $APRUTIL_LDFLAGS; do
13749         if test "x$i" = "x$j"; then
13750           apr_addto_duplicate="1"
13751           break
13752         fi
13753       done
13754       if test $apr_addto_duplicate = "0"; then
13755         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
13756         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
13757       fi
13758     done
13759   fi
13760
13761     apu_db_header=$bdb_header
13762     apu_db_lib=$bdb_libname
13763     apu_have_db=1
13764     ;;
13765   esac
13766
13767   if test "$apu_have_db" = "1"; then
13768     apu_db_version=4
13769   fi
13770
13771               if test "$apu_db_version" != "4"; then
13772
13773   places="$all_places"
13774   if test -z "$places"; then
13775     places="std /usr/local /usr/local/BerkeleyDB.4.1 /boot/home/config"
13776   fi
13777
13778   bdb_version="4"
13779   if test ""1"" != "-1"; then
13780     bdb_version="$bdb_version."1""
13781     if test ""-1"" != "-1"; then
13782       bdb_version="$bdb_version."-1""
13783     fi
13784   fi
13785   bdb_places="$places"
13786   bdb_default_search_headers="db41/db.h db4/db.h db.h"
13787   bdb_default_search_lib_names="db-4.1 db41 db4 db"
13788
13789
13790   apu_have_db=0
13791
13792   # Save the original values of the flags we tweak.
13793   apu_check_lib_save_libs="$LIBS"
13794   apu_check_lib_save_ldflags="$LDFLAGS"
13795   apu_check_lib_save_cppflags="$CPPFLAGS"
13796
13797   # The variable `found' is the prefix under which we've found
13798   # Berkeley DB, or `not' if we haven't found it anywhere yet.
13799   found=not
13800   for bdb_place in $bdb_places; do
13801
13802     LDFLAGS="$apu_check_lib_save_ldflags"
13803     CPPFLAGS="$apu_check_lib_save_cppflags"
13804     case "$bdb_place" in
13805       "std" )
13806         description="the standard places"
13807       ;;
13808       *":"* )
13809         header="`echo $bdb_place | sed -e 's/:.*$//'`"
13810         lib="`echo $bdb_place | sed -e 's/^.*://'`"
13811         CPPFLAGS="$CPPFLAGS -I$header"
13812         LDFLAGS="$LDFLAGS -L$lib"
13813         description="$header and $lib"
13814       ;;
13815       * )
13816         if test -d $bdb_place; then
13817           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
13818           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
13819         else
13820           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
13821 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
13822           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
13823 $as_echo "directory not found" >&6; }
13824           continue
13825         fi
13826         description="$bdb_place"
13827       ;;
13828     esac
13829
13830     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
13831     # trick to display a message instead.
13832     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
13833 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
13834     { $as_echo "$as_me:$LINENO: result: " >&5
13835 $as_echo "" >&6; }
13836
13837     for bdb_libname in $bdb_default_search_lib_names; do
13838       for bdb_header in $bdb_default_search_headers; do
13839         # Clear the header cache variable for each location
13840
13841         cache_id="`echo ac_cv_header_${bdb_header} \
13842                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
13843
13844         unset $cache_id
13845         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
13846 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13847   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
13848 $as_echo_n "checking for $bdb_header... " >&6; }
13849 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13850   $as_echo_n "(cached) " >&6
13851 fi
13852 ac_res=`eval 'as_val=${'$as_ac_Header'}
13853                  $as_echo "$as_val"'`
13854                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
13855 $as_echo "$ac_res" >&6; }
13856 else
13857   # Is the header compilable?
13858 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
13859 $as_echo_n "checking $bdb_header usability... " >&6; }
13860 cat >conftest.$ac_ext <<_ACEOF
13861 /* confdefs.h.  */
13862 _ACEOF
13863 cat confdefs.h >>conftest.$ac_ext
13864 cat >>conftest.$ac_ext <<_ACEOF
13865 /* end confdefs.h.  */
13866 $ac_includes_default
13867 #include <$bdb_header>
13868 _ACEOF
13869 rm -f conftest.$ac_objext
13870 if { (ac_try="$ac_compile"
13871 case "(($ac_try" in
13872   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13873   *) ac_try_echo=$ac_try;;
13874 esac
13875 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13876 $as_echo "$ac_try_echo") >&5
13877   (eval "$ac_compile") 2>conftest.er1
13878   ac_status=$?
13879   grep -v '^ *+' conftest.er1 >conftest.err
13880   rm -f conftest.er1
13881   cat conftest.err >&5
13882   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13883   (exit $ac_status); } && {
13884          test -z "$ac_c_werror_flag" ||
13885          test ! -s conftest.err
13886        } && test -s conftest.$ac_objext; then
13887   ac_header_compiler=yes
13888 else
13889   $as_echo "$as_me: failed program was:" >&5
13890 sed 's/^/| /' conftest.$ac_ext >&5
13891
13892         ac_header_compiler=no
13893 fi
13894
13895 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13896 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
13897 $as_echo "$ac_header_compiler" >&6; }
13898
13899 # Is the header present?
13900 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
13901 $as_echo_n "checking $bdb_header presence... " >&6; }
13902 cat >conftest.$ac_ext <<_ACEOF
13903 /* confdefs.h.  */
13904 _ACEOF
13905 cat confdefs.h >>conftest.$ac_ext
13906 cat >>conftest.$ac_ext <<_ACEOF
13907 /* end confdefs.h.  */
13908 #include <$bdb_header>
13909 _ACEOF
13910 if { (ac_try="$ac_cpp conftest.$ac_ext"
13911 case "(($ac_try" in
13912   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13913   *) ac_try_echo=$ac_try;;
13914 esac
13915 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13916 $as_echo "$ac_try_echo") >&5
13917   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
13918   ac_status=$?
13919   grep -v '^ *+' conftest.er1 >conftest.err
13920   rm -f conftest.er1
13921   cat conftest.err >&5
13922   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13923   (exit $ac_status); } >/dev/null && {
13924          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
13925          test ! -s conftest.err
13926        }; then
13927   ac_header_preproc=yes
13928 else
13929   $as_echo "$as_me: failed program was:" >&5
13930 sed 's/^/| /' conftest.$ac_ext >&5
13931
13932   ac_header_preproc=no
13933 fi
13934
13935 rm -f conftest.err conftest.$ac_ext
13936 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
13937 $as_echo "$ac_header_preproc" >&6; }
13938
13939 # So?  What about this header?
13940 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
13941   yes:no: )
13942     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
13943 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
13944     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
13945 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
13946     ac_header_preproc=yes
13947     ;;
13948   no:yes:* )
13949     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
13950 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
13951     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
13952 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
13953     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
13954 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
13955     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
13956 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
13957     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
13958 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
13959     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
13960 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
13961
13962     ;;
13963 esac
13964 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
13965 $as_echo_n "checking for $bdb_header... " >&6; }
13966 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13967   $as_echo_n "(cached) " >&6
13968 else
13969   eval "$as_ac_Header=\$ac_header_preproc"
13970 fi
13971 ac_res=`eval 'as_val=${'$as_ac_Header'}
13972                  $as_echo "$as_val"'`
13973                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
13974 $as_echo "$ac_res" >&6; }
13975
13976 fi
13977 as_val=`eval 'as_val=${'$as_ac_Header'}
13978                  $as_echo "$as_val"'`
13979    if test "x$as_val" = x""yes; then
13980
13981           if test ""4"" = "3" -o ""4"" = "4"; then
13982             # We generate a separate cache variable for each prefix and libname
13983             # we search under.  That way, we avoid caching information that
13984             # changes if the user runs `configure' with a different set of
13985             # switches.
13986
13987             cache_id="`echo apu_cv_check_berkeley_db_"4"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
13988                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
13989
13990
13991             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
13992 $as_echo_n "checking for -l$bdb_libname... " >&6; }
13993                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
13994   $as_echo_n "(cached) " >&6
13995 else
13996
13997
13998     apu_try_berkeley_db_save_libs="$LIBS"
13999
14000     apu_check_berkeley_db_major="4"
14001     apu_check_berkeley_db_minor="1"
14002     apu_check_berkeley_db_patch="-1"
14003     apu_try_berkeley_db_header=$bdb_header
14004     apu_try_berkeley_db_libname=$bdb_libname
14005
14006     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
14007     if test "$cross_compiling" = yes; then
14008   apu_try_berkeley_db=yes
14009
14010 else
14011   cat >conftest.$ac_ext <<_ACEOF
14012 /* confdefs.h.  */
14013 _ACEOF
14014 cat confdefs.h >>conftest.$ac_ext
14015 cat >>conftest.$ac_ext <<_ACEOF
14016 /* end confdefs.h.  */
14017
14018 #include <stdlib.h>
14019 #include <stdio.h>
14020 #include <$apu_try_berkeley_db_header>
14021 main ()
14022 {
14023   int major, minor, patch;
14024
14025   db_version(&major, &minor, &patch);
14026
14027   /* Sanity check: ensure that db.h constants actually match the db library */
14028   if (major != DB_VERSION_MAJOR
14029       || minor != DB_VERSION_MINOR
14030       || patch != DB_VERSION_PATCH)
14031     exit (1);
14032
14033   /* Run-time check:  ensure the library claims to be the correct version. */
14034
14035   if ($apu_check_berkeley_db_major != -1) {
14036     if (major < $apu_check_berkeley_db_major)
14037       exit (1);
14038     if (major > $apu_check_berkeley_db_major)
14039       exit (0);
14040   }
14041
14042   if ($apu_check_berkeley_db_minor != -1) {
14043     if (minor < $apu_check_berkeley_db_minor)
14044       exit (1);
14045     if (minor > $apu_check_berkeley_db_minor)
14046       exit (0);
14047   }
14048
14049   if ($apu_check_berkeley_db_patch == -1
14050       || patch >= $apu_check_berkeley_db_patch)
14051     exit (0);
14052   else
14053     exit (1);
14054 }
14055
14056 _ACEOF
14057 rm -f conftest$ac_exeext
14058 if { (ac_try="$ac_link"
14059 case "(($ac_try" in
14060   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14061   *) ac_try_echo=$ac_try;;
14062 esac
14063 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14064 $as_echo "$ac_try_echo") >&5
14065   (eval "$ac_link") 2>&5
14066   ac_status=$?
14067   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14068   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14069   { (case "(($ac_try" in
14070   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14071   *) ac_try_echo=$ac_try;;
14072 esac
14073 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14074 $as_echo "$ac_try_echo") >&5
14075   (eval "$ac_try") 2>&5
14076   ac_status=$?
14077   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14078   (exit $ac_status); }; }; then
14079   apu_try_berkeley_db=yes
14080 else
14081   $as_echo "$as_me: program exited with status $ac_status" >&5
14082 $as_echo "$as_me: failed program was:" >&5
14083 sed 's/^/| /' conftest.$ac_ext >&5
14084
14085 ( exit $ac_status )
14086 apu_try_berkeley_db=no
14087 fi
14088 rm -rf conftest.dSYM
14089 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14090 fi
14091
14092
14093
14094     LIBS="$apu_try_berkeley_db_save_libs"
14095
14096
14097                 eval "$cache_id=$apu_try_berkeley_db"
14098
14099 fi
14100
14101             result="`eval echo '$'$cache_id`"
14102             { $as_echo "$as_me:$LINENO: result: $result" >&5
14103 $as_echo "$result" >&6; }
14104           elif test ""4"" = "1"; then
14105             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
14106 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
14107 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
14108 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
14109   $as_echo_n "(cached) " >&6
14110 else
14111   ac_check_lib_save_LIBS=$LIBS
14112 LIBS="-l$bdb_libname  $LIBS"
14113 cat >conftest.$ac_ext <<_ACEOF
14114 /* confdefs.h.  */
14115 _ACEOF
14116 cat confdefs.h >>conftest.$ac_ext
14117 cat >>conftest.$ac_ext <<_ACEOF
14118 /* end confdefs.h.  */
14119
14120 /* Override any GCC internal prototype to avoid an error.
14121    Use char because int might match the return type of a GCC
14122    builtin and then its argument prototype would still apply.  */
14123 #ifdef __cplusplus
14124 extern "C"
14125 #endif
14126 char dbopen ();
14127 int
14128 main ()
14129 {
14130 return dbopen ();
14131   ;
14132   return 0;
14133 }
14134 _ACEOF
14135 rm -f conftest.$ac_objext conftest$ac_exeext
14136 if { (ac_try="$ac_link"
14137 case "(($ac_try" in
14138   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14139   *) ac_try_echo=$ac_try;;
14140 esac
14141 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14142 $as_echo "$ac_try_echo") >&5
14143   (eval "$ac_link") 2>conftest.er1
14144   ac_status=$?
14145   grep -v '^ *+' conftest.er1 >conftest.err
14146   rm -f conftest.er1
14147   cat conftest.err >&5
14148   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14149   (exit $ac_status); } && {
14150          test -z "$ac_c_werror_flag" ||
14151          test ! -s conftest.err
14152        } && test -s conftest$ac_exeext && {
14153          test "$cross_compiling" = yes ||
14154          $as_test_x conftest$ac_exeext
14155        }; then
14156   eval "$as_ac_Lib=yes"
14157 else
14158   $as_echo "$as_me: failed program was:" >&5
14159 sed 's/^/| /' conftest.$ac_ext >&5
14160
14161         eval "$as_ac_Lib=no"
14162 fi
14163
14164 rm -rf conftest.dSYM
14165 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
14166       conftest$ac_exeext conftest.$ac_ext
14167 LIBS=$ac_check_lib_save_LIBS
14168 fi
14169 ac_res=`eval 'as_val=${'$as_ac_Lib'}
14170                  $as_echo "$as_val"'`
14171                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
14172 $as_echo "$ac_res" >&6; }
14173 as_val=`eval 'as_val=${'$as_ac_Lib'}
14174                  $as_echo "$as_val"'`
14175    if test "x$as_val" = x""yes; then
14176   result=yes
14177 else
14178   result=no
14179
14180 fi
14181
14182           elif test ""4"" = "2"; then
14183             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
14184 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
14185 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
14186 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
14187   $as_echo_n "(cached) " >&6
14188 else
14189   ac_check_lib_save_LIBS=$LIBS
14190 LIBS="-l$bdb_libname  $LIBS"
14191 cat >conftest.$ac_ext <<_ACEOF
14192 /* confdefs.h.  */
14193 _ACEOF
14194 cat confdefs.h >>conftest.$ac_ext
14195 cat >>conftest.$ac_ext <<_ACEOF
14196 /* end confdefs.h.  */
14197
14198 /* Override any GCC internal prototype to avoid an error.
14199    Use char because int might match the return type of a GCC
14200    builtin and then its argument prototype would still apply.  */
14201 #ifdef __cplusplus
14202 extern "C"
14203 #endif
14204 char db_open ();
14205 int
14206 main ()
14207 {
14208 return db_open ();
14209   ;
14210   return 0;
14211 }
14212 _ACEOF
14213 rm -f conftest.$ac_objext conftest$ac_exeext
14214 if { (ac_try="$ac_link"
14215 case "(($ac_try" in
14216   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14217   *) ac_try_echo=$ac_try;;
14218 esac
14219 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14220 $as_echo "$ac_try_echo") >&5
14221   (eval "$ac_link") 2>conftest.er1
14222   ac_status=$?
14223   grep -v '^ *+' conftest.er1 >conftest.err
14224   rm -f conftest.er1
14225   cat conftest.err >&5
14226   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14227   (exit $ac_status); } && {
14228          test -z "$ac_c_werror_flag" ||
14229          test ! -s conftest.err
14230        } && test -s conftest$ac_exeext && {
14231          test "$cross_compiling" = yes ||
14232          $as_test_x conftest$ac_exeext
14233        }; then
14234   eval "$as_ac_Lib=yes"
14235 else
14236   $as_echo "$as_me: failed program was:" >&5
14237 sed 's/^/| /' conftest.$ac_ext >&5
14238
14239         eval "$as_ac_Lib=no"
14240 fi
14241
14242 rm -rf conftest.dSYM
14243 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
14244       conftest$ac_exeext conftest.$ac_ext
14245 LIBS=$ac_check_lib_save_LIBS
14246 fi
14247 ac_res=`eval 'as_val=${'$as_ac_Lib'}
14248                  $as_echo "$as_val"'`
14249                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
14250 $as_echo "$ac_res" >&6; }
14251 as_val=`eval 'as_val=${'$as_ac_Lib'}
14252                  $as_echo "$as_val"'`
14253    if test "x$as_val" = x""yes; then
14254   result=yes
14255 else
14256   result=no
14257
14258 fi
14259
14260           fi
14261
14262 else
14263   result="no"
14264 fi
14265
14266
14267
14268         # If we found it, no need to search any more.
14269         if test "$result" = "yes"; then
14270           found="$bdb_place"
14271           break
14272         fi
14273       done
14274       test "$found" != "not" && break
14275     done
14276     test "$found" != "not" && break
14277   done
14278
14279   # Restore the original values of the flags we tweak.
14280   LDFLAGS="$apu_check_lib_save_ldflags"
14281   CPPFLAGS="$apu_check_lib_save_cppflags"
14282
14283   case "$found" in
14284   "not")
14285     apu_have_db=0
14286     ;;
14287   "std")
14288     apu_db_header=$bdb_header
14289     apu_db_lib=$bdb_libname
14290     apu_have_db=1
14291     ;;
14292   *":"*)
14293     header="`echo $found | sed -e 's/:.*$//'`"
14294     lib="`echo $found | sed -e 's/^.*://'`"
14295
14296
14297   if test "x$APRUTIL_INCLUDES" = "x"; then
14298     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
14299     APRUTIL_INCLUDES="-I$header"
14300   else
14301     apr_addto_bugger="-I$header"
14302     for i in $apr_addto_bugger; do
14303       apr_addto_duplicate="0"
14304       for j in $APRUTIL_INCLUDES; do
14305         if test "x$i" = "x$j"; then
14306           apr_addto_duplicate="1"
14307           break
14308         fi
14309       done
14310       if test $apr_addto_duplicate = "0"; then
14311         echo "  adding \"$i\" to APRUTIL_INCLUDES"
14312         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
14313       fi
14314     done
14315   fi
14316
14317
14318   if test "x$APRUTIL_LDFLAGS" = "x"; then
14319     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
14320     APRUTIL_LDFLAGS="-L$lib"
14321   else
14322     apr_addto_bugger="-L$lib"
14323     for i in $apr_addto_bugger; do
14324       apr_addto_duplicate="0"
14325       for j in $APRUTIL_LDFLAGS; do
14326         if test "x$i" = "x$j"; then
14327           apr_addto_duplicate="1"
14328           break
14329         fi
14330       done
14331       if test $apr_addto_duplicate = "0"; then
14332         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
14333         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
14334       fi
14335     done
14336   fi
14337
14338     apu_db_header=$bdb_header
14339     apu_db_lib=$bdb_libname
14340     apu_have_db=1
14341     ;;
14342   *)
14343
14344   if test "x$APRUTIL_INCLUDES" = "x"; then
14345     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
14346     APRUTIL_INCLUDES="-I$found/include"
14347   else
14348     apr_addto_bugger="-I$found/include"
14349     for i in $apr_addto_bugger; do
14350       apr_addto_duplicate="0"
14351       for j in $APRUTIL_INCLUDES; do
14352         if test "x$i" = "x$j"; then
14353           apr_addto_duplicate="1"
14354           break
14355         fi
14356       done
14357       if test $apr_addto_duplicate = "0"; then
14358         echo "  adding \"$i\" to APRUTIL_INCLUDES"
14359         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
14360       fi
14361     done
14362   fi
14363
14364
14365   if test "x$APRUTIL_LDFLAGS" = "x"; then
14366     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
14367     APRUTIL_LDFLAGS="-L$found/lib"
14368   else
14369     apr_addto_bugger="-L$found/lib"
14370     for i in $apr_addto_bugger; do
14371       apr_addto_duplicate="0"
14372       for j in $APRUTIL_LDFLAGS; do
14373         if test "x$i" = "x$j"; then
14374           apr_addto_duplicate="1"
14375           break
14376         fi
14377       done
14378       if test $apr_addto_duplicate = "0"; then
14379         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
14380         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
14381       fi
14382     done
14383   fi
14384
14385     apu_db_header=$bdb_header
14386     apu_db_lib=$bdb_libname
14387     apu_have_db=1
14388     ;;
14389   esac
14390
14391   if test "$apu_have_db" = "1"; then
14392     apu_db_version=4
14393   fi
14394
14395                 if test "$apu_db_version" != "4"; then
14396
14397   places="$all_places"
14398   if test -z "$places"; then
14399     places="std /usr/local /usr/local/BerkeleyDB.4.0 /boot/home/config"
14400   fi
14401
14402   bdb_version="4"
14403   if test ""0"" != "-1"; then
14404     bdb_version="$bdb_version."0""
14405     if test ""-1"" != "-1"; then
14406       bdb_version="$bdb_version."-1""
14407     fi
14408   fi
14409   bdb_places="$places"
14410   bdb_default_search_headers="db4/db.h db.h"
14411   bdb_default_search_lib_names="db-4.0 db4 db"
14412
14413
14414   apu_have_db=0
14415
14416   # Save the original values of the flags we tweak.
14417   apu_check_lib_save_libs="$LIBS"
14418   apu_check_lib_save_ldflags="$LDFLAGS"
14419   apu_check_lib_save_cppflags="$CPPFLAGS"
14420
14421   # The variable `found' is the prefix under which we've found
14422   # Berkeley DB, or `not' if we haven't found it anywhere yet.
14423   found=not
14424   for bdb_place in $bdb_places; do
14425
14426     LDFLAGS="$apu_check_lib_save_ldflags"
14427     CPPFLAGS="$apu_check_lib_save_cppflags"
14428     case "$bdb_place" in
14429       "std" )
14430         description="the standard places"
14431       ;;
14432       *":"* )
14433         header="`echo $bdb_place | sed -e 's/:.*$//'`"
14434         lib="`echo $bdb_place | sed -e 's/^.*://'`"
14435         CPPFLAGS="$CPPFLAGS -I$header"
14436         LDFLAGS="$LDFLAGS -L$lib"
14437         description="$header and $lib"
14438       ;;
14439       * )
14440         if test -d $bdb_place; then
14441           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
14442           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
14443         else
14444           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
14445 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
14446           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
14447 $as_echo "directory not found" >&6; }
14448           continue
14449         fi
14450         description="$bdb_place"
14451       ;;
14452     esac
14453
14454     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
14455     # trick to display a message instead.
14456     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
14457 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
14458     { $as_echo "$as_me:$LINENO: result: " >&5
14459 $as_echo "" >&6; }
14460
14461     for bdb_libname in $bdb_default_search_lib_names; do
14462       for bdb_header in $bdb_default_search_headers; do
14463         # Clear the header cache variable for each location
14464
14465         cache_id="`echo ac_cv_header_${bdb_header} \
14466                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
14467
14468         unset $cache_id
14469         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
14470 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
14471   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
14472 $as_echo_n "checking for $bdb_header... " >&6; }
14473 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
14474   $as_echo_n "(cached) " >&6
14475 fi
14476 ac_res=`eval 'as_val=${'$as_ac_Header'}
14477                  $as_echo "$as_val"'`
14478                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
14479 $as_echo "$ac_res" >&6; }
14480 else
14481   # Is the header compilable?
14482 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
14483 $as_echo_n "checking $bdb_header usability... " >&6; }
14484 cat >conftest.$ac_ext <<_ACEOF
14485 /* confdefs.h.  */
14486 _ACEOF
14487 cat confdefs.h >>conftest.$ac_ext
14488 cat >>conftest.$ac_ext <<_ACEOF
14489 /* end confdefs.h.  */
14490 $ac_includes_default
14491 #include <$bdb_header>
14492 _ACEOF
14493 rm -f conftest.$ac_objext
14494 if { (ac_try="$ac_compile"
14495 case "(($ac_try" in
14496   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14497   *) ac_try_echo=$ac_try;;
14498 esac
14499 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14500 $as_echo "$ac_try_echo") >&5
14501   (eval "$ac_compile") 2>conftest.er1
14502   ac_status=$?
14503   grep -v '^ *+' conftest.er1 >conftest.err
14504   rm -f conftest.er1
14505   cat conftest.err >&5
14506   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14507   (exit $ac_status); } && {
14508          test -z "$ac_c_werror_flag" ||
14509          test ! -s conftest.err
14510        } && test -s conftest.$ac_objext; then
14511   ac_header_compiler=yes
14512 else
14513   $as_echo "$as_me: failed program was:" >&5
14514 sed 's/^/| /' conftest.$ac_ext >&5
14515
14516         ac_header_compiler=no
14517 fi
14518
14519 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14520 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
14521 $as_echo "$ac_header_compiler" >&6; }
14522
14523 # Is the header present?
14524 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
14525 $as_echo_n "checking $bdb_header presence... " >&6; }
14526 cat >conftest.$ac_ext <<_ACEOF
14527 /* confdefs.h.  */
14528 _ACEOF
14529 cat confdefs.h >>conftest.$ac_ext
14530 cat >>conftest.$ac_ext <<_ACEOF
14531 /* end confdefs.h.  */
14532 #include <$bdb_header>
14533 _ACEOF
14534 if { (ac_try="$ac_cpp conftest.$ac_ext"
14535 case "(($ac_try" in
14536   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14537   *) ac_try_echo=$ac_try;;
14538 esac
14539 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14540 $as_echo "$ac_try_echo") >&5
14541   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
14542   ac_status=$?
14543   grep -v '^ *+' conftest.er1 >conftest.err
14544   rm -f conftest.er1
14545   cat conftest.err >&5
14546   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14547   (exit $ac_status); } >/dev/null && {
14548          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
14549          test ! -s conftest.err
14550        }; then
14551   ac_header_preproc=yes
14552 else
14553   $as_echo "$as_me: failed program was:" >&5
14554 sed 's/^/| /' conftest.$ac_ext >&5
14555
14556   ac_header_preproc=no
14557 fi
14558
14559 rm -f conftest.err conftest.$ac_ext
14560 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
14561 $as_echo "$ac_header_preproc" >&6; }
14562
14563 # So?  What about this header?
14564 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
14565   yes:no: )
14566     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
14567 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
14568     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
14569 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
14570     ac_header_preproc=yes
14571     ;;
14572   no:yes:* )
14573     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
14574 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
14575     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
14576 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
14577     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
14578 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
14579     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
14580 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
14581     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
14582 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
14583     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
14584 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
14585
14586     ;;
14587 esac
14588 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
14589 $as_echo_n "checking for $bdb_header... " >&6; }
14590 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
14591   $as_echo_n "(cached) " >&6
14592 else
14593   eval "$as_ac_Header=\$ac_header_preproc"
14594 fi
14595 ac_res=`eval 'as_val=${'$as_ac_Header'}
14596                  $as_echo "$as_val"'`
14597                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
14598 $as_echo "$ac_res" >&6; }
14599
14600 fi
14601 as_val=`eval 'as_val=${'$as_ac_Header'}
14602                  $as_echo "$as_val"'`
14603    if test "x$as_val" = x""yes; then
14604
14605           if test ""4"" = "3" -o ""4"" = "4"; then
14606             # We generate a separate cache variable for each prefix and libname
14607             # we search under.  That way, we avoid caching information that
14608             # changes if the user runs `configure' with a different set of
14609             # switches.
14610
14611             cache_id="`echo apu_cv_check_berkeley_db_"4"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
14612                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
14613
14614
14615             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
14616 $as_echo_n "checking for -l$bdb_libname... " >&6; }
14617                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
14618   $as_echo_n "(cached) " >&6
14619 else
14620
14621
14622     apu_try_berkeley_db_save_libs="$LIBS"
14623
14624     apu_check_berkeley_db_major="4"
14625     apu_check_berkeley_db_minor="0"
14626     apu_check_berkeley_db_patch="-1"
14627     apu_try_berkeley_db_header=$bdb_header
14628     apu_try_berkeley_db_libname=$bdb_libname
14629
14630     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
14631     if test "$cross_compiling" = yes; then
14632   apu_try_berkeley_db=yes
14633
14634 else
14635   cat >conftest.$ac_ext <<_ACEOF
14636 /* confdefs.h.  */
14637 _ACEOF
14638 cat confdefs.h >>conftest.$ac_ext
14639 cat >>conftest.$ac_ext <<_ACEOF
14640 /* end confdefs.h.  */
14641
14642 #include <stdlib.h>
14643 #include <stdio.h>
14644 #include <$apu_try_berkeley_db_header>
14645 main ()
14646 {
14647   int major, minor, patch;
14648
14649   db_version(&major, &minor, &patch);
14650
14651   /* Sanity check: ensure that db.h constants actually match the db library */
14652   if (major != DB_VERSION_MAJOR
14653       || minor != DB_VERSION_MINOR
14654       || patch != DB_VERSION_PATCH)
14655     exit (1);
14656
14657   /* Run-time check:  ensure the library claims to be the correct version. */
14658
14659   if ($apu_check_berkeley_db_major != -1) {
14660     if (major < $apu_check_berkeley_db_major)
14661       exit (1);
14662     if (major > $apu_check_berkeley_db_major)
14663       exit (0);
14664   }
14665
14666   if ($apu_check_berkeley_db_minor != -1) {
14667     if (minor < $apu_check_berkeley_db_minor)
14668       exit (1);
14669     if (minor > $apu_check_berkeley_db_minor)
14670       exit (0);
14671   }
14672
14673   if ($apu_check_berkeley_db_patch == -1
14674       || patch >= $apu_check_berkeley_db_patch)
14675     exit (0);
14676   else
14677     exit (1);
14678 }
14679
14680 _ACEOF
14681 rm -f conftest$ac_exeext
14682 if { (ac_try="$ac_link"
14683 case "(($ac_try" in
14684   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14685   *) ac_try_echo=$ac_try;;
14686 esac
14687 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14688 $as_echo "$ac_try_echo") >&5
14689   (eval "$ac_link") 2>&5
14690   ac_status=$?
14691   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14692   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14693   { (case "(($ac_try" in
14694   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14695   *) ac_try_echo=$ac_try;;
14696 esac
14697 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14698 $as_echo "$ac_try_echo") >&5
14699   (eval "$ac_try") 2>&5
14700   ac_status=$?
14701   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14702   (exit $ac_status); }; }; then
14703   apu_try_berkeley_db=yes
14704 else
14705   $as_echo "$as_me: program exited with status $ac_status" >&5
14706 $as_echo "$as_me: failed program was:" >&5
14707 sed 's/^/| /' conftest.$ac_ext >&5
14708
14709 ( exit $ac_status )
14710 apu_try_berkeley_db=no
14711 fi
14712 rm -rf conftest.dSYM
14713 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14714 fi
14715
14716
14717
14718     LIBS="$apu_try_berkeley_db_save_libs"
14719
14720
14721                 eval "$cache_id=$apu_try_berkeley_db"
14722
14723 fi
14724
14725             result="`eval echo '$'$cache_id`"
14726             { $as_echo "$as_me:$LINENO: result: $result" >&5
14727 $as_echo "$result" >&6; }
14728           elif test ""4"" = "1"; then
14729             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
14730 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
14731 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
14732 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
14733   $as_echo_n "(cached) " >&6
14734 else
14735   ac_check_lib_save_LIBS=$LIBS
14736 LIBS="-l$bdb_libname  $LIBS"
14737 cat >conftest.$ac_ext <<_ACEOF
14738 /* confdefs.h.  */
14739 _ACEOF
14740 cat confdefs.h >>conftest.$ac_ext
14741 cat >>conftest.$ac_ext <<_ACEOF
14742 /* end confdefs.h.  */
14743
14744 /* Override any GCC internal prototype to avoid an error.
14745    Use char because int might match the return type of a GCC
14746    builtin and then its argument prototype would still apply.  */
14747 #ifdef __cplusplus
14748 extern "C"
14749 #endif
14750 char dbopen ();
14751 int
14752 main ()
14753 {
14754 return dbopen ();
14755   ;
14756   return 0;
14757 }
14758 _ACEOF
14759 rm -f conftest.$ac_objext conftest$ac_exeext
14760 if { (ac_try="$ac_link"
14761 case "(($ac_try" in
14762   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14763   *) ac_try_echo=$ac_try;;
14764 esac
14765 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14766 $as_echo "$ac_try_echo") >&5
14767   (eval "$ac_link") 2>conftest.er1
14768   ac_status=$?
14769   grep -v '^ *+' conftest.er1 >conftest.err
14770   rm -f conftest.er1
14771   cat conftest.err >&5
14772   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14773   (exit $ac_status); } && {
14774          test -z "$ac_c_werror_flag" ||
14775          test ! -s conftest.err
14776        } && test -s conftest$ac_exeext && {
14777          test "$cross_compiling" = yes ||
14778          $as_test_x conftest$ac_exeext
14779        }; then
14780   eval "$as_ac_Lib=yes"
14781 else
14782   $as_echo "$as_me: failed program was:" >&5
14783 sed 's/^/| /' conftest.$ac_ext >&5
14784
14785         eval "$as_ac_Lib=no"
14786 fi
14787
14788 rm -rf conftest.dSYM
14789 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
14790       conftest$ac_exeext conftest.$ac_ext
14791 LIBS=$ac_check_lib_save_LIBS
14792 fi
14793 ac_res=`eval 'as_val=${'$as_ac_Lib'}
14794                  $as_echo "$as_val"'`
14795                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
14796 $as_echo "$ac_res" >&6; }
14797 as_val=`eval 'as_val=${'$as_ac_Lib'}
14798                  $as_echo "$as_val"'`
14799    if test "x$as_val" = x""yes; then
14800   result=yes
14801 else
14802   result=no
14803
14804 fi
14805
14806           elif test ""4"" = "2"; then
14807             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
14808 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
14809 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
14810 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
14811   $as_echo_n "(cached) " >&6
14812 else
14813   ac_check_lib_save_LIBS=$LIBS
14814 LIBS="-l$bdb_libname  $LIBS"
14815 cat >conftest.$ac_ext <<_ACEOF
14816 /* confdefs.h.  */
14817 _ACEOF
14818 cat confdefs.h >>conftest.$ac_ext
14819 cat >>conftest.$ac_ext <<_ACEOF
14820 /* end confdefs.h.  */
14821
14822 /* Override any GCC internal prototype to avoid an error.
14823    Use char because int might match the return type of a GCC
14824    builtin and then its argument prototype would still apply.  */
14825 #ifdef __cplusplus
14826 extern "C"
14827 #endif
14828 char db_open ();
14829 int
14830 main ()
14831 {
14832 return db_open ();
14833   ;
14834   return 0;
14835 }
14836 _ACEOF
14837 rm -f conftest.$ac_objext conftest$ac_exeext
14838 if { (ac_try="$ac_link"
14839 case "(($ac_try" in
14840   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14841   *) ac_try_echo=$ac_try;;
14842 esac
14843 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
14844 $as_echo "$ac_try_echo") >&5
14845   (eval "$ac_link") 2>conftest.er1
14846   ac_status=$?
14847   grep -v '^ *+' conftest.er1 >conftest.err
14848   rm -f conftest.er1
14849   cat conftest.err >&5
14850   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14851   (exit $ac_status); } && {
14852          test -z "$ac_c_werror_flag" ||
14853          test ! -s conftest.err
14854        } && test -s conftest$ac_exeext && {
14855          test "$cross_compiling" = yes ||
14856          $as_test_x conftest$ac_exeext
14857        }; then
14858   eval "$as_ac_Lib=yes"
14859 else
14860   $as_echo "$as_me: failed program was:" >&5
14861 sed 's/^/| /' conftest.$ac_ext >&5
14862
14863         eval "$as_ac_Lib=no"
14864 fi
14865
14866 rm -rf conftest.dSYM
14867 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
14868       conftest$ac_exeext conftest.$ac_ext
14869 LIBS=$ac_check_lib_save_LIBS
14870 fi
14871 ac_res=`eval 'as_val=${'$as_ac_Lib'}
14872                  $as_echo "$as_val"'`
14873                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
14874 $as_echo "$ac_res" >&6; }
14875 as_val=`eval 'as_val=${'$as_ac_Lib'}
14876                  $as_echo "$as_val"'`
14877    if test "x$as_val" = x""yes; then
14878   result=yes
14879 else
14880   result=no
14881
14882 fi
14883
14884           fi
14885
14886 else
14887   result="no"
14888 fi
14889
14890
14891
14892         # If we found it, no need to search any more.
14893         if test "$result" = "yes"; then
14894           found="$bdb_place"
14895           break
14896         fi
14897       done
14898       test "$found" != "not" && break
14899     done
14900     test "$found" != "not" && break
14901   done
14902
14903   # Restore the original values of the flags we tweak.
14904   LDFLAGS="$apu_check_lib_save_ldflags"
14905   CPPFLAGS="$apu_check_lib_save_cppflags"
14906
14907   case "$found" in
14908   "not")
14909     apu_have_db=0
14910     ;;
14911   "std")
14912     apu_db_header=$bdb_header
14913     apu_db_lib=$bdb_libname
14914     apu_have_db=1
14915     ;;
14916   *":"*)
14917     header="`echo $found | sed -e 's/:.*$//'`"
14918     lib="`echo $found | sed -e 's/^.*://'`"
14919
14920
14921   if test "x$APRUTIL_INCLUDES" = "x"; then
14922     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
14923     APRUTIL_INCLUDES="-I$header"
14924   else
14925     apr_addto_bugger="-I$header"
14926     for i in $apr_addto_bugger; do
14927       apr_addto_duplicate="0"
14928       for j in $APRUTIL_INCLUDES; do
14929         if test "x$i" = "x$j"; then
14930           apr_addto_duplicate="1"
14931           break
14932         fi
14933       done
14934       if test $apr_addto_duplicate = "0"; then
14935         echo "  adding \"$i\" to APRUTIL_INCLUDES"
14936         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
14937       fi
14938     done
14939   fi
14940
14941
14942   if test "x$APRUTIL_LDFLAGS" = "x"; then
14943     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
14944     APRUTIL_LDFLAGS="-L$lib"
14945   else
14946     apr_addto_bugger="-L$lib"
14947     for i in $apr_addto_bugger; do
14948       apr_addto_duplicate="0"
14949       for j in $APRUTIL_LDFLAGS; do
14950         if test "x$i" = "x$j"; then
14951           apr_addto_duplicate="1"
14952           break
14953         fi
14954       done
14955       if test $apr_addto_duplicate = "0"; then
14956         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
14957         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
14958       fi
14959     done
14960   fi
14961
14962     apu_db_header=$bdb_header
14963     apu_db_lib=$bdb_libname
14964     apu_have_db=1
14965     ;;
14966   *)
14967
14968   if test "x$APRUTIL_INCLUDES" = "x"; then
14969     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
14970     APRUTIL_INCLUDES="-I$found/include"
14971   else
14972     apr_addto_bugger="-I$found/include"
14973     for i in $apr_addto_bugger; do
14974       apr_addto_duplicate="0"
14975       for j in $APRUTIL_INCLUDES; do
14976         if test "x$i" = "x$j"; then
14977           apr_addto_duplicate="1"
14978           break
14979         fi
14980       done
14981       if test $apr_addto_duplicate = "0"; then
14982         echo "  adding \"$i\" to APRUTIL_INCLUDES"
14983         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
14984       fi
14985     done
14986   fi
14987
14988
14989   if test "x$APRUTIL_LDFLAGS" = "x"; then
14990     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
14991     APRUTIL_LDFLAGS="-L$found/lib"
14992   else
14993     apr_addto_bugger="-L$found/lib"
14994     for i in $apr_addto_bugger; do
14995       apr_addto_duplicate="0"
14996       for j in $APRUTIL_LDFLAGS; do
14997         if test "x$i" = "x$j"; then
14998           apr_addto_duplicate="1"
14999           break
15000         fi
15001       done
15002       if test $apr_addto_duplicate = "0"; then
15003         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
15004         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
15005       fi
15006     done
15007   fi
15008
15009     apu_db_header=$bdb_header
15010     apu_db_lib=$bdb_libname
15011     apu_have_db=1
15012     ;;
15013   esac
15014
15015   if test "$apu_have_db" = "1"; then
15016     apu_db_version=4
15017   fi
15018
15019                   if test "$apu_db_version" != "4"; then
15020
15021   places="$all_places"
15022   if test -z "$places"; then
15023     places="std"
15024   fi
15025
15026   bdb_version=3
15027   if test "-1" != "-1"; then
15028     bdb_version="$bdb_version.-1"
15029     if test "-1" != "-1"; then
15030       bdb_version="$bdb_version.-1"
15031     fi
15032   fi
15033   bdb_places="$places"
15034   bdb_default_search_headers="db3/db.h db.h"
15035   bdb_default_search_lib_names="db3 db"
15036
15037
15038   apu_have_db=0
15039
15040   # Save the original values of the flags we tweak.
15041   apu_check_lib_save_libs="$LIBS"
15042   apu_check_lib_save_ldflags="$LDFLAGS"
15043   apu_check_lib_save_cppflags="$CPPFLAGS"
15044
15045   # The variable `found' is the prefix under which we've found
15046   # Berkeley DB, or `not' if we haven't found it anywhere yet.
15047   found=not
15048   for bdb_place in $bdb_places; do
15049
15050     LDFLAGS="$apu_check_lib_save_ldflags"
15051     CPPFLAGS="$apu_check_lib_save_cppflags"
15052     case "$bdb_place" in
15053       "std" )
15054         description="the standard places"
15055       ;;
15056       *":"* )
15057         header="`echo $bdb_place | sed -e 's/:.*$//'`"
15058         lib="`echo $bdb_place | sed -e 's/^.*://'`"
15059         CPPFLAGS="$CPPFLAGS -I$header"
15060         LDFLAGS="$LDFLAGS -L$lib"
15061         description="$header and $lib"
15062       ;;
15063       * )
15064         if test -d $bdb_place; then
15065           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
15066           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
15067         else
15068           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
15069 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
15070           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
15071 $as_echo "directory not found" >&6; }
15072           continue
15073         fi
15074         description="$bdb_place"
15075       ;;
15076     esac
15077
15078     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
15079     # trick to display a message instead.
15080     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
15081 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
15082     { $as_echo "$as_me:$LINENO: result: " >&5
15083 $as_echo "" >&6; }
15084
15085     for bdb_libname in $bdb_default_search_lib_names; do
15086       for bdb_header in $bdb_default_search_headers; do
15087         # Clear the header cache variable for each location
15088
15089         cache_id="`echo ac_cv_header_${bdb_header} \
15090                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
15091
15092         unset $cache_id
15093         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
15094 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15095   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
15096 $as_echo_n "checking for $bdb_header... " >&6; }
15097 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15098   $as_echo_n "(cached) " >&6
15099 fi
15100 ac_res=`eval 'as_val=${'$as_ac_Header'}
15101                  $as_echo "$as_val"'`
15102                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15103 $as_echo "$ac_res" >&6; }
15104 else
15105   # Is the header compilable?
15106 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
15107 $as_echo_n "checking $bdb_header usability... " >&6; }
15108 cat >conftest.$ac_ext <<_ACEOF
15109 /* confdefs.h.  */
15110 _ACEOF
15111 cat confdefs.h >>conftest.$ac_ext
15112 cat >>conftest.$ac_ext <<_ACEOF
15113 /* end confdefs.h.  */
15114 $ac_includes_default
15115 #include <$bdb_header>
15116 _ACEOF
15117 rm -f conftest.$ac_objext
15118 if { (ac_try="$ac_compile"
15119 case "(($ac_try" in
15120   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15121   *) ac_try_echo=$ac_try;;
15122 esac
15123 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15124 $as_echo "$ac_try_echo") >&5
15125   (eval "$ac_compile") 2>conftest.er1
15126   ac_status=$?
15127   grep -v '^ *+' conftest.er1 >conftest.err
15128   rm -f conftest.er1
15129   cat conftest.err >&5
15130   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15131   (exit $ac_status); } && {
15132          test -z "$ac_c_werror_flag" ||
15133          test ! -s conftest.err
15134        } && test -s conftest.$ac_objext; then
15135   ac_header_compiler=yes
15136 else
15137   $as_echo "$as_me: failed program was:" >&5
15138 sed 's/^/| /' conftest.$ac_ext >&5
15139
15140         ac_header_compiler=no
15141 fi
15142
15143 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15144 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
15145 $as_echo "$ac_header_compiler" >&6; }
15146
15147 # Is the header present?
15148 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
15149 $as_echo_n "checking $bdb_header presence... " >&6; }
15150 cat >conftest.$ac_ext <<_ACEOF
15151 /* confdefs.h.  */
15152 _ACEOF
15153 cat confdefs.h >>conftest.$ac_ext
15154 cat >>conftest.$ac_ext <<_ACEOF
15155 /* end confdefs.h.  */
15156 #include <$bdb_header>
15157 _ACEOF
15158 if { (ac_try="$ac_cpp conftest.$ac_ext"
15159 case "(($ac_try" in
15160   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15161   *) ac_try_echo=$ac_try;;
15162 esac
15163 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15164 $as_echo "$ac_try_echo") >&5
15165   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
15166   ac_status=$?
15167   grep -v '^ *+' conftest.er1 >conftest.err
15168   rm -f conftest.er1
15169   cat conftest.err >&5
15170   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15171   (exit $ac_status); } >/dev/null && {
15172          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
15173          test ! -s conftest.err
15174        }; then
15175   ac_header_preproc=yes
15176 else
15177   $as_echo "$as_me: failed program was:" >&5
15178 sed 's/^/| /' conftest.$ac_ext >&5
15179
15180   ac_header_preproc=no
15181 fi
15182
15183 rm -f conftest.err conftest.$ac_ext
15184 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
15185 $as_echo "$ac_header_preproc" >&6; }
15186
15187 # So?  What about this header?
15188 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
15189   yes:no: )
15190     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
15191 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
15192     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
15193 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
15194     ac_header_preproc=yes
15195     ;;
15196   no:yes:* )
15197     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
15198 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
15199     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
15200 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
15201     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
15202 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
15203     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
15204 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
15205     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
15206 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
15207     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
15208 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
15209
15210     ;;
15211 esac
15212 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
15213 $as_echo_n "checking for $bdb_header... " >&6; }
15214 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15215   $as_echo_n "(cached) " >&6
15216 else
15217   eval "$as_ac_Header=\$ac_header_preproc"
15218 fi
15219 ac_res=`eval 'as_val=${'$as_ac_Header'}
15220                  $as_echo "$as_val"'`
15221                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15222 $as_echo "$ac_res" >&6; }
15223
15224 fi
15225 as_val=`eval 'as_val=${'$as_ac_Header'}
15226                  $as_echo "$as_val"'`
15227    if test "x$as_val" = x""yes; then
15228
15229           if test "3" = "3" -o "3" = "4"; then
15230             # We generate a separate cache variable for each prefix and libname
15231             # we search under.  That way, we avoid caching information that
15232             # changes if the user runs `configure' with a different set of
15233             # switches.
15234
15235             cache_id="`echo apu_cv_check_berkeley_db_3_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
15236                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
15237
15238
15239             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
15240 $as_echo_n "checking for -l$bdb_libname... " >&6; }
15241                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
15242   $as_echo_n "(cached) " >&6
15243 else
15244
15245
15246     apu_try_berkeley_db_save_libs="$LIBS"
15247
15248     apu_check_berkeley_db_major=3
15249     apu_check_berkeley_db_minor=-1
15250     apu_check_berkeley_db_patch=-1
15251     apu_try_berkeley_db_header=$bdb_header
15252     apu_try_berkeley_db_libname=$bdb_libname
15253
15254     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
15255     if test "$cross_compiling" = yes; then
15256   apu_try_berkeley_db=yes
15257
15258 else
15259   cat >conftest.$ac_ext <<_ACEOF
15260 /* confdefs.h.  */
15261 _ACEOF
15262 cat confdefs.h >>conftest.$ac_ext
15263 cat >>conftest.$ac_ext <<_ACEOF
15264 /* end confdefs.h.  */
15265
15266 #include <stdlib.h>
15267 #include <stdio.h>
15268 #include <$apu_try_berkeley_db_header>
15269 main ()
15270 {
15271   int major, minor, patch;
15272
15273   db_version(&major, &minor, &patch);
15274
15275   /* Sanity check: ensure that db.h constants actually match the db library */
15276   if (major != DB_VERSION_MAJOR
15277       || minor != DB_VERSION_MINOR
15278       || patch != DB_VERSION_PATCH)
15279     exit (1);
15280
15281   /* Run-time check:  ensure the library claims to be the correct version. */
15282
15283   if ($apu_check_berkeley_db_major != -1) {
15284     if (major < $apu_check_berkeley_db_major)
15285       exit (1);
15286     if (major > $apu_check_berkeley_db_major)
15287       exit (0);
15288   }
15289
15290   if ($apu_check_berkeley_db_minor != -1) {
15291     if (minor < $apu_check_berkeley_db_minor)
15292       exit (1);
15293     if (minor > $apu_check_berkeley_db_minor)
15294       exit (0);
15295   }
15296
15297   if ($apu_check_berkeley_db_patch == -1
15298       || patch >= $apu_check_berkeley_db_patch)
15299     exit (0);
15300   else
15301     exit (1);
15302 }
15303
15304 _ACEOF
15305 rm -f conftest$ac_exeext
15306 if { (ac_try="$ac_link"
15307 case "(($ac_try" in
15308   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15309   *) ac_try_echo=$ac_try;;
15310 esac
15311 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15312 $as_echo "$ac_try_echo") >&5
15313   (eval "$ac_link") 2>&5
15314   ac_status=$?
15315   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15316   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15317   { (case "(($ac_try" in
15318   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15319   *) ac_try_echo=$ac_try;;
15320 esac
15321 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15322 $as_echo "$ac_try_echo") >&5
15323   (eval "$ac_try") 2>&5
15324   ac_status=$?
15325   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15326   (exit $ac_status); }; }; then
15327   apu_try_berkeley_db=yes
15328 else
15329   $as_echo "$as_me: program exited with status $ac_status" >&5
15330 $as_echo "$as_me: failed program was:" >&5
15331 sed 's/^/| /' conftest.$ac_ext >&5
15332
15333 ( exit $ac_status )
15334 apu_try_berkeley_db=no
15335 fi
15336 rm -rf conftest.dSYM
15337 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15338 fi
15339
15340
15341
15342     LIBS="$apu_try_berkeley_db_save_libs"
15343
15344
15345                 eval "$cache_id=$apu_try_berkeley_db"
15346
15347 fi
15348
15349             result="`eval echo '$'$cache_id`"
15350             { $as_echo "$as_me:$LINENO: result: $result" >&5
15351 $as_echo "$result" >&6; }
15352           elif test "3" = "1"; then
15353             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
15354 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
15355 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
15356 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
15357   $as_echo_n "(cached) " >&6
15358 else
15359   ac_check_lib_save_LIBS=$LIBS
15360 LIBS="-l$bdb_libname  $LIBS"
15361 cat >conftest.$ac_ext <<_ACEOF
15362 /* confdefs.h.  */
15363 _ACEOF
15364 cat confdefs.h >>conftest.$ac_ext
15365 cat >>conftest.$ac_ext <<_ACEOF
15366 /* end confdefs.h.  */
15367
15368 /* Override any GCC internal prototype to avoid an error.
15369    Use char because int might match the return type of a GCC
15370    builtin and then its argument prototype would still apply.  */
15371 #ifdef __cplusplus
15372 extern "C"
15373 #endif
15374 char dbopen ();
15375 int
15376 main ()
15377 {
15378 return dbopen ();
15379   ;
15380   return 0;
15381 }
15382 _ACEOF
15383 rm -f conftest.$ac_objext conftest$ac_exeext
15384 if { (ac_try="$ac_link"
15385 case "(($ac_try" in
15386   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15387   *) ac_try_echo=$ac_try;;
15388 esac
15389 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15390 $as_echo "$ac_try_echo") >&5
15391   (eval "$ac_link") 2>conftest.er1
15392   ac_status=$?
15393   grep -v '^ *+' conftest.er1 >conftest.err
15394   rm -f conftest.er1
15395   cat conftest.err >&5
15396   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15397   (exit $ac_status); } && {
15398          test -z "$ac_c_werror_flag" ||
15399          test ! -s conftest.err
15400        } && test -s conftest$ac_exeext && {
15401          test "$cross_compiling" = yes ||
15402          $as_test_x conftest$ac_exeext
15403        }; then
15404   eval "$as_ac_Lib=yes"
15405 else
15406   $as_echo "$as_me: failed program was:" >&5
15407 sed 's/^/| /' conftest.$ac_ext >&5
15408
15409         eval "$as_ac_Lib=no"
15410 fi
15411
15412 rm -rf conftest.dSYM
15413 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
15414       conftest$ac_exeext conftest.$ac_ext
15415 LIBS=$ac_check_lib_save_LIBS
15416 fi
15417 ac_res=`eval 'as_val=${'$as_ac_Lib'}
15418                  $as_echo "$as_val"'`
15419                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15420 $as_echo "$ac_res" >&6; }
15421 as_val=`eval 'as_val=${'$as_ac_Lib'}
15422                  $as_echo "$as_val"'`
15423    if test "x$as_val" = x""yes; then
15424   result=yes
15425 else
15426   result=no
15427
15428 fi
15429
15430           elif test "3" = "2"; then
15431             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
15432 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
15433 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
15434 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
15435   $as_echo_n "(cached) " >&6
15436 else
15437   ac_check_lib_save_LIBS=$LIBS
15438 LIBS="-l$bdb_libname  $LIBS"
15439 cat >conftest.$ac_ext <<_ACEOF
15440 /* confdefs.h.  */
15441 _ACEOF
15442 cat confdefs.h >>conftest.$ac_ext
15443 cat >>conftest.$ac_ext <<_ACEOF
15444 /* end confdefs.h.  */
15445
15446 /* Override any GCC internal prototype to avoid an error.
15447    Use char because int might match the return type of a GCC
15448    builtin and then its argument prototype would still apply.  */
15449 #ifdef __cplusplus
15450 extern "C"
15451 #endif
15452 char db_open ();
15453 int
15454 main ()
15455 {
15456 return db_open ();
15457   ;
15458   return 0;
15459 }
15460 _ACEOF
15461 rm -f conftest.$ac_objext conftest$ac_exeext
15462 if { (ac_try="$ac_link"
15463 case "(($ac_try" in
15464   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15465   *) ac_try_echo=$ac_try;;
15466 esac
15467 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15468 $as_echo "$ac_try_echo") >&5
15469   (eval "$ac_link") 2>conftest.er1
15470   ac_status=$?
15471   grep -v '^ *+' conftest.er1 >conftest.err
15472   rm -f conftest.er1
15473   cat conftest.err >&5
15474   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15475   (exit $ac_status); } && {
15476          test -z "$ac_c_werror_flag" ||
15477          test ! -s conftest.err
15478        } && test -s conftest$ac_exeext && {
15479          test "$cross_compiling" = yes ||
15480          $as_test_x conftest$ac_exeext
15481        }; then
15482   eval "$as_ac_Lib=yes"
15483 else
15484   $as_echo "$as_me: failed program was:" >&5
15485 sed 's/^/| /' conftest.$ac_ext >&5
15486
15487         eval "$as_ac_Lib=no"
15488 fi
15489
15490 rm -rf conftest.dSYM
15491 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
15492       conftest$ac_exeext conftest.$ac_ext
15493 LIBS=$ac_check_lib_save_LIBS
15494 fi
15495 ac_res=`eval 'as_val=${'$as_ac_Lib'}
15496                  $as_echo "$as_val"'`
15497                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15498 $as_echo "$ac_res" >&6; }
15499 as_val=`eval 'as_val=${'$as_ac_Lib'}
15500                  $as_echo "$as_val"'`
15501    if test "x$as_val" = x""yes; then
15502   result=yes
15503 else
15504   result=no
15505
15506 fi
15507
15508           fi
15509
15510 else
15511   result="no"
15512 fi
15513
15514
15515
15516         # If we found it, no need to search any more.
15517         if test "$result" = "yes"; then
15518           found="$bdb_place"
15519           break
15520         fi
15521       done
15522       test "$found" != "not" && break
15523     done
15524     test "$found" != "not" && break
15525   done
15526
15527   # Restore the original values of the flags we tweak.
15528   LDFLAGS="$apu_check_lib_save_ldflags"
15529   CPPFLAGS="$apu_check_lib_save_cppflags"
15530
15531   case "$found" in
15532   "not")
15533     apu_have_db=0
15534     ;;
15535   "std")
15536     apu_db_header=$bdb_header
15537     apu_db_lib=$bdb_libname
15538     apu_have_db=1
15539     ;;
15540   *":"*)
15541     header="`echo $found | sed -e 's/:.*$//'`"
15542     lib="`echo $found | sed -e 's/^.*://'`"
15543
15544
15545   if test "x$APRUTIL_INCLUDES" = "x"; then
15546     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
15547     APRUTIL_INCLUDES="-I$header"
15548   else
15549     apr_addto_bugger="-I$header"
15550     for i in $apr_addto_bugger; do
15551       apr_addto_duplicate="0"
15552       for j in $APRUTIL_INCLUDES; do
15553         if test "x$i" = "x$j"; then
15554           apr_addto_duplicate="1"
15555           break
15556         fi
15557       done
15558       if test $apr_addto_duplicate = "0"; then
15559         echo "  adding \"$i\" to APRUTIL_INCLUDES"
15560         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
15561       fi
15562     done
15563   fi
15564
15565
15566   if test "x$APRUTIL_LDFLAGS" = "x"; then
15567     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
15568     APRUTIL_LDFLAGS="-L$lib"
15569   else
15570     apr_addto_bugger="-L$lib"
15571     for i in $apr_addto_bugger; do
15572       apr_addto_duplicate="0"
15573       for j in $APRUTIL_LDFLAGS; do
15574         if test "x$i" = "x$j"; then
15575           apr_addto_duplicate="1"
15576           break
15577         fi
15578       done
15579       if test $apr_addto_duplicate = "0"; then
15580         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
15581         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
15582       fi
15583     done
15584   fi
15585
15586     apu_db_header=$bdb_header
15587     apu_db_lib=$bdb_libname
15588     apu_have_db=1
15589     ;;
15590   *)
15591
15592   if test "x$APRUTIL_INCLUDES" = "x"; then
15593     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
15594     APRUTIL_INCLUDES="-I$found/include"
15595   else
15596     apr_addto_bugger="-I$found/include"
15597     for i in $apr_addto_bugger; do
15598       apr_addto_duplicate="0"
15599       for j in $APRUTIL_INCLUDES; do
15600         if test "x$i" = "x$j"; then
15601           apr_addto_duplicate="1"
15602           break
15603         fi
15604       done
15605       if test $apr_addto_duplicate = "0"; then
15606         echo "  adding \"$i\" to APRUTIL_INCLUDES"
15607         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
15608       fi
15609     done
15610   fi
15611
15612
15613   if test "x$APRUTIL_LDFLAGS" = "x"; then
15614     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
15615     APRUTIL_LDFLAGS="-L$found/lib"
15616   else
15617     apr_addto_bugger="-L$found/lib"
15618     for i in $apr_addto_bugger; do
15619       apr_addto_duplicate="0"
15620       for j in $APRUTIL_LDFLAGS; do
15621         if test "x$i" = "x$j"; then
15622           apr_addto_duplicate="1"
15623           break
15624         fi
15625       done
15626       if test $apr_addto_duplicate = "0"; then
15627         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
15628         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
15629       fi
15630     done
15631   fi
15632
15633     apu_db_header=$bdb_header
15634     apu_db_lib=$bdb_libname
15635     apu_have_db=1
15636     ;;
15637   esac
15638
15639   if test "$apu_have_db" = "1"; then
15640     apu_db_version=3
15641   fi
15642
15643                     if test "$apu_db_version" != "3"; then
15644
15645   places="$all_places"
15646   if test -z "$places"; then
15647     places="std"
15648   fi
15649
15650   bdb_version=2
15651   if test "-1" != "-1"; then
15652     bdb_version="$bdb_version.-1"
15653     if test "-1" != "-1"; then
15654       bdb_version="$bdb_version.-1"
15655     fi
15656   fi
15657   bdb_places="$places"
15658   bdb_default_search_headers="db2/db.h db.h"
15659   bdb_default_search_lib_names="db2 db"
15660
15661
15662   apu_have_db=0
15663
15664   # Save the original values of the flags we tweak.
15665   apu_check_lib_save_libs="$LIBS"
15666   apu_check_lib_save_ldflags="$LDFLAGS"
15667   apu_check_lib_save_cppflags="$CPPFLAGS"
15668
15669   # The variable `found' is the prefix under which we've found
15670   # Berkeley DB, or `not' if we haven't found it anywhere yet.
15671   found=not
15672   for bdb_place in $bdb_places; do
15673
15674     LDFLAGS="$apu_check_lib_save_ldflags"
15675     CPPFLAGS="$apu_check_lib_save_cppflags"
15676     case "$bdb_place" in
15677       "std" )
15678         description="the standard places"
15679       ;;
15680       *":"* )
15681         header="`echo $bdb_place | sed -e 's/:.*$//'`"
15682         lib="`echo $bdb_place | sed -e 's/^.*://'`"
15683         CPPFLAGS="$CPPFLAGS -I$header"
15684         LDFLAGS="$LDFLAGS -L$lib"
15685         description="$header and $lib"
15686       ;;
15687       * )
15688         if test -d $bdb_place; then
15689           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
15690           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
15691         else
15692           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
15693 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
15694           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
15695 $as_echo "directory not found" >&6; }
15696           continue
15697         fi
15698         description="$bdb_place"
15699       ;;
15700     esac
15701
15702     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
15703     # trick to display a message instead.
15704     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
15705 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
15706     { $as_echo "$as_me:$LINENO: result: " >&5
15707 $as_echo "" >&6; }
15708
15709     for bdb_libname in $bdb_default_search_lib_names; do
15710       for bdb_header in $bdb_default_search_headers; do
15711         # Clear the header cache variable for each location
15712
15713         cache_id="`echo ac_cv_header_${bdb_header} \
15714                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
15715
15716         unset $cache_id
15717         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
15718 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15719   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
15720 $as_echo_n "checking for $bdb_header... " >&6; }
15721 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15722   $as_echo_n "(cached) " >&6
15723 fi
15724 ac_res=`eval 'as_val=${'$as_ac_Header'}
15725                  $as_echo "$as_val"'`
15726                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15727 $as_echo "$ac_res" >&6; }
15728 else
15729   # Is the header compilable?
15730 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
15731 $as_echo_n "checking $bdb_header usability... " >&6; }
15732 cat >conftest.$ac_ext <<_ACEOF
15733 /* confdefs.h.  */
15734 _ACEOF
15735 cat confdefs.h >>conftest.$ac_ext
15736 cat >>conftest.$ac_ext <<_ACEOF
15737 /* end confdefs.h.  */
15738 $ac_includes_default
15739 #include <$bdb_header>
15740 _ACEOF
15741 rm -f conftest.$ac_objext
15742 if { (ac_try="$ac_compile"
15743 case "(($ac_try" in
15744   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15745   *) ac_try_echo=$ac_try;;
15746 esac
15747 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15748 $as_echo "$ac_try_echo") >&5
15749   (eval "$ac_compile") 2>conftest.er1
15750   ac_status=$?
15751   grep -v '^ *+' conftest.er1 >conftest.err
15752   rm -f conftest.er1
15753   cat conftest.err >&5
15754   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15755   (exit $ac_status); } && {
15756          test -z "$ac_c_werror_flag" ||
15757          test ! -s conftest.err
15758        } && test -s conftest.$ac_objext; then
15759   ac_header_compiler=yes
15760 else
15761   $as_echo "$as_me: failed program was:" >&5
15762 sed 's/^/| /' conftest.$ac_ext >&5
15763
15764         ac_header_compiler=no
15765 fi
15766
15767 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15768 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
15769 $as_echo "$ac_header_compiler" >&6; }
15770
15771 # Is the header present?
15772 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
15773 $as_echo_n "checking $bdb_header presence... " >&6; }
15774 cat >conftest.$ac_ext <<_ACEOF
15775 /* confdefs.h.  */
15776 _ACEOF
15777 cat confdefs.h >>conftest.$ac_ext
15778 cat >>conftest.$ac_ext <<_ACEOF
15779 /* end confdefs.h.  */
15780 #include <$bdb_header>
15781 _ACEOF
15782 if { (ac_try="$ac_cpp conftest.$ac_ext"
15783 case "(($ac_try" in
15784   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15785   *) ac_try_echo=$ac_try;;
15786 esac
15787 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15788 $as_echo "$ac_try_echo") >&5
15789   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
15790   ac_status=$?
15791   grep -v '^ *+' conftest.er1 >conftest.err
15792   rm -f conftest.er1
15793   cat conftest.err >&5
15794   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15795   (exit $ac_status); } >/dev/null && {
15796          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
15797          test ! -s conftest.err
15798        }; then
15799   ac_header_preproc=yes
15800 else
15801   $as_echo "$as_me: failed program was:" >&5
15802 sed 's/^/| /' conftest.$ac_ext >&5
15803
15804   ac_header_preproc=no
15805 fi
15806
15807 rm -f conftest.err conftest.$ac_ext
15808 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
15809 $as_echo "$ac_header_preproc" >&6; }
15810
15811 # So?  What about this header?
15812 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
15813   yes:no: )
15814     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
15815 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
15816     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
15817 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
15818     ac_header_preproc=yes
15819     ;;
15820   no:yes:* )
15821     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
15822 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
15823     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
15824 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
15825     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
15826 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
15827     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
15828 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
15829     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
15830 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
15831     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
15832 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
15833
15834     ;;
15835 esac
15836 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
15837 $as_echo_n "checking for $bdb_header... " >&6; }
15838 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15839   $as_echo_n "(cached) " >&6
15840 else
15841   eval "$as_ac_Header=\$ac_header_preproc"
15842 fi
15843 ac_res=`eval 'as_val=${'$as_ac_Header'}
15844                  $as_echo "$as_val"'`
15845                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15846 $as_echo "$ac_res" >&6; }
15847
15848 fi
15849 as_val=`eval 'as_val=${'$as_ac_Header'}
15850                  $as_echo "$as_val"'`
15851    if test "x$as_val" = x""yes; then
15852
15853           if test "2" = "3" -o "2" = "4"; then
15854             # We generate a separate cache variable for each prefix and libname
15855             # we search under.  That way, we avoid caching information that
15856             # changes if the user runs `configure' with a different set of
15857             # switches.
15858
15859             cache_id="`echo apu_cv_check_berkeley_db_2_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
15860                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
15861
15862
15863             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
15864 $as_echo_n "checking for -l$bdb_libname... " >&6; }
15865                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
15866   $as_echo_n "(cached) " >&6
15867 else
15868
15869
15870     apu_try_berkeley_db_save_libs="$LIBS"
15871
15872     apu_check_berkeley_db_major=2
15873     apu_check_berkeley_db_minor=-1
15874     apu_check_berkeley_db_patch=-1
15875     apu_try_berkeley_db_header=$bdb_header
15876     apu_try_berkeley_db_libname=$bdb_libname
15877
15878     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
15879     if test "$cross_compiling" = yes; then
15880   apu_try_berkeley_db=yes
15881
15882 else
15883   cat >conftest.$ac_ext <<_ACEOF
15884 /* confdefs.h.  */
15885 _ACEOF
15886 cat confdefs.h >>conftest.$ac_ext
15887 cat >>conftest.$ac_ext <<_ACEOF
15888 /* end confdefs.h.  */
15889
15890 #include <stdlib.h>
15891 #include <stdio.h>
15892 #include <$apu_try_berkeley_db_header>
15893 main ()
15894 {
15895   int major, minor, patch;
15896
15897   db_version(&major, &minor, &patch);
15898
15899   /* Sanity check: ensure that db.h constants actually match the db library */
15900   if (major != DB_VERSION_MAJOR
15901       || minor != DB_VERSION_MINOR
15902       || patch != DB_VERSION_PATCH)
15903     exit (1);
15904
15905   /* Run-time check:  ensure the library claims to be the correct version. */
15906
15907   if ($apu_check_berkeley_db_major != -1) {
15908     if (major < $apu_check_berkeley_db_major)
15909       exit (1);
15910     if (major > $apu_check_berkeley_db_major)
15911       exit (0);
15912   }
15913
15914   if ($apu_check_berkeley_db_minor != -1) {
15915     if (minor < $apu_check_berkeley_db_minor)
15916       exit (1);
15917     if (minor > $apu_check_berkeley_db_minor)
15918       exit (0);
15919   }
15920
15921   if ($apu_check_berkeley_db_patch == -1
15922       || patch >= $apu_check_berkeley_db_patch)
15923     exit (0);
15924   else
15925     exit (1);
15926 }
15927
15928 _ACEOF
15929 rm -f conftest$ac_exeext
15930 if { (ac_try="$ac_link"
15931 case "(($ac_try" in
15932   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15933   *) ac_try_echo=$ac_try;;
15934 esac
15935 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15936 $as_echo "$ac_try_echo") >&5
15937   (eval "$ac_link") 2>&5
15938   ac_status=$?
15939   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15940   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15941   { (case "(($ac_try" in
15942   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15943   *) ac_try_echo=$ac_try;;
15944 esac
15945 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15946 $as_echo "$ac_try_echo") >&5
15947   (eval "$ac_try") 2>&5
15948   ac_status=$?
15949   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15950   (exit $ac_status); }; }; then
15951   apu_try_berkeley_db=yes
15952 else
15953   $as_echo "$as_me: program exited with status $ac_status" >&5
15954 $as_echo "$as_me: failed program was:" >&5
15955 sed 's/^/| /' conftest.$ac_ext >&5
15956
15957 ( exit $ac_status )
15958 apu_try_berkeley_db=no
15959 fi
15960 rm -rf conftest.dSYM
15961 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15962 fi
15963
15964
15965
15966     LIBS="$apu_try_berkeley_db_save_libs"
15967
15968
15969                 eval "$cache_id=$apu_try_berkeley_db"
15970
15971 fi
15972
15973             result="`eval echo '$'$cache_id`"
15974             { $as_echo "$as_me:$LINENO: result: $result" >&5
15975 $as_echo "$result" >&6; }
15976           elif test "2" = "1"; then
15977             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
15978 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
15979 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
15980 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
15981   $as_echo_n "(cached) " >&6
15982 else
15983   ac_check_lib_save_LIBS=$LIBS
15984 LIBS="-l$bdb_libname  $LIBS"
15985 cat >conftest.$ac_ext <<_ACEOF
15986 /* confdefs.h.  */
15987 _ACEOF
15988 cat confdefs.h >>conftest.$ac_ext
15989 cat >>conftest.$ac_ext <<_ACEOF
15990 /* end confdefs.h.  */
15991
15992 /* Override any GCC internal prototype to avoid an error.
15993    Use char because int might match the return type of a GCC
15994    builtin and then its argument prototype would still apply.  */
15995 #ifdef __cplusplus
15996 extern "C"
15997 #endif
15998 char dbopen ();
15999 int
16000 main ()
16001 {
16002 return dbopen ();
16003   ;
16004   return 0;
16005 }
16006 _ACEOF
16007 rm -f conftest.$ac_objext conftest$ac_exeext
16008 if { (ac_try="$ac_link"
16009 case "(($ac_try" in
16010   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16011   *) ac_try_echo=$ac_try;;
16012 esac
16013 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16014 $as_echo "$ac_try_echo") >&5
16015   (eval "$ac_link") 2>conftest.er1
16016   ac_status=$?
16017   grep -v '^ *+' conftest.er1 >conftest.err
16018   rm -f conftest.er1
16019   cat conftest.err >&5
16020   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16021   (exit $ac_status); } && {
16022          test -z "$ac_c_werror_flag" ||
16023          test ! -s conftest.err
16024        } && test -s conftest$ac_exeext && {
16025          test "$cross_compiling" = yes ||
16026          $as_test_x conftest$ac_exeext
16027        }; then
16028   eval "$as_ac_Lib=yes"
16029 else
16030   $as_echo "$as_me: failed program was:" >&5
16031 sed 's/^/| /' conftest.$ac_ext >&5
16032
16033         eval "$as_ac_Lib=no"
16034 fi
16035
16036 rm -rf conftest.dSYM
16037 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16038       conftest$ac_exeext conftest.$ac_ext
16039 LIBS=$ac_check_lib_save_LIBS
16040 fi
16041 ac_res=`eval 'as_val=${'$as_ac_Lib'}
16042                  $as_echo "$as_val"'`
16043                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16044 $as_echo "$ac_res" >&6; }
16045 as_val=`eval 'as_val=${'$as_ac_Lib'}
16046                  $as_echo "$as_val"'`
16047    if test "x$as_val" = x""yes; then
16048   result=yes
16049 else
16050   result=no
16051
16052 fi
16053
16054           elif test "2" = "2"; then
16055             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
16056 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
16057 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
16058 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
16059   $as_echo_n "(cached) " >&6
16060 else
16061   ac_check_lib_save_LIBS=$LIBS
16062 LIBS="-l$bdb_libname  $LIBS"
16063 cat >conftest.$ac_ext <<_ACEOF
16064 /* confdefs.h.  */
16065 _ACEOF
16066 cat confdefs.h >>conftest.$ac_ext
16067 cat >>conftest.$ac_ext <<_ACEOF
16068 /* end confdefs.h.  */
16069
16070 /* Override any GCC internal prototype to avoid an error.
16071    Use char because int might match the return type of a GCC
16072    builtin and then its argument prototype would still apply.  */
16073 #ifdef __cplusplus
16074 extern "C"
16075 #endif
16076 char db_open ();
16077 int
16078 main ()
16079 {
16080 return db_open ();
16081   ;
16082   return 0;
16083 }
16084 _ACEOF
16085 rm -f conftest.$ac_objext conftest$ac_exeext
16086 if { (ac_try="$ac_link"
16087 case "(($ac_try" in
16088   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16089   *) ac_try_echo=$ac_try;;
16090 esac
16091 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16092 $as_echo "$ac_try_echo") >&5
16093   (eval "$ac_link") 2>conftest.er1
16094   ac_status=$?
16095   grep -v '^ *+' conftest.er1 >conftest.err
16096   rm -f conftest.er1
16097   cat conftest.err >&5
16098   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16099   (exit $ac_status); } && {
16100          test -z "$ac_c_werror_flag" ||
16101          test ! -s conftest.err
16102        } && test -s conftest$ac_exeext && {
16103          test "$cross_compiling" = yes ||
16104          $as_test_x conftest$ac_exeext
16105        }; then
16106   eval "$as_ac_Lib=yes"
16107 else
16108   $as_echo "$as_me: failed program was:" >&5
16109 sed 's/^/| /' conftest.$ac_ext >&5
16110
16111         eval "$as_ac_Lib=no"
16112 fi
16113
16114 rm -rf conftest.dSYM
16115 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16116       conftest$ac_exeext conftest.$ac_ext
16117 LIBS=$ac_check_lib_save_LIBS
16118 fi
16119 ac_res=`eval 'as_val=${'$as_ac_Lib'}
16120                  $as_echo "$as_val"'`
16121                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16122 $as_echo "$ac_res" >&6; }
16123 as_val=`eval 'as_val=${'$as_ac_Lib'}
16124                  $as_echo "$as_val"'`
16125    if test "x$as_val" = x""yes; then
16126   result=yes
16127 else
16128   result=no
16129
16130 fi
16131
16132           fi
16133
16134 else
16135   result="no"
16136 fi
16137
16138
16139
16140         # If we found it, no need to search any more.
16141         if test "$result" = "yes"; then
16142           found="$bdb_place"
16143           break
16144         fi
16145       done
16146       test "$found" != "not" && break
16147     done
16148     test "$found" != "not" && break
16149   done
16150
16151   # Restore the original values of the flags we tweak.
16152   LDFLAGS="$apu_check_lib_save_ldflags"
16153   CPPFLAGS="$apu_check_lib_save_cppflags"
16154
16155   case "$found" in
16156   "not")
16157     apu_have_db=0
16158     ;;
16159   "std")
16160     apu_db_header=$bdb_header
16161     apu_db_lib=$bdb_libname
16162     apu_have_db=1
16163     ;;
16164   *":"*)
16165     header="`echo $found | sed -e 's/:.*$//'`"
16166     lib="`echo $found | sed -e 's/^.*://'`"
16167
16168
16169   if test "x$APRUTIL_INCLUDES" = "x"; then
16170     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
16171     APRUTIL_INCLUDES="-I$header"
16172   else
16173     apr_addto_bugger="-I$header"
16174     for i in $apr_addto_bugger; do
16175       apr_addto_duplicate="0"
16176       for j in $APRUTIL_INCLUDES; do
16177         if test "x$i" = "x$j"; then
16178           apr_addto_duplicate="1"
16179           break
16180         fi
16181       done
16182       if test $apr_addto_duplicate = "0"; then
16183         echo "  adding \"$i\" to APRUTIL_INCLUDES"
16184         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
16185       fi
16186     done
16187   fi
16188
16189
16190   if test "x$APRUTIL_LDFLAGS" = "x"; then
16191     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
16192     APRUTIL_LDFLAGS="-L$lib"
16193   else
16194     apr_addto_bugger="-L$lib"
16195     for i in $apr_addto_bugger; do
16196       apr_addto_duplicate="0"
16197       for j in $APRUTIL_LDFLAGS; do
16198         if test "x$i" = "x$j"; then
16199           apr_addto_duplicate="1"
16200           break
16201         fi
16202       done
16203       if test $apr_addto_duplicate = "0"; then
16204         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
16205         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
16206       fi
16207     done
16208   fi
16209
16210     apu_db_header=$bdb_header
16211     apu_db_lib=$bdb_libname
16212     apu_have_db=1
16213     ;;
16214   *)
16215
16216   if test "x$APRUTIL_INCLUDES" = "x"; then
16217     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
16218     APRUTIL_INCLUDES="-I$found/include"
16219   else
16220     apr_addto_bugger="-I$found/include"
16221     for i in $apr_addto_bugger; do
16222       apr_addto_duplicate="0"
16223       for j in $APRUTIL_INCLUDES; do
16224         if test "x$i" = "x$j"; then
16225           apr_addto_duplicate="1"
16226           break
16227         fi
16228       done
16229       if test $apr_addto_duplicate = "0"; then
16230         echo "  adding \"$i\" to APRUTIL_INCLUDES"
16231         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
16232       fi
16233     done
16234   fi
16235
16236
16237   if test "x$APRUTIL_LDFLAGS" = "x"; then
16238     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
16239     APRUTIL_LDFLAGS="-L$found/lib"
16240   else
16241     apr_addto_bugger="-L$found/lib"
16242     for i in $apr_addto_bugger; do
16243       apr_addto_duplicate="0"
16244       for j in $APRUTIL_LDFLAGS; do
16245         if test "x$i" = "x$j"; then
16246           apr_addto_duplicate="1"
16247           break
16248         fi
16249       done
16250       if test $apr_addto_duplicate = "0"; then
16251         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
16252         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
16253       fi
16254     done
16255   fi
16256
16257     apu_db_header=$bdb_header
16258     apu_db_lib=$bdb_libname
16259     apu_have_db=1
16260     ;;
16261   esac
16262
16263   if test "$apu_have_db" = "1"; then
16264     apu_db_version=2
16265   fi
16266
16267                       if test "$apu_db_version" != "2"; then
16268
16269   places="$all_places"
16270   if test -z "$places"; then
16271     places="std"
16272   fi
16273
16274   bdb_version=1
16275   if test "0" != "-1"; then
16276     bdb_version="$bdb_version.0"
16277     if test "0" != "-1"; then
16278       bdb_version="$bdb_version.0"
16279     fi
16280   fi
16281   bdb_places="$places"
16282   bdb_default_search_headers="db1/db.h db.h"
16283   bdb_default_search_lib_names="db1"
16284
16285
16286   apu_have_db=0
16287
16288   # Save the original values of the flags we tweak.
16289   apu_check_lib_save_libs="$LIBS"
16290   apu_check_lib_save_ldflags="$LDFLAGS"
16291   apu_check_lib_save_cppflags="$CPPFLAGS"
16292
16293   # The variable `found' is the prefix under which we've found
16294   # Berkeley DB, or `not' if we haven't found it anywhere yet.
16295   found=not
16296   for bdb_place in $bdb_places; do
16297
16298     LDFLAGS="$apu_check_lib_save_ldflags"
16299     CPPFLAGS="$apu_check_lib_save_cppflags"
16300     case "$bdb_place" in
16301       "std" )
16302         description="the standard places"
16303       ;;
16304       *":"* )
16305         header="`echo $bdb_place | sed -e 's/:.*$//'`"
16306         lib="`echo $bdb_place | sed -e 's/^.*://'`"
16307         CPPFLAGS="$CPPFLAGS -I$header"
16308         LDFLAGS="$LDFLAGS -L$lib"
16309         description="$header and $lib"
16310       ;;
16311       * )
16312         if test -d $bdb_place; then
16313           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
16314           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
16315         else
16316           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
16317 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
16318           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
16319 $as_echo "directory not found" >&6; }
16320           continue
16321         fi
16322         description="$bdb_place"
16323       ;;
16324     esac
16325
16326     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
16327     # trick to display a message instead.
16328     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
16329 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
16330     { $as_echo "$as_me:$LINENO: result: " >&5
16331 $as_echo "" >&6; }
16332
16333     for bdb_libname in $bdb_default_search_lib_names; do
16334       for bdb_header in $bdb_default_search_headers; do
16335         # Clear the header cache variable for each location
16336
16337         cache_id="`echo ac_cv_header_${bdb_header} \
16338                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
16339
16340         unset $cache_id
16341         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
16342 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16343   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
16344 $as_echo_n "checking for $bdb_header... " >&6; }
16345 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16346   $as_echo_n "(cached) " >&6
16347 fi
16348 ac_res=`eval 'as_val=${'$as_ac_Header'}
16349                  $as_echo "$as_val"'`
16350                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16351 $as_echo "$ac_res" >&6; }
16352 else
16353   # Is the header compilable?
16354 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
16355 $as_echo_n "checking $bdb_header usability... " >&6; }
16356 cat >conftest.$ac_ext <<_ACEOF
16357 /* confdefs.h.  */
16358 _ACEOF
16359 cat confdefs.h >>conftest.$ac_ext
16360 cat >>conftest.$ac_ext <<_ACEOF
16361 /* end confdefs.h.  */
16362 $ac_includes_default
16363 #include <$bdb_header>
16364 _ACEOF
16365 rm -f conftest.$ac_objext
16366 if { (ac_try="$ac_compile"
16367 case "(($ac_try" in
16368   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16369   *) ac_try_echo=$ac_try;;
16370 esac
16371 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16372 $as_echo "$ac_try_echo") >&5
16373   (eval "$ac_compile") 2>conftest.er1
16374   ac_status=$?
16375   grep -v '^ *+' conftest.er1 >conftest.err
16376   rm -f conftest.er1
16377   cat conftest.err >&5
16378   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16379   (exit $ac_status); } && {
16380          test -z "$ac_c_werror_flag" ||
16381          test ! -s conftest.err
16382        } && test -s conftest.$ac_objext; then
16383   ac_header_compiler=yes
16384 else
16385   $as_echo "$as_me: failed program was:" >&5
16386 sed 's/^/| /' conftest.$ac_ext >&5
16387
16388         ac_header_compiler=no
16389 fi
16390
16391 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16392 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
16393 $as_echo "$ac_header_compiler" >&6; }
16394
16395 # Is the header present?
16396 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
16397 $as_echo_n "checking $bdb_header presence... " >&6; }
16398 cat >conftest.$ac_ext <<_ACEOF
16399 /* confdefs.h.  */
16400 _ACEOF
16401 cat confdefs.h >>conftest.$ac_ext
16402 cat >>conftest.$ac_ext <<_ACEOF
16403 /* end confdefs.h.  */
16404 #include <$bdb_header>
16405 _ACEOF
16406 if { (ac_try="$ac_cpp conftest.$ac_ext"
16407 case "(($ac_try" in
16408   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16409   *) ac_try_echo=$ac_try;;
16410 esac
16411 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16412 $as_echo "$ac_try_echo") >&5
16413   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
16414   ac_status=$?
16415   grep -v '^ *+' conftest.er1 >conftest.err
16416   rm -f conftest.er1
16417   cat conftest.err >&5
16418   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16419   (exit $ac_status); } >/dev/null && {
16420          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
16421          test ! -s conftest.err
16422        }; then
16423   ac_header_preproc=yes
16424 else
16425   $as_echo "$as_me: failed program was:" >&5
16426 sed 's/^/| /' conftest.$ac_ext >&5
16427
16428   ac_header_preproc=no
16429 fi
16430
16431 rm -f conftest.err conftest.$ac_ext
16432 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
16433 $as_echo "$ac_header_preproc" >&6; }
16434
16435 # So?  What about this header?
16436 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
16437   yes:no: )
16438     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
16439 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
16440     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
16441 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
16442     ac_header_preproc=yes
16443     ;;
16444   no:yes:* )
16445     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
16446 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
16447     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
16448 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
16449     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
16450 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
16451     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
16452 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
16453     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
16454 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
16455     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
16456 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
16457
16458     ;;
16459 esac
16460 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
16461 $as_echo_n "checking for $bdb_header... " >&6; }
16462 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16463   $as_echo_n "(cached) " >&6
16464 else
16465   eval "$as_ac_Header=\$ac_header_preproc"
16466 fi
16467 ac_res=`eval 'as_val=${'$as_ac_Header'}
16468                  $as_echo "$as_val"'`
16469                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16470 $as_echo "$ac_res" >&6; }
16471
16472 fi
16473 as_val=`eval 'as_val=${'$as_ac_Header'}
16474                  $as_echo "$as_val"'`
16475    if test "x$as_val" = x""yes; then
16476
16477           if test "1" = "3" -o "1" = "4"; then
16478             # We generate a separate cache variable for each prefix and libname
16479             # we search under.  That way, we avoid caching information that
16480             # changes if the user runs `configure' with a different set of
16481             # switches.
16482
16483             cache_id="`echo apu_cv_check_berkeley_db_1_0_0_${bdb_header}_${bdb_libname}_in_${bdb_place} \
16484                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
16485
16486
16487             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
16488 $as_echo_n "checking for -l$bdb_libname... " >&6; }
16489                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
16490   $as_echo_n "(cached) " >&6
16491 else
16492
16493
16494     apu_try_berkeley_db_save_libs="$LIBS"
16495
16496     apu_check_berkeley_db_major=1
16497     apu_check_berkeley_db_minor=0
16498     apu_check_berkeley_db_patch=0
16499     apu_try_berkeley_db_header=$bdb_header
16500     apu_try_berkeley_db_libname=$bdb_libname
16501
16502     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
16503     if test "$cross_compiling" = yes; then
16504   apu_try_berkeley_db=yes
16505
16506 else
16507   cat >conftest.$ac_ext <<_ACEOF
16508 /* confdefs.h.  */
16509 _ACEOF
16510 cat confdefs.h >>conftest.$ac_ext
16511 cat >>conftest.$ac_ext <<_ACEOF
16512 /* end confdefs.h.  */
16513
16514 #include <stdlib.h>
16515 #include <stdio.h>
16516 #include <$apu_try_berkeley_db_header>
16517 main ()
16518 {
16519   int major, minor, patch;
16520
16521   db_version(&major, &minor, &patch);
16522
16523   /* Sanity check: ensure that db.h constants actually match the db library */
16524   if (major != DB_VERSION_MAJOR
16525       || minor != DB_VERSION_MINOR
16526       || patch != DB_VERSION_PATCH)
16527     exit (1);
16528
16529   /* Run-time check:  ensure the library claims to be the correct version. */
16530
16531   if ($apu_check_berkeley_db_major != -1) {
16532     if (major < $apu_check_berkeley_db_major)
16533       exit (1);
16534     if (major > $apu_check_berkeley_db_major)
16535       exit (0);
16536   }
16537
16538   if ($apu_check_berkeley_db_minor != -1) {
16539     if (minor < $apu_check_berkeley_db_minor)
16540       exit (1);
16541     if (minor > $apu_check_berkeley_db_minor)
16542       exit (0);
16543   }
16544
16545   if ($apu_check_berkeley_db_patch == -1
16546       || patch >= $apu_check_berkeley_db_patch)
16547     exit (0);
16548   else
16549     exit (1);
16550 }
16551
16552 _ACEOF
16553 rm -f conftest$ac_exeext
16554 if { (ac_try="$ac_link"
16555 case "(($ac_try" in
16556   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16557   *) ac_try_echo=$ac_try;;
16558 esac
16559 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16560 $as_echo "$ac_try_echo") >&5
16561   (eval "$ac_link") 2>&5
16562   ac_status=$?
16563   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16564   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16565   { (case "(($ac_try" in
16566   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16567   *) ac_try_echo=$ac_try;;
16568 esac
16569 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16570 $as_echo "$ac_try_echo") >&5
16571   (eval "$ac_try") 2>&5
16572   ac_status=$?
16573   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16574   (exit $ac_status); }; }; then
16575   apu_try_berkeley_db=yes
16576 else
16577   $as_echo "$as_me: program exited with status $ac_status" >&5
16578 $as_echo "$as_me: failed program was:" >&5
16579 sed 's/^/| /' conftest.$ac_ext >&5
16580
16581 ( exit $ac_status )
16582 apu_try_berkeley_db=no
16583 fi
16584 rm -rf conftest.dSYM
16585 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16586 fi
16587
16588
16589
16590     LIBS="$apu_try_berkeley_db_save_libs"
16591
16592
16593                 eval "$cache_id=$apu_try_berkeley_db"
16594
16595 fi
16596
16597             result="`eval echo '$'$cache_id`"
16598             { $as_echo "$as_me:$LINENO: result: $result" >&5
16599 $as_echo "$result" >&6; }
16600           elif test "1" = "1"; then
16601             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
16602 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
16603 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
16604 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
16605   $as_echo_n "(cached) " >&6
16606 else
16607   ac_check_lib_save_LIBS=$LIBS
16608 LIBS="-l$bdb_libname  $LIBS"
16609 cat >conftest.$ac_ext <<_ACEOF
16610 /* confdefs.h.  */
16611 _ACEOF
16612 cat confdefs.h >>conftest.$ac_ext
16613 cat >>conftest.$ac_ext <<_ACEOF
16614 /* end confdefs.h.  */
16615
16616 /* Override any GCC internal prototype to avoid an error.
16617    Use char because int might match the return type of a GCC
16618    builtin and then its argument prototype would still apply.  */
16619 #ifdef __cplusplus
16620 extern "C"
16621 #endif
16622 char dbopen ();
16623 int
16624 main ()
16625 {
16626 return dbopen ();
16627   ;
16628   return 0;
16629 }
16630 _ACEOF
16631 rm -f conftest.$ac_objext conftest$ac_exeext
16632 if { (ac_try="$ac_link"
16633 case "(($ac_try" in
16634   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16635   *) ac_try_echo=$ac_try;;
16636 esac
16637 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16638 $as_echo "$ac_try_echo") >&5
16639   (eval "$ac_link") 2>conftest.er1
16640   ac_status=$?
16641   grep -v '^ *+' conftest.er1 >conftest.err
16642   rm -f conftest.er1
16643   cat conftest.err >&5
16644   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16645   (exit $ac_status); } && {
16646          test -z "$ac_c_werror_flag" ||
16647          test ! -s conftest.err
16648        } && test -s conftest$ac_exeext && {
16649          test "$cross_compiling" = yes ||
16650          $as_test_x conftest$ac_exeext
16651        }; then
16652   eval "$as_ac_Lib=yes"
16653 else
16654   $as_echo "$as_me: failed program was:" >&5
16655 sed 's/^/| /' conftest.$ac_ext >&5
16656
16657         eval "$as_ac_Lib=no"
16658 fi
16659
16660 rm -rf conftest.dSYM
16661 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16662       conftest$ac_exeext conftest.$ac_ext
16663 LIBS=$ac_check_lib_save_LIBS
16664 fi
16665 ac_res=`eval 'as_val=${'$as_ac_Lib'}
16666                  $as_echo "$as_val"'`
16667                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16668 $as_echo "$ac_res" >&6; }
16669 as_val=`eval 'as_val=${'$as_ac_Lib'}
16670                  $as_echo "$as_val"'`
16671    if test "x$as_val" = x""yes; then
16672   result=yes
16673 else
16674   result=no
16675
16676 fi
16677
16678           elif test "1" = "2"; then
16679             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
16680 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
16681 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
16682 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
16683   $as_echo_n "(cached) " >&6
16684 else
16685   ac_check_lib_save_LIBS=$LIBS
16686 LIBS="-l$bdb_libname  $LIBS"
16687 cat >conftest.$ac_ext <<_ACEOF
16688 /* confdefs.h.  */
16689 _ACEOF
16690 cat confdefs.h >>conftest.$ac_ext
16691 cat >>conftest.$ac_ext <<_ACEOF
16692 /* end confdefs.h.  */
16693
16694 /* Override any GCC internal prototype to avoid an error.
16695    Use char because int might match the return type of a GCC
16696    builtin and then its argument prototype would still apply.  */
16697 #ifdef __cplusplus
16698 extern "C"
16699 #endif
16700 char db_open ();
16701 int
16702 main ()
16703 {
16704 return db_open ();
16705   ;
16706   return 0;
16707 }
16708 _ACEOF
16709 rm -f conftest.$ac_objext conftest$ac_exeext
16710 if { (ac_try="$ac_link"
16711 case "(($ac_try" in
16712   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16713   *) ac_try_echo=$ac_try;;
16714 esac
16715 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16716 $as_echo "$ac_try_echo") >&5
16717   (eval "$ac_link") 2>conftest.er1
16718   ac_status=$?
16719   grep -v '^ *+' conftest.er1 >conftest.err
16720   rm -f conftest.er1
16721   cat conftest.err >&5
16722   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16723   (exit $ac_status); } && {
16724          test -z "$ac_c_werror_flag" ||
16725          test ! -s conftest.err
16726        } && test -s conftest$ac_exeext && {
16727          test "$cross_compiling" = yes ||
16728          $as_test_x conftest$ac_exeext
16729        }; then
16730   eval "$as_ac_Lib=yes"
16731 else
16732   $as_echo "$as_me: failed program was:" >&5
16733 sed 's/^/| /' conftest.$ac_ext >&5
16734
16735         eval "$as_ac_Lib=no"
16736 fi
16737
16738 rm -rf conftest.dSYM
16739 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16740       conftest$ac_exeext conftest.$ac_ext
16741 LIBS=$ac_check_lib_save_LIBS
16742 fi
16743 ac_res=`eval 'as_val=${'$as_ac_Lib'}
16744                  $as_echo "$as_val"'`
16745                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16746 $as_echo "$ac_res" >&6; }
16747 as_val=`eval 'as_val=${'$as_ac_Lib'}
16748                  $as_echo "$as_val"'`
16749    if test "x$as_val" = x""yes; then
16750   result=yes
16751 else
16752   result=no
16753
16754 fi
16755
16756           fi
16757
16758 else
16759   result="no"
16760 fi
16761
16762
16763
16764         # If we found it, no need to search any more.
16765         if test "$result" = "yes"; then
16766           found="$bdb_place"
16767           break
16768         fi
16769       done
16770       test "$found" != "not" && break
16771     done
16772     test "$found" != "not" && break
16773   done
16774
16775   # Restore the original values of the flags we tweak.
16776   LDFLAGS="$apu_check_lib_save_ldflags"
16777   CPPFLAGS="$apu_check_lib_save_cppflags"
16778
16779   case "$found" in
16780   "not")
16781     apu_have_db=0
16782     ;;
16783   "std")
16784     apu_db_header=$bdb_header
16785     apu_db_lib=$bdb_libname
16786     apu_have_db=1
16787     ;;
16788   *":"*)
16789     header="`echo $found | sed -e 's/:.*$//'`"
16790     lib="`echo $found | sed -e 's/^.*://'`"
16791
16792
16793   if test "x$APRUTIL_INCLUDES" = "x"; then
16794     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
16795     APRUTIL_INCLUDES="-I$header"
16796   else
16797     apr_addto_bugger="-I$header"
16798     for i in $apr_addto_bugger; do
16799       apr_addto_duplicate="0"
16800       for j in $APRUTIL_INCLUDES; do
16801         if test "x$i" = "x$j"; then
16802           apr_addto_duplicate="1"
16803           break
16804         fi
16805       done
16806       if test $apr_addto_duplicate = "0"; then
16807         echo "  adding \"$i\" to APRUTIL_INCLUDES"
16808         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
16809       fi
16810     done
16811   fi
16812
16813
16814   if test "x$APRUTIL_LDFLAGS" = "x"; then
16815     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
16816     APRUTIL_LDFLAGS="-L$lib"
16817   else
16818     apr_addto_bugger="-L$lib"
16819     for i in $apr_addto_bugger; do
16820       apr_addto_duplicate="0"
16821       for j in $APRUTIL_LDFLAGS; do
16822         if test "x$i" = "x$j"; then
16823           apr_addto_duplicate="1"
16824           break
16825         fi
16826       done
16827       if test $apr_addto_duplicate = "0"; then
16828         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
16829         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
16830       fi
16831     done
16832   fi
16833
16834     apu_db_header=$bdb_header
16835     apu_db_lib=$bdb_libname
16836     apu_have_db=1
16837     ;;
16838   *)
16839
16840   if test "x$APRUTIL_INCLUDES" = "x"; then
16841     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
16842     APRUTIL_INCLUDES="-I$found/include"
16843   else
16844     apr_addto_bugger="-I$found/include"
16845     for i in $apr_addto_bugger; do
16846       apr_addto_duplicate="0"
16847       for j in $APRUTIL_INCLUDES; do
16848         if test "x$i" = "x$j"; then
16849           apr_addto_duplicate="1"
16850           break
16851         fi
16852       done
16853       if test $apr_addto_duplicate = "0"; then
16854         echo "  adding \"$i\" to APRUTIL_INCLUDES"
16855         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
16856       fi
16857     done
16858   fi
16859
16860
16861   if test "x$APRUTIL_LDFLAGS" = "x"; then
16862     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
16863     APRUTIL_LDFLAGS="-L$found/lib"
16864   else
16865     apr_addto_bugger="-L$found/lib"
16866     for i in $apr_addto_bugger; do
16867       apr_addto_duplicate="0"
16868       for j in $APRUTIL_LDFLAGS; do
16869         if test "x$i" = "x$j"; then
16870           apr_addto_duplicate="1"
16871           break
16872         fi
16873       done
16874       if test $apr_addto_duplicate = "0"; then
16875         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
16876         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
16877       fi
16878     done
16879   fi
16880
16881     apu_db_header=$bdb_header
16882     apu_db_lib=$bdb_libname
16883     apu_have_db=1
16884     ;;
16885   esac
16886
16887   if test "$apu_have_db" = "1"; then
16888     apu_db_version=1
16889   fi
16890
16891                         if test "$apu_db_version" != "1"; then
16892
16893   places="$all_places"
16894   if test -z "$places"; then
16895     places="std"
16896   fi
16897
16898   bdb_version=1
16899   if test "-1" != "-1"; then
16900     bdb_version="$bdb_version.-1"
16901     if test "-1" != "-1"; then
16902       bdb_version="$bdb_version.-1"
16903     fi
16904   fi
16905   bdb_places="$places"
16906   bdb_default_search_headers="db_185.h"
16907   bdb_default_search_lib_names="db"
16908
16909
16910   apu_have_db=0
16911
16912   # Save the original values of the flags we tweak.
16913   apu_check_lib_save_libs="$LIBS"
16914   apu_check_lib_save_ldflags="$LDFLAGS"
16915   apu_check_lib_save_cppflags="$CPPFLAGS"
16916
16917   # The variable `found' is the prefix under which we've found
16918   # Berkeley DB, or `not' if we haven't found it anywhere yet.
16919   found=not
16920   for bdb_place in $bdb_places; do
16921
16922     LDFLAGS="$apu_check_lib_save_ldflags"
16923     CPPFLAGS="$apu_check_lib_save_cppflags"
16924     case "$bdb_place" in
16925       "std" )
16926         description="the standard places"
16927       ;;
16928       *":"* )
16929         header="`echo $bdb_place | sed -e 's/:.*$//'`"
16930         lib="`echo $bdb_place | sed -e 's/^.*://'`"
16931         CPPFLAGS="$CPPFLAGS -I$header"
16932         LDFLAGS="$LDFLAGS -L$lib"
16933         description="$header and $lib"
16934       ;;
16935       * )
16936         if test -d $bdb_place; then
16937           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
16938           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
16939         else
16940           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
16941 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
16942           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
16943 $as_echo "directory not found" >&6; }
16944           continue
16945         fi
16946         description="$bdb_place"
16947       ;;
16948     esac
16949
16950     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
16951     # trick to display a message instead.
16952     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
16953 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
16954     { $as_echo "$as_me:$LINENO: result: " >&5
16955 $as_echo "" >&6; }
16956
16957     for bdb_libname in $bdb_default_search_lib_names; do
16958       for bdb_header in $bdb_default_search_headers; do
16959         # Clear the header cache variable for each location
16960
16961         cache_id="`echo ac_cv_header_${bdb_header} \
16962                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
16963
16964         unset $cache_id
16965         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
16966 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16967   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
16968 $as_echo_n "checking for $bdb_header... " >&6; }
16969 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16970   $as_echo_n "(cached) " >&6
16971 fi
16972 ac_res=`eval 'as_val=${'$as_ac_Header'}
16973                  $as_echo "$as_val"'`
16974                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16975 $as_echo "$ac_res" >&6; }
16976 else
16977   # Is the header compilable?
16978 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
16979 $as_echo_n "checking $bdb_header usability... " >&6; }
16980 cat >conftest.$ac_ext <<_ACEOF
16981 /* confdefs.h.  */
16982 _ACEOF
16983 cat confdefs.h >>conftest.$ac_ext
16984 cat >>conftest.$ac_ext <<_ACEOF
16985 /* end confdefs.h.  */
16986 $ac_includes_default
16987 #include <$bdb_header>
16988 _ACEOF
16989 rm -f conftest.$ac_objext
16990 if { (ac_try="$ac_compile"
16991 case "(($ac_try" in
16992   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16993   *) ac_try_echo=$ac_try;;
16994 esac
16995 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16996 $as_echo "$ac_try_echo") >&5
16997   (eval "$ac_compile") 2>conftest.er1
16998   ac_status=$?
16999   grep -v '^ *+' conftest.er1 >conftest.err
17000   rm -f conftest.er1
17001   cat conftest.err >&5
17002   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17003   (exit $ac_status); } && {
17004          test -z "$ac_c_werror_flag" ||
17005          test ! -s conftest.err
17006        } && test -s conftest.$ac_objext; then
17007   ac_header_compiler=yes
17008 else
17009   $as_echo "$as_me: failed program was:" >&5
17010 sed 's/^/| /' conftest.$ac_ext >&5
17011
17012         ac_header_compiler=no
17013 fi
17014
17015 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17016 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
17017 $as_echo "$ac_header_compiler" >&6; }
17018
17019 # Is the header present?
17020 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
17021 $as_echo_n "checking $bdb_header presence... " >&6; }
17022 cat >conftest.$ac_ext <<_ACEOF
17023 /* confdefs.h.  */
17024 _ACEOF
17025 cat confdefs.h >>conftest.$ac_ext
17026 cat >>conftest.$ac_ext <<_ACEOF
17027 /* end confdefs.h.  */
17028 #include <$bdb_header>
17029 _ACEOF
17030 if { (ac_try="$ac_cpp conftest.$ac_ext"
17031 case "(($ac_try" in
17032   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17033   *) ac_try_echo=$ac_try;;
17034 esac
17035 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17036 $as_echo "$ac_try_echo") >&5
17037   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
17038   ac_status=$?
17039   grep -v '^ *+' conftest.er1 >conftest.err
17040   rm -f conftest.er1
17041   cat conftest.err >&5
17042   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17043   (exit $ac_status); } >/dev/null && {
17044          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
17045          test ! -s conftest.err
17046        }; then
17047   ac_header_preproc=yes
17048 else
17049   $as_echo "$as_me: failed program was:" >&5
17050 sed 's/^/| /' conftest.$ac_ext >&5
17051
17052   ac_header_preproc=no
17053 fi
17054
17055 rm -f conftest.err conftest.$ac_ext
17056 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
17057 $as_echo "$ac_header_preproc" >&6; }
17058
17059 # So?  What about this header?
17060 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
17061   yes:no: )
17062     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
17063 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
17064     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
17065 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
17066     ac_header_preproc=yes
17067     ;;
17068   no:yes:* )
17069     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
17070 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
17071     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
17072 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
17073     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
17074 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
17075     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
17076 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
17077     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
17078 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
17079     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
17080 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
17081
17082     ;;
17083 esac
17084 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
17085 $as_echo_n "checking for $bdb_header... " >&6; }
17086 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17087   $as_echo_n "(cached) " >&6
17088 else
17089   eval "$as_ac_Header=\$ac_header_preproc"
17090 fi
17091 ac_res=`eval 'as_val=${'$as_ac_Header'}
17092                  $as_echo "$as_val"'`
17093                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
17094 $as_echo "$ac_res" >&6; }
17095
17096 fi
17097 as_val=`eval 'as_val=${'$as_ac_Header'}
17098                  $as_echo "$as_val"'`
17099    if test "x$as_val" = x""yes; then
17100
17101           if test "1" = "3" -o "1" = "4"; then
17102             # We generate a separate cache variable for each prefix and libname
17103             # we search under.  That way, we avoid caching information that
17104             # changes if the user runs `configure' with a different set of
17105             # switches.
17106
17107             cache_id="`echo apu_cv_check_berkeley_db_1_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
17108                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
17109
17110
17111             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
17112 $as_echo_n "checking for -l$bdb_libname... " >&6; }
17113                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
17114   $as_echo_n "(cached) " >&6
17115 else
17116
17117
17118     apu_try_berkeley_db_save_libs="$LIBS"
17119
17120     apu_check_berkeley_db_major=1
17121     apu_check_berkeley_db_minor=-1
17122     apu_check_berkeley_db_patch=-1
17123     apu_try_berkeley_db_header=$bdb_header
17124     apu_try_berkeley_db_libname=$bdb_libname
17125
17126     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
17127     if test "$cross_compiling" = yes; then
17128   apu_try_berkeley_db=yes
17129
17130 else
17131   cat >conftest.$ac_ext <<_ACEOF
17132 /* confdefs.h.  */
17133 _ACEOF
17134 cat confdefs.h >>conftest.$ac_ext
17135 cat >>conftest.$ac_ext <<_ACEOF
17136 /* end confdefs.h.  */
17137
17138 #include <stdlib.h>
17139 #include <stdio.h>
17140 #include <$apu_try_berkeley_db_header>
17141 main ()
17142 {
17143   int major, minor, patch;
17144
17145   db_version(&major, &minor, &patch);
17146
17147   /* Sanity check: ensure that db.h constants actually match the db library */
17148   if (major != DB_VERSION_MAJOR
17149       || minor != DB_VERSION_MINOR
17150       || patch != DB_VERSION_PATCH)
17151     exit (1);
17152
17153   /* Run-time check:  ensure the library claims to be the correct version. */
17154
17155   if ($apu_check_berkeley_db_major != -1) {
17156     if (major < $apu_check_berkeley_db_major)
17157       exit (1);
17158     if (major > $apu_check_berkeley_db_major)
17159       exit (0);
17160   }
17161
17162   if ($apu_check_berkeley_db_minor != -1) {
17163     if (minor < $apu_check_berkeley_db_minor)
17164       exit (1);
17165     if (minor > $apu_check_berkeley_db_minor)
17166       exit (0);
17167   }
17168
17169   if ($apu_check_berkeley_db_patch == -1
17170       || patch >= $apu_check_berkeley_db_patch)
17171     exit (0);
17172   else
17173     exit (1);
17174 }
17175
17176 _ACEOF
17177 rm -f conftest$ac_exeext
17178 if { (ac_try="$ac_link"
17179 case "(($ac_try" in
17180   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17181   *) ac_try_echo=$ac_try;;
17182 esac
17183 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17184 $as_echo "$ac_try_echo") >&5
17185   (eval "$ac_link") 2>&5
17186   ac_status=$?
17187   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17188   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17189   { (case "(($ac_try" in
17190   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17191   *) ac_try_echo=$ac_try;;
17192 esac
17193 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17194 $as_echo "$ac_try_echo") >&5
17195   (eval "$ac_try") 2>&5
17196   ac_status=$?
17197   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17198   (exit $ac_status); }; }; then
17199   apu_try_berkeley_db=yes
17200 else
17201   $as_echo "$as_me: program exited with status $ac_status" >&5
17202 $as_echo "$as_me: failed program was:" >&5
17203 sed 's/^/| /' conftest.$ac_ext >&5
17204
17205 ( exit $ac_status )
17206 apu_try_berkeley_db=no
17207 fi
17208 rm -rf conftest.dSYM
17209 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17210 fi
17211
17212
17213
17214     LIBS="$apu_try_berkeley_db_save_libs"
17215
17216
17217                 eval "$cache_id=$apu_try_berkeley_db"
17218
17219 fi
17220
17221             result="`eval echo '$'$cache_id`"
17222             { $as_echo "$as_me:$LINENO: result: $result" >&5
17223 $as_echo "$result" >&6; }
17224           elif test "1" = "1"; then
17225             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
17226 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
17227 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
17228 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
17229   $as_echo_n "(cached) " >&6
17230 else
17231   ac_check_lib_save_LIBS=$LIBS
17232 LIBS="-l$bdb_libname  $LIBS"
17233 cat >conftest.$ac_ext <<_ACEOF
17234 /* confdefs.h.  */
17235 _ACEOF
17236 cat confdefs.h >>conftest.$ac_ext
17237 cat >>conftest.$ac_ext <<_ACEOF
17238 /* end confdefs.h.  */
17239
17240 /* Override any GCC internal prototype to avoid an error.
17241    Use char because int might match the return type of a GCC
17242    builtin and then its argument prototype would still apply.  */
17243 #ifdef __cplusplus
17244 extern "C"
17245 #endif
17246 char dbopen ();
17247 int
17248 main ()
17249 {
17250 return dbopen ();
17251   ;
17252   return 0;
17253 }
17254 _ACEOF
17255 rm -f conftest.$ac_objext conftest$ac_exeext
17256 if { (ac_try="$ac_link"
17257 case "(($ac_try" in
17258   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17259   *) ac_try_echo=$ac_try;;
17260 esac
17261 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17262 $as_echo "$ac_try_echo") >&5
17263   (eval "$ac_link") 2>conftest.er1
17264   ac_status=$?
17265   grep -v '^ *+' conftest.er1 >conftest.err
17266   rm -f conftest.er1
17267   cat conftest.err >&5
17268   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17269   (exit $ac_status); } && {
17270          test -z "$ac_c_werror_flag" ||
17271          test ! -s conftest.err
17272        } && test -s conftest$ac_exeext && {
17273          test "$cross_compiling" = yes ||
17274          $as_test_x conftest$ac_exeext
17275        }; then
17276   eval "$as_ac_Lib=yes"
17277 else
17278   $as_echo "$as_me: failed program was:" >&5
17279 sed 's/^/| /' conftest.$ac_ext >&5
17280
17281         eval "$as_ac_Lib=no"
17282 fi
17283
17284 rm -rf conftest.dSYM
17285 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
17286       conftest$ac_exeext conftest.$ac_ext
17287 LIBS=$ac_check_lib_save_LIBS
17288 fi
17289 ac_res=`eval 'as_val=${'$as_ac_Lib'}
17290                  $as_echo "$as_val"'`
17291                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
17292 $as_echo "$ac_res" >&6; }
17293 as_val=`eval 'as_val=${'$as_ac_Lib'}
17294                  $as_echo "$as_val"'`
17295    if test "x$as_val" = x""yes; then
17296   result=yes
17297 else
17298   result=no
17299
17300 fi
17301
17302           elif test "1" = "2"; then
17303             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
17304 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
17305 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
17306 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
17307   $as_echo_n "(cached) " >&6
17308 else
17309   ac_check_lib_save_LIBS=$LIBS
17310 LIBS="-l$bdb_libname  $LIBS"
17311 cat >conftest.$ac_ext <<_ACEOF
17312 /* confdefs.h.  */
17313 _ACEOF
17314 cat confdefs.h >>conftest.$ac_ext
17315 cat >>conftest.$ac_ext <<_ACEOF
17316 /* end confdefs.h.  */
17317
17318 /* Override any GCC internal prototype to avoid an error.
17319    Use char because int might match the return type of a GCC
17320    builtin and then its argument prototype would still apply.  */
17321 #ifdef __cplusplus
17322 extern "C"
17323 #endif
17324 char db_open ();
17325 int
17326 main ()
17327 {
17328 return db_open ();
17329   ;
17330   return 0;
17331 }
17332 _ACEOF
17333 rm -f conftest.$ac_objext conftest$ac_exeext
17334 if { (ac_try="$ac_link"
17335 case "(($ac_try" in
17336   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17337   *) ac_try_echo=$ac_try;;
17338 esac
17339 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17340 $as_echo "$ac_try_echo") >&5
17341   (eval "$ac_link") 2>conftest.er1
17342   ac_status=$?
17343   grep -v '^ *+' conftest.er1 >conftest.err
17344   rm -f conftest.er1
17345   cat conftest.err >&5
17346   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17347   (exit $ac_status); } && {
17348          test -z "$ac_c_werror_flag" ||
17349          test ! -s conftest.err
17350        } && test -s conftest$ac_exeext && {
17351          test "$cross_compiling" = yes ||
17352          $as_test_x conftest$ac_exeext
17353        }; then
17354   eval "$as_ac_Lib=yes"
17355 else
17356   $as_echo "$as_me: failed program was:" >&5
17357 sed 's/^/| /' conftest.$ac_ext >&5
17358
17359         eval "$as_ac_Lib=no"
17360 fi
17361
17362 rm -rf conftest.dSYM
17363 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
17364       conftest$ac_exeext conftest.$ac_ext
17365 LIBS=$ac_check_lib_save_LIBS
17366 fi
17367 ac_res=`eval 'as_val=${'$as_ac_Lib'}
17368                  $as_echo "$as_val"'`
17369                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
17370 $as_echo "$ac_res" >&6; }
17371 as_val=`eval 'as_val=${'$as_ac_Lib'}
17372                  $as_echo "$as_val"'`
17373    if test "x$as_val" = x""yes; then
17374   result=yes
17375 else
17376   result=no
17377
17378 fi
17379
17380           fi
17381
17382 else
17383   result="no"
17384 fi
17385
17386
17387
17388         # If we found it, no need to search any more.
17389         if test "$result" = "yes"; then
17390           found="$bdb_place"
17391           break
17392         fi
17393       done
17394       test "$found" != "not" && break
17395     done
17396     test "$found" != "not" && break
17397   done
17398
17399   # Restore the original values of the flags we tweak.
17400   LDFLAGS="$apu_check_lib_save_ldflags"
17401   CPPFLAGS="$apu_check_lib_save_cppflags"
17402
17403   case "$found" in
17404   "not")
17405     apu_have_db=0
17406     ;;
17407   "std")
17408     apu_db_header=$bdb_header
17409     apu_db_lib=$bdb_libname
17410     apu_have_db=1
17411     ;;
17412   *":"*)
17413     header="`echo $found | sed -e 's/:.*$//'`"
17414     lib="`echo $found | sed -e 's/^.*://'`"
17415
17416
17417   if test "x$APRUTIL_INCLUDES" = "x"; then
17418     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
17419     APRUTIL_INCLUDES="-I$header"
17420   else
17421     apr_addto_bugger="-I$header"
17422     for i in $apr_addto_bugger; do
17423       apr_addto_duplicate="0"
17424       for j in $APRUTIL_INCLUDES; do
17425         if test "x$i" = "x$j"; then
17426           apr_addto_duplicate="1"
17427           break
17428         fi
17429       done
17430       if test $apr_addto_duplicate = "0"; then
17431         echo "  adding \"$i\" to APRUTIL_INCLUDES"
17432         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
17433       fi
17434     done
17435   fi
17436
17437
17438   if test "x$APRUTIL_LDFLAGS" = "x"; then
17439     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
17440     APRUTIL_LDFLAGS="-L$lib"
17441   else
17442     apr_addto_bugger="-L$lib"
17443     for i in $apr_addto_bugger; do
17444       apr_addto_duplicate="0"
17445       for j in $APRUTIL_LDFLAGS; do
17446         if test "x$i" = "x$j"; then
17447           apr_addto_duplicate="1"
17448           break
17449         fi
17450       done
17451       if test $apr_addto_duplicate = "0"; then
17452         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
17453         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
17454       fi
17455     done
17456   fi
17457
17458     apu_db_header=$bdb_header
17459     apu_db_lib=$bdb_libname
17460     apu_have_db=1
17461     ;;
17462   *)
17463
17464   if test "x$APRUTIL_INCLUDES" = "x"; then
17465     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
17466     APRUTIL_INCLUDES="-I$found/include"
17467   else
17468     apr_addto_bugger="-I$found/include"
17469     for i in $apr_addto_bugger; do
17470       apr_addto_duplicate="0"
17471       for j in $APRUTIL_INCLUDES; do
17472         if test "x$i" = "x$j"; then
17473           apr_addto_duplicate="1"
17474           break
17475         fi
17476       done
17477       if test $apr_addto_duplicate = "0"; then
17478         echo "  adding \"$i\" to APRUTIL_INCLUDES"
17479         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
17480       fi
17481     done
17482   fi
17483
17484
17485   if test "x$APRUTIL_LDFLAGS" = "x"; then
17486     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
17487     APRUTIL_LDFLAGS="-L$found/lib"
17488   else
17489     apr_addto_bugger="-L$found/lib"
17490     for i in $apr_addto_bugger; do
17491       apr_addto_duplicate="0"
17492       for j in $APRUTIL_LDFLAGS; do
17493         if test "x$i" = "x$j"; then
17494           apr_addto_duplicate="1"
17495           break
17496         fi
17497       done
17498       if test $apr_addto_duplicate = "0"; then
17499         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
17500         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
17501       fi
17502     done
17503   fi
17504
17505     apu_db_header=$bdb_header
17506     apu_db_lib=$bdb_libname
17507     apu_have_db=1
17508     ;;
17509   esac
17510
17511   if test "$apu_have_db" = "1"; then
17512     apu_db_version=185
17513   fi
17514
17515                         fi
17516                       fi
17517                     fi
17518                   fi
17519                 fi
17520               fi
17521             fi
17522           fi
17523         fi
17524       fi
17525     fi
17526   fi
17527   { $as_echo "$as_me:$LINENO: checking for Berkeley DB" >&5
17528 $as_echo_n "checking for Berkeley DB... " >&6; }
17529   if test "$apu_have_db" = "1"; then
17530     { $as_echo "$as_me:$LINENO: result: found db$apu_db_version" >&5
17531 $as_echo "found db$apu_db_version" >&6; }
17532   else
17533     { $as_echo "$as_me:$LINENO: result: not found" >&5
17534 $as_echo "not found" >&6; }
17535   fi
17536
17537     if test "$apu_have_db" = "0"; then
17538       { { $as_echo "$as_me:$LINENO: error: Berkeley db requested" >&5
17539 $as_echo "$as_me: error: Berkeley db requested" >&2;}
17540    { (exit but not found); exit but not found; }; }
17541     fi
17542     ;;
17543   db1)
17544
17545   places="$check_places"
17546   if test -z "$places"; then
17547     places="std"
17548   fi
17549
17550   bdb_version=1
17551   if test "0" != "-1"; then
17552     bdb_version="$bdb_version.0"
17553     if test "0" != "-1"; then
17554       bdb_version="$bdb_version.0"
17555     fi
17556   fi
17557   bdb_places="$places"
17558   bdb_default_search_headers="db1/db.h db.h"
17559   bdb_default_search_lib_names="db1"
17560
17561
17562   apu_have_db=0
17563
17564   # Save the original values of the flags we tweak.
17565   apu_check_lib_save_libs="$LIBS"
17566   apu_check_lib_save_ldflags="$LDFLAGS"
17567   apu_check_lib_save_cppflags="$CPPFLAGS"
17568
17569   # The variable `found' is the prefix under which we've found
17570   # Berkeley DB, or `not' if we haven't found it anywhere yet.
17571   found=not
17572   for bdb_place in $bdb_places; do
17573
17574     LDFLAGS="$apu_check_lib_save_ldflags"
17575     CPPFLAGS="$apu_check_lib_save_cppflags"
17576     case "$bdb_place" in
17577       "std" )
17578         description="the standard places"
17579       ;;
17580       *":"* )
17581         header="`echo $bdb_place | sed -e 's/:.*$//'`"
17582         lib="`echo $bdb_place | sed -e 's/^.*://'`"
17583         CPPFLAGS="$CPPFLAGS -I$header"
17584         LDFLAGS="$LDFLAGS -L$lib"
17585         description="$header and $lib"
17586       ;;
17587       * )
17588         if test -d $bdb_place; then
17589           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
17590           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
17591         else
17592           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
17593 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
17594           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
17595 $as_echo "directory not found" >&6; }
17596           continue
17597         fi
17598         description="$bdb_place"
17599       ;;
17600     esac
17601
17602     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
17603     # trick to display a message instead.
17604     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
17605 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
17606     { $as_echo "$as_me:$LINENO: result: " >&5
17607 $as_echo "" >&6; }
17608
17609     for bdb_libname in $bdb_default_search_lib_names; do
17610       for bdb_header in $bdb_default_search_headers; do
17611         # Clear the header cache variable for each location
17612
17613         cache_id="`echo ac_cv_header_${bdb_header} \
17614                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
17615
17616         unset $cache_id
17617         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
17618 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17619   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
17620 $as_echo_n "checking for $bdb_header... " >&6; }
17621 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17622   $as_echo_n "(cached) " >&6
17623 fi
17624 ac_res=`eval 'as_val=${'$as_ac_Header'}
17625                  $as_echo "$as_val"'`
17626                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
17627 $as_echo "$ac_res" >&6; }
17628 else
17629   # Is the header compilable?
17630 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
17631 $as_echo_n "checking $bdb_header usability... " >&6; }
17632 cat >conftest.$ac_ext <<_ACEOF
17633 /* confdefs.h.  */
17634 _ACEOF
17635 cat confdefs.h >>conftest.$ac_ext
17636 cat >>conftest.$ac_ext <<_ACEOF
17637 /* end confdefs.h.  */
17638 $ac_includes_default
17639 #include <$bdb_header>
17640 _ACEOF
17641 rm -f conftest.$ac_objext
17642 if { (ac_try="$ac_compile"
17643 case "(($ac_try" in
17644   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17645   *) ac_try_echo=$ac_try;;
17646 esac
17647 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17648 $as_echo "$ac_try_echo") >&5
17649   (eval "$ac_compile") 2>conftest.er1
17650   ac_status=$?
17651   grep -v '^ *+' conftest.er1 >conftest.err
17652   rm -f conftest.er1
17653   cat conftest.err >&5
17654   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17655   (exit $ac_status); } && {
17656          test -z "$ac_c_werror_flag" ||
17657          test ! -s conftest.err
17658        } && test -s conftest.$ac_objext; then
17659   ac_header_compiler=yes
17660 else
17661   $as_echo "$as_me: failed program was:" >&5
17662 sed 's/^/| /' conftest.$ac_ext >&5
17663
17664         ac_header_compiler=no
17665 fi
17666
17667 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17668 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
17669 $as_echo "$ac_header_compiler" >&6; }
17670
17671 # Is the header present?
17672 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
17673 $as_echo_n "checking $bdb_header presence... " >&6; }
17674 cat >conftest.$ac_ext <<_ACEOF
17675 /* confdefs.h.  */
17676 _ACEOF
17677 cat confdefs.h >>conftest.$ac_ext
17678 cat >>conftest.$ac_ext <<_ACEOF
17679 /* end confdefs.h.  */
17680 #include <$bdb_header>
17681 _ACEOF
17682 if { (ac_try="$ac_cpp conftest.$ac_ext"
17683 case "(($ac_try" in
17684   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17685   *) ac_try_echo=$ac_try;;
17686 esac
17687 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17688 $as_echo "$ac_try_echo") >&5
17689   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
17690   ac_status=$?
17691   grep -v '^ *+' conftest.er1 >conftest.err
17692   rm -f conftest.er1
17693   cat conftest.err >&5
17694   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17695   (exit $ac_status); } >/dev/null && {
17696          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
17697          test ! -s conftest.err
17698        }; then
17699   ac_header_preproc=yes
17700 else
17701   $as_echo "$as_me: failed program was:" >&5
17702 sed 's/^/| /' conftest.$ac_ext >&5
17703
17704   ac_header_preproc=no
17705 fi
17706
17707 rm -f conftest.err conftest.$ac_ext
17708 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
17709 $as_echo "$ac_header_preproc" >&6; }
17710
17711 # So?  What about this header?
17712 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
17713   yes:no: )
17714     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
17715 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
17716     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
17717 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
17718     ac_header_preproc=yes
17719     ;;
17720   no:yes:* )
17721     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
17722 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
17723     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
17724 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
17725     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
17726 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
17727     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
17728 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
17729     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
17730 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
17731     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
17732 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
17733
17734     ;;
17735 esac
17736 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
17737 $as_echo_n "checking for $bdb_header... " >&6; }
17738 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17739   $as_echo_n "(cached) " >&6
17740 else
17741   eval "$as_ac_Header=\$ac_header_preproc"
17742 fi
17743 ac_res=`eval 'as_val=${'$as_ac_Header'}
17744                  $as_echo "$as_val"'`
17745                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
17746 $as_echo "$ac_res" >&6; }
17747
17748 fi
17749 as_val=`eval 'as_val=${'$as_ac_Header'}
17750                  $as_echo "$as_val"'`
17751    if test "x$as_val" = x""yes; then
17752
17753           if test "1" = "3" -o "1" = "4"; then
17754             # We generate a separate cache variable for each prefix and libname
17755             # we search under.  That way, we avoid caching information that
17756             # changes if the user runs `configure' with a different set of
17757             # switches.
17758
17759             cache_id="`echo apu_cv_check_berkeley_db_1_0_0_${bdb_header}_${bdb_libname}_in_${bdb_place} \
17760                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
17761
17762
17763             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
17764 $as_echo_n "checking for -l$bdb_libname... " >&6; }
17765                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
17766   $as_echo_n "(cached) " >&6
17767 else
17768
17769
17770     apu_try_berkeley_db_save_libs="$LIBS"
17771
17772     apu_check_berkeley_db_major=1
17773     apu_check_berkeley_db_minor=0
17774     apu_check_berkeley_db_patch=0
17775     apu_try_berkeley_db_header=$bdb_header
17776     apu_try_berkeley_db_libname=$bdb_libname
17777
17778     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
17779     if test "$cross_compiling" = yes; then
17780   apu_try_berkeley_db=yes
17781
17782 else
17783   cat >conftest.$ac_ext <<_ACEOF
17784 /* confdefs.h.  */
17785 _ACEOF
17786 cat confdefs.h >>conftest.$ac_ext
17787 cat >>conftest.$ac_ext <<_ACEOF
17788 /* end confdefs.h.  */
17789
17790 #include <stdlib.h>
17791 #include <stdio.h>
17792 #include <$apu_try_berkeley_db_header>
17793 main ()
17794 {
17795   int major, minor, patch;
17796
17797   db_version(&major, &minor, &patch);
17798
17799   /* Sanity check: ensure that db.h constants actually match the db library */
17800   if (major != DB_VERSION_MAJOR
17801       || minor != DB_VERSION_MINOR
17802       || patch != DB_VERSION_PATCH)
17803     exit (1);
17804
17805   /* Run-time check:  ensure the library claims to be the correct version. */
17806
17807   if ($apu_check_berkeley_db_major != -1) {
17808     if (major < $apu_check_berkeley_db_major)
17809       exit (1);
17810     if (major > $apu_check_berkeley_db_major)
17811       exit (0);
17812   }
17813
17814   if ($apu_check_berkeley_db_minor != -1) {
17815     if (minor < $apu_check_berkeley_db_minor)
17816       exit (1);
17817     if (minor > $apu_check_berkeley_db_minor)
17818       exit (0);
17819   }
17820
17821   if ($apu_check_berkeley_db_patch == -1
17822       || patch >= $apu_check_berkeley_db_patch)
17823     exit (0);
17824   else
17825     exit (1);
17826 }
17827
17828 _ACEOF
17829 rm -f conftest$ac_exeext
17830 if { (ac_try="$ac_link"
17831 case "(($ac_try" in
17832   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17833   *) ac_try_echo=$ac_try;;
17834 esac
17835 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17836 $as_echo "$ac_try_echo") >&5
17837   (eval "$ac_link") 2>&5
17838   ac_status=$?
17839   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17840   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17841   { (case "(($ac_try" in
17842   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17843   *) ac_try_echo=$ac_try;;
17844 esac
17845 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17846 $as_echo "$ac_try_echo") >&5
17847   (eval "$ac_try") 2>&5
17848   ac_status=$?
17849   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17850   (exit $ac_status); }; }; then
17851   apu_try_berkeley_db=yes
17852 else
17853   $as_echo "$as_me: program exited with status $ac_status" >&5
17854 $as_echo "$as_me: failed program was:" >&5
17855 sed 's/^/| /' conftest.$ac_ext >&5
17856
17857 ( exit $ac_status )
17858 apu_try_berkeley_db=no
17859 fi
17860 rm -rf conftest.dSYM
17861 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17862 fi
17863
17864
17865
17866     LIBS="$apu_try_berkeley_db_save_libs"
17867
17868
17869                 eval "$cache_id=$apu_try_berkeley_db"
17870
17871 fi
17872
17873             result="`eval echo '$'$cache_id`"
17874             { $as_echo "$as_me:$LINENO: result: $result" >&5
17875 $as_echo "$result" >&6; }
17876           elif test "1" = "1"; then
17877             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
17878 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
17879 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
17880 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
17881   $as_echo_n "(cached) " >&6
17882 else
17883   ac_check_lib_save_LIBS=$LIBS
17884 LIBS="-l$bdb_libname  $LIBS"
17885 cat >conftest.$ac_ext <<_ACEOF
17886 /* confdefs.h.  */
17887 _ACEOF
17888 cat confdefs.h >>conftest.$ac_ext
17889 cat >>conftest.$ac_ext <<_ACEOF
17890 /* end confdefs.h.  */
17891
17892 /* Override any GCC internal prototype to avoid an error.
17893    Use char because int might match the return type of a GCC
17894    builtin and then its argument prototype would still apply.  */
17895 #ifdef __cplusplus
17896 extern "C"
17897 #endif
17898 char dbopen ();
17899 int
17900 main ()
17901 {
17902 return dbopen ();
17903   ;
17904   return 0;
17905 }
17906 _ACEOF
17907 rm -f conftest.$ac_objext conftest$ac_exeext
17908 if { (ac_try="$ac_link"
17909 case "(($ac_try" in
17910   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17911   *) ac_try_echo=$ac_try;;
17912 esac
17913 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17914 $as_echo "$ac_try_echo") >&5
17915   (eval "$ac_link") 2>conftest.er1
17916   ac_status=$?
17917   grep -v '^ *+' conftest.er1 >conftest.err
17918   rm -f conftest.er1
17919   cat conftest.err >&5
17920   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17921   (exit $ac_status); } && {
17922          test -z "$ac_c_werror_flag" ||
17923          test ! -s conftest.err
17924        } && test -s conftest$ac_exeext && {
17925          test "$cross_compiling" = yes ||
17926          $as_test_x conftest$ac_exeext
17927        }; then
17928   eval "$as_ac_Lib=yes"
17929 else
17930   $as_echo "$as_me: failed program was:" >&5
17931 sed 's/^/| /' conftest.$ac_ext >&5
17932
17933         eval "$as_ac_Lib=no"
17934 fi
17935
17936 rm -rf conftest.dSYM
17937 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
17938       conftest$ac_exeext conftest.$ac_ext
17939 LIBS=$ac_check_lib_save_LIBS
17940 fi
17941 ac_res=`eval 'as_val=${'$as_ac_Lib'}
17942                  $as_echo "$as_val"'`
17943                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
17944 $as_echo "$ac_res" >&6; }
17945 as_val=`eval 'as_val=${'$as_ac_Lib'}
17946                  $as_echo "$as_val"'`
17947    if test "x$as_val" = x""yes; then
17948   result=yes
17949 else
17950   result=no
17951
17952 fi
17953
17954           elif test "1" = "2"; then
17955             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
17956 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
17957 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
17958 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
17959   $as_echo_n "(cached) " >&6
17960 else
17961   ac_check_lib_save_LIBS=$LIBS
17962 LIBS="-l$bdb_libname  $LIBS"
17963 cat >conftest.$ac_ext <<_ACEOF
17964 /* confdefs.h.  */
17965 _ACEOF
17966 cat confdefs.h >>conftest.$ac_ext
17967 cat >>conftest.$ac_ext <<_ACEOF
17968 /* end confdefs.h.  */
17969
17970 /* Override any GCC internal prototype to avoid an error.
17971    Use char because int might match the return type of a GCC
17972    builtin and then its argument prototype would still apply.  */
17973 #ifdef __cplusplus
17974 extern "C"
17975 #endif
17976 char db_open ();
17977 int
17978 main ()
17979 {
17980 return db_open ();
17981   ;
17982   return 0;
17983 }
17984 _ACEOF
17985 rm -f conftest.$ac_objext conftest$ac_exeext
17986 if { (ac_try="$ac_link"
17987 case "(($ac_try" in
17988   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17989   *) ac_try_echo=$ac_try;;
17990 esac
17991 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17992 $as_echo "$ac_try_echo") >&5
17993   (eval "$ac_link") 2>conftest.er1
17994   ac_status=$?
17995   grep -v '^ *+' conftest.er1 >conftest.err
17996   rm -f conftest.er1
17997   cat conftest.err >&5
17998   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17999   (exit $ac_status); } && {
18000          test -z "$ac_c_werror_flag" ||
18001          test ! -s conftest.err
18002        } && test -s conftest$ac_exeext && {
18003          test "$cross_compiling" = yes ||
18004          $as_test_x conftest$ac_exeext
18005        }; then
18006   eval "$as_ac_Lib=yes"
18007 else
18008   $as_echo "$as_me: failed program was:" >&5
18009 sed 's/^/| /' conftest.$ac_ext >&5
18010
18011         eval "$as_ac_Lib=no"
18012 fi
18013
18014 rm -rf conftest.dSYM
18015 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18016       conftest$ac_exeext conftest.$ac_ext
18017 LIBS=$ac_check_lib_save_LIBS
18018 fi
18019 ac_res=`eval 'as_val=${'$as_ac_Lib'}
18020                  $as_echo "$as_val"'`
18021                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
18022 $as_echo "$ac_res" >&6; }
18023 as_val=`eval 'as_val=${'$as_ac_Lib'}
18024                  $as_echo "$as_val"'`
18025    if test "x$as_val" = x""yes; then
18026   result=yes
18027 else
18028   result=no
18029
18030 fi
18031
18032           fi
18033
18034 else
18035   result="no"
18036 fi
18037
18038
18039
18040         # If we found it, no need to search any more.
18041         if test "$result" = "yes"; then
18042           found="$bdb_place"
18043           break
18044         fi
18045       done
18046       test "$found" != "not" && break
18047     done
18048     test "$found" != "not" && break
18049   done
18050
18051   # Restore the original values of the flags we tweak.
18052   LDFLAGS="$apu_check_lib_save_ldflags"
18053   CPPFLAGS="$apu_check_lib_save_cppflags"
18054
18055   case "$found" in
18056   "not")
18057     apu_have_db=0
18058     ;;
18059   "std")
18060     apu_db_header=$bdb_header
18061     apu_db_lib=$bdb_libname
18062     apu_have_db=1
18063     ;;
18064   *":"*)
18065     header="`echo $found | sed -e 's/:.*$//'`"
18066     lib="`echo $found | sed -e 's/^.*://'`"
18067
18068
18069   if test "x$APRUTIL_INCLUDES" = "x"; then
18070     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
18071     APRUTIL_INCLUDES="-I$header"
18072   else
18073     apr_addto_bugger="-I$header"
18074     for i in $apr_addto_bugger; do
18075       apr_addto_duplicate="0"
18076       for j in $APRUTIL_INCLUDES; do
18077         if test "x$i" = "x$j"; then
18078           apr_addto_duplicate="1"
18079           break
18080         fi
18081       done
18082       if test $apr_addto_duplicate = "0"; then
18083         echo "  adding \"$i\" to APRUTIL_INCLUDES"
18084         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
18085       fi
18086     done
18087   fi
18088
18089
18090   if test "x$APRUTIL_LDFLAGS" = "x"; then
18091     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
18092     APRUTIL_LDFLAGS="-L$lib"
18093   else
18094     apr_addto_bugger="-L$lib"
18095     for i in $apr_addto_bugger; do
18096       apr_addto_duplicate="0"
18097       for j in $APRUTIL_LDFLAGS; do
18098         if test "x$i" = "x$j"; then
18099           apr_addto_duplicate="1"
18100           break
18101         fi
18102       done
18103       if test $apr_addto_duplicate = "0"; then
18104         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
18105         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
18106       fi
18107     done
18108   fi
18109
18110     apu_db_header=$bdb_header
18111     apu_db_lib=$bdb_libname
18112     apu_have_db=1
18113     ;;
18114   *)
18115
18116   if test "x$APRUTIL_INCLUDES" = "x"; then
18117     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
18118     APRUTIL_INCLUDES="-I$found/include"
18119   else
18120     apr_addto_bugger="-I$found/include"
18121     for i in $apr_addto_bugger; do
18122       apr_addto_duplicate="0"
18123       for j in $APRUTIL_INCLUDES; do
18124         if test "x$i" = "x$j"; then
18125           apr_addto_duplicate="1"
18126           break
18127         fi
18128       done
18129       if test $apr_addto_duplicate = "0"; then
18130         echo "  adding \"$i\" to APRUTIL_INCLUDES"
18131         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
18132       fi
18133     done
18134   fi
18135
18136
18137   if test "x$APRUTIL_LDFLAGS" = "x"; then
18138     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
18139     APRUTIL_LDFLAGS="-L$found/lib"
18140   else
18141     apr_addto_bugger="-L$found/lib"
18142     for i in $apr_addto_bugger; do
18143       apr_addto_duplicate="0"
18144       for j in $APRUTIL_LDFLAGS; do
18145         if test "x$i" = "x$j"; then
18146           apr_addto_duplicate="1"
18147           break
18148         fi
18149       done
18150       if test $apr_addto_duplicate = "0"; then
18151         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
18152         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
18153       fi
18154     done
18155   fi
18156
18157     apu_db_header=$bdb_header
18158     apu_db_lib=$bdb_libname
18159     apu_have_db=1
18160     ;;
18161   esac
18162
18163   if test "$apu_have_db" = "1"; then
18164     apu_db_version=1
18165   fi
18166
18167     if test "$apu_db_version" != "1"; then
18168       { { $as_echo "$as_me:$LINENO: error: Berkeley db1 not found" >&5
18169 $as_echo "$as_me: error: Berkeley db1 not found" >&2;}
18170    { (exit 1); exit 1; }; }
18171     fi
18172     ;;
18173   db185)
18174
18175   places="$check_places"
18176   if test -z "$places"; then
18177     places="std"
18178   fi
18179
18180   bdb_version=1
18181   if test "-1" != "-1"; then
18182     bdb_version="$bdb_version.-1"
18183     if test "-1" != "-1"; then
18184       bdb_version="$bdb_version.-1"
18185     fi
18186   fi
18187   bdb_places="$places"
18188   bdb_default_search_headers="db_185.h"
18189   bdb_default_search_lib_names="db"
18190
18191
18192   apu_have_db=0
18193
18194   # Save the original values of the flags we tweak.
18195   apu_check_lib_save_libs="$LIBS"
18196   apu_check_lib_save_ldflags="$LDFLAGS"
18197   apu_check_lib_save_cppflags="$CPPFLAGS"
18198
18199   # The variable `found' is the prefix under which we've found
18200   # Berkeley DB, or `not' if we haven't found it anywhere yet.
18201   found=not
18202   for bdb_place in $bdb_places; do
18203
18204     LDFLAGS="$apu_check_lib_save_ldflags"
18205     CPPFLAGS="$apu_check_lib_save_cppflags"
18206     case "$bdb_place" in
18207       "std" )
18208         description="the standard places"
18209       ;;
18210       *":"* )
18211         header="`echo $bdb_place | sed -e 's/:.*$//'`"
18212         lib="`echo $bdb_place | sed -e 's/^.*://'`"
18213         CPPFLAGS="$CPPFLAGS -I$header"
18214         LDFLAGS="$LDFLAGS -L$lib"
18215         description="$header and $lib"
18216       ;;
18217       * )
18218         if test -d $bdb_place; then
18219           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
18220           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
18221         else
18222           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
18223 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
18224           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
18225 $as_echo "directory not found" >&6; }
18226           continue
18227         fi
18228         description="$bdb_place"
18229       ;;
18230     esac
18231
18232     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
18233     # trick to display a message instead.
18234     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
18235 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
18236     { $as_echo "$as_me:$LINENO: result: " >&5
18237 $as_echo "" >&6; }
18238
18239     for bdb_libname in $bdb_default_search_lib_names; do
18240       for bdb_header in $bdb_default_search_headers; do
18241         # Clear the header cache variable for each location
18242
18243         cache_id="`echo ac_cv_header_${bdb_header} \
18244                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
18245
18246         unset $cache_id
18247         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
18248 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
18249   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
18250 $as_echo_n "checking for $bdb_header... " >&6; }
18251 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
18252   $as_echo_n "(cached) " >&6
18253 fi
18254 ac_res=`eval 'as_val=${'$as_ac_Header'}
18255                  $as_echo "$as_val"'`
18256                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
18257 $as_echo "$ac_res" >&6; }
18258 else
18259   # Is the header compilable?
18260 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
18261 $as_echo_n "checking $bdb_header usability... " >&6; }
18262 cat >conftest.$ac_ext <<_ACEOF
18263 /* confdefs.h.  */
18264 _ACEOF
18265 cat confdefs.h >>conftest.$ac_ext
18266 cat >>conftest.$ac_ext <<_ACEOF
18267 /* end confdefs.h.  */
18268 $ac_includes_default
18269 #include <$bdb_header>
18270 _ACEOF
18271 rm -f conftest.$ac_objext
18272 if { (ac_try="$ac_compile"
18273 case "(($ac_try" in
18274   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18275   *) ac_try_echo=$ac_try;;
18276 esac
18277 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18278 $as_echo "$ac_try_echo") >&5
18279   (eval "$ac_compile") 2>conftest.er1
18280   ac_status=$?
18281   grep -v '^ *+' conftest.er1 >conftest.err
18282   rm -f conftest.er1
18283   cat conftest.err >&5
18284   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18285   (exit $ac_status); } && {
18286          test -z "$ac_c_werror_flag" ||
18287          test ! -s conftest.err
18288        } && test -s conftest.$ac_objext; then
18289   ac_header_compiler=yes
18290 else
18291   $as_echo "$as_me: failed program was:" >&5
18292 sed 's/^/| /' conftest.$ac_ext >&5
18293
18294         ac_header_compiler=no
18295 fi
18296
18297 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18298 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
18299 $as_echo "$ac_header_compiler" >&6; }
18300
18301 # Is the header present?
18302 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
18303 $as_echo_n "checking $bdb_header presence... " >&6; }
18304 cat >conftest.$ac_ext <<_ACEOF
18305 /* confdefs.h.  */
18306 _ACEOF
18307 cat confdefs.h >>conftest.$ac_ext
18308 cat >>conftest.$ac_ext <<_ACEOF
18309 /* end confdefs.h.  */
18310 #include <$bdb_header>
18311 _ACEOF
18312 if { (ac_try="$ac_cpp conftest.$ac_ext"
18313 case "(($ac_try" in
18314   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18315   *) ac_try_echo=$ac_try;;
18316 esac
18317 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18318 $as_echo "$ac_try_echo") >&5
18319   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
18320   ac_status=$?
18321   grep -v '^ *+' conftest.er1 >conftest.err
18322   rm -f conftest.er1
18323   cat conftest.err >&5
18324   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18325   (exit $ac_status); } >/dev/null && {
18326          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
18327          test ! -s conftest.err
18328        }; then
18329   ac_header_preproc=yes
18330 else
18331   $as_echo "$as_me: failed program was:" >&5
18332 sed 's/^/| /' conftest.$ac_ext >&5
18333
18334   ac_header_preproc=no
18335 fi
18336
18337 rm -f conftest.err conftest.$ac_ext
18338 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
18339 $as_echo "$ac_header_preproc" >&6; }
18340
18341 # So?  What about this header?
18342 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
18343   yes:no: )
18344     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
18345 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
18346     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
18347 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
18348     ac_header_preproc=yes
18349     ;;
18350   no:yes:* )
18351     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
18352 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
18353     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
18354 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
18355     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
18356 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
18357     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
18358 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
18359     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
18360 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
18361     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
18362 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
18363
18364     ;;
18365 esac
18366 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
18367 $as_echo_n "checking for $bdb_header... " >&6; }
18368 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
18369   $as_echo_n "(cached) " >&6
18370 else
18371   eval "$as_ac_Header=\$ac_header_preproc"
18372 fi
18373 ac_res=`eval 'as_val=${'$as_ac_Header'}
18374                  $as_echo "$as_val"'`
18375                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
18376 $as_echo "$ac_res" >&6; }
18377
18378 fi
18379 as_val=`eval 'as_val=${'$as_ac_Header'}
18380                  $as_echo "$as_val"'`
18381    if test "x$as_val" = x""yes; then
18382
18383           if test "1" = "3" -o "1" = "4"; then
18384             # We generate a separate cache variable for each prefix and libname
18385             # we search under.  That way, we avoid caching information that
18386             # changes if the user runs `configure' with a different set of
18387             # switches.
18388
18389             cache_id="`echo apu_cv_check_berkeley_db_1_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
18390                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
18391
18392
18393             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
18394 $as_echo_n "checking for -l$bdb_libname... " >&6; }
18395                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
18396   $as_echo_n "(cached) " >&6
18397 else
18398
18399
18400     apu_try_berkeley_db_save_libs="$LIBS"
18401
18402     apu_check_berkeley_db_major=1
18403     apu_check_berkeley_db_minor=-1
18404     apu_check_berkeley_db_patch=-1
18405     apu_try_berkeley_db_header=$bdb_header
18406     apu_try_berkeley_db_libname=$bdb_libname
18407
18408     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
18409     if test "$cross_compiling" = yes; then
18410   apu_try_berkeley_db=yes
18411
18412 else
18413   cat >conftest.$ac_ext <<_ACEOF
18414 /* confdefs.h.  */
18415 _ACEOF
18416 cat confdefs.h >>conftest.$ac_ext
18417 cat >>conftest.$ac_ext <<_ACEOF
18418 /* end confdefs.h.  */
18419
18420 #include <stdlib.h>
18421 #include <stdio.h>
18422 #include <$apu_try_berkeley_db_header>
18423 main ()
18424 {
18425   int major, minor, patch;
18426
18427   db_version(&major, &minor, &patch);
18428
18429   /* Sanity check: ensure that db.h constants actually match the db library */
18430   if (major != DB_VERSION_MAJOR
18431       || minor != DB_VERSION_MINOR
18432       || patch != DB_VERSION_PATCH)
18433     exit (1);
18434
18435   /* Run-time check:  ensure the library claims to be the correct version. */
18436
18437   if ($apu_check_berkeley_db_major != -1) {
18438     if (major < $apu_check_berkeley_db_major)
18439       exit (1);
18440     if (major > $apu_check_berkeley_db_major)
18441       exit (0);
18442   }
18443
18444   if ($apu_check_berkeley_db_minor != -1) {
18445     if (minor < $apu_check_berkeley_db_minor)
18446       exit (1);
18447     if (minor > $apu_check_berkeley_db_minor)
18448       exit (0);
18449   }
18450
18451   if ($apu_check_berkeley_db_patch == -1
18452       || patch >= $apu_check_berkeley_db_patch)
18453     exit (0);
18454   else
18455     exit (1);
18456 }
18457
18458 _ACEOF
18459 rm -f conftest$ac_exeext
18460 if { (ac_try="$ac_link"
18461 case "(($ac_try" in
18462   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18463   *) ac_try_echo=$ac_try;;
18464 esac
18465 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18466 $as_echo "$ac_try_echo") >&5
18467   (eval "$ac_link") 2>&5
18468   ac_status=$?
18469   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18470   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18471   { (case "(($ac_try" in
18472   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18473   *) ac_try_echo=$ac_try;;
18474 esac
18475 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18476 $as_echo "$ac_try_echo") >&5
18477   (eval "$ac_try") 2>&5
18478   ac_status=$?
18479   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18480   (exit $ac_status); }; }; then
18481   apu_try_berkeley_db=yes
18482 else
18483   $as_echo "$as_me: program exited with status $ac_status" >&5
18484 $as_echo "$as_me: failed program was:" >&5
18485 sed 's/^/| /' conftest.$ac_ext >&5
18486
18487 ( exit $ac_status )
18488 apu_try_berkeley_db=no
18489 fi
18490 rm -rf conftest.dSYM
18491 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18492 fi
18493
18494
18495
18496     LIBS="$apu_try_berkeley_db_save_libs"
18497
18498
18499                 eval "$cache_id=$apu_try_berkeley_db"
18500
18501 fi
18502
18503             result="`eval echo '$'$cache_id`"
18504             { $as_echo "$as_me:$LINENO: result: $result" >&5
18505 $as_echo "$result" >&6; }
18506           elif test "1" = "1"; then
18507             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
18508 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
18509 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
18510 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
18511   $as_echo_n "(cached) " >&6
18512 else
18513   ac_check_lib_save_LIBS=$LIBS
18514 LIBS="-l$bdb_libname  $LIBS"
18515 cat >conftest.$ac_ext <<_ACEOF
18516 /* confdefs.h.  */
18517 _ACEOF
18518 cat confdefs.h >>conftest.$ac_ext
18519 cat >>conftest.$ac_ext <<_ACEOF
18520 /* end confdefs.h.  */
18521
18522 /* Override any GCC internal prototype to avoid an error.
18523    Use char because int might match the return type of a GCC
18524    builtin and then its argument prototype would still apply.  */
18525 #ifdef __cplusplus
18526 extern "C"
18527 #endif
18528 char dbopen ();
18529 int
18530 main ()
18531 {
18532 return dbopen ();
18533   ;
18534   return 0;
18535 }
18536 _ACEOF
18537 rm -f conftest.$ac_objext conftest$ac_exeext
18538 if { (ac_try="$ac_link"
18539 case "(($ac_try" in
18540   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18541   *) ac_try_echo=$ac_try;;
18542 esac
18543 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18544 $as_echo "$ac_try_echo") >&5
18545   (eval "$ac_link") 2>conftest.er1
18546   ac_status=$?
18547   grep -v '^ *+' conftest.er1 >conftest.err
18548   rm -f conftest.er1
18549   cat conftest.err >&5
18550   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18551   (exit $ac_status); } && {
18552          test -z "$ac_c_werror_flag" ||
18553          test ! -s conftest.err
18554        } && test -s conftest$ac_exeext && {
18555          test "$cross_compiling" = yes ||
18556          $as_test_x conftest$ac_exeext
18557        }; then
18558   eval "$as_ac_Lib=yes"
18559 else
18560   $as_echo "$as_me: failed program was:" >&5
18561 sed 's/^/| /' conftest.$ac_ext >&5
18562
18563         eval "$as_ac_Lib=no"
18564 fi
18565
18566 rm -rf conftest.dSYM
18567 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18568       conftest$ac_exeext conftest.$ac_ext
18569 LIBS=$ac_check_lib_save_LIBS
18570 fi
18571 ac_res=`eval 'as_val=${'$as_ac_Lib'}
18572                  $as_echo "$as_val"'`
18573                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
18574 $as_echo "$ac_res" >&6; }
18575 as_val=`eval 'as_val=${'$as_ac_Lib'}
18576                  $as_echo "$as_val"'`
18577    if test "x$as_val" = x""yes; then
18578   result=yes
18579 else
18580   result=no
18581
18582 fi
18583
18584           elif test "1" = "2"; then
18585             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
18586 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
18587 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
18588 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
18589   $as_echo_n "(cached) " >&6
18590 else
18591   ac_check_lib_save_LIBS=$LIBS
18592 LIBS="-l$bdb_libname  $LIBS"
18593 cat >conftest.$ac_ext <<_ACEOF
18594 /* confdefs.h.  */
18595 _ACEOF
18596 cat confdefs.h >>conftest.$ac_ext
18597 cat >>conftest.$ac_ext <<_ACEOF
18598 /* end confdefs.h.  */
18599
18600 /* Override any GCC internal prototype to avoid an error.
18601    Use char because int might match the return type of a GCC
18602    builtin and then its argument prototype would still apply.  */
18603 #ifdef __cplusplus
18604 extern "C"
18605 #endif
18606 char db_open ();
18607 int
18608 main ()
18609 {
18610 return db_open ();
18611   ;
18612   return 0;
18613 }
18614 _ACEOF
18615 rm -f conftest.$ac_objext conftest$ac_exeext
18616 if { (ac_try="$ac_link"
18617 case "(($ac_try" in
18618   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18619   *) ac_try_echo=$ac_try;;
18620 esac
18621 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18622 $as_echo "$ac_try_echo") >&5
18623   (eval "$ac_link") 2>conftest.er1
18624   ac_status=$?
18625   grep -v '^ *+' conftest.er1 >conftest.err
18626   rm -f conftest.er1
18627   cat conftest.err >&5
18628   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18629   (exit $ac_status); } && {
18630          test -z "$ac_c_werror_flag" ||
18631          test ! -s conftest.err
18632        } && test -s conftest$ac_exeext && {
18633          test "$cross_compiling" = yes ||
18634          $as_test_x conftest$ac_exeext
18635        }; then
18636   eval "$as_ac_Lib=yes"
18637 else
18638   $as_echo "$as_me: failed program was:" >&5
18639 sed 's/^/| /' conftest.$ac_ext >&5
18640
18641         eval "$as_ac_Lib=no"
18642 fi
18643
18644 rm -rf conftest.dSYM
18645 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18646       conftest$ac_exeext conftest.$ac_ext
18647 LIBS=$ac_check_lib_save_LIBS
18648 fi
18649 ac_res=`eval 'as_val=${'$as_ac_Lib'}
18650                  $as_echo "$as_val"'`
18651                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
18652 $as_echo "$ac_res" >&6; }
18653 as_val=`eval 'as_val=${'$as_ac_Lib'}
18654                  $as_echo "$as_val"'`
18655    if test "x$as_val" = x""yes; then
18656   result=yes
18657 else
18658   result=no
18659
18660 fi
18661
18662           fi
18663
18664 else
18665   result="no"
18666 fi
18667
18668
18669
18670         # If we found it, no need to search any more.
18671         if test "$result" = "yes"; then
18672           found="$bdb_place"
18673           break
18674         fi
18675       done
18676       test "$found" != "not" && break
18677     done
18678     test "$found" != "not" && break
18679   done
18680
18681   # Restore the original values of the flags we tweak.
18682   LDFLAGS="$apu_check_lib_save_ldflags"
18683   CPPFLAGS="$apu_check_lib_save_cppflags"
18684
18685   case "$found" in
18686   "not")
18687     apu_have_db=0
18688     ;;
18689   "std")
18690     apu_db_header=$bdb_header
18691     apu_db_lib=$bdb_libname
18692     apu_have_db=1
18693     ;;
18694   *":"*)
18695     header="`echo $found | sed -e 's/:.*$//'`"
18696     lib="`echo $found | sed -e 's/^.*://'`"
18697
18698
18699   if test "x$APRUTIL_INCLUDES" = "x"; then
18700     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
18701     APRUTIL_INCLUDES="-I$header"
18702   else
18703     apr_addto_bugger="-I$header"
18704     for i in $apr_addto_bugger; do
18705       apr_addto_duplicate="0"
18706       for j in $APRUTIL_INCLUDES; do
18707         if test "x$i" = "x$j"; then
18708           apr_addto_duplicate="1"
18709           break
18710         fi
18711       done
18712       if test $apr_addto_duplicate = "0"; then
18713         echo "  adding \"$i\" to APRUTIL_INCLUDES"
18714         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
18715       fi
18716     done
18717   fi
18718
18719
18720   if test "x$APRUTIL_LDFLAGS" = "x"; then
18721     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
18722     APRUTIL_LDFLAGS="-L$lib"
18723   else
18724     apr_addto_bugger="-L$lib"
18725     for i in $apr_addto_bugger; do
18726       apr_addto_duplicate="0"
18727       for j in $APRUTIL_LDFLAGS; do
18728         if test "x$i" = "x$j"; then
18729           apr_addto_duplicate="1"
18730           break
18731         fi
18732       done
18733       if test $apr_addto_duplicate = "0"; then
18734         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
18735         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
18736       fi
18737     done
18738   fi
18739
18740     apu_db_header=$bdb_header
18741     apu_db_lib=$bdb_libname
18742     apu_have_db=1
18743     ;;
18744   *)
18745
18746   if test "x$APRUTIL_INCLUDES" = "x"; then
18747     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
18748     APRUTIL_INCLUDES="-I$found/include"
18749   else
18750     apr_addto_bugger="-I$found/include"
18751     for i in $apr_addto_bugger; do
18752       apr_addto_duplicate="0"
18753       for j in $APRUTIL_INCLUDES; do
18754         if test "x$i" = "x$j"; then
18755           apr_addto_duplicate="1"
18756           break
18757         fi
18758       done
18759       if test $apr_addto_duplicate = "0"; then
18760         echo "  adding \"$i\" to APRUTIL_INCLUDES"
18761         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
18762       fi
18763     done
18764   fi
18765
18766
18767   if test "x$APRUTIL_LDFLAGS" = "x"; then
18768     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
18769     APRUTIL_LDFLAGS="-L$found/lib"
18770   else
18771     apr_addto_bugger="-L$found/lib"
18772     for i in $apr_addto_bugger; do
18773       apr_addto_duplicate="0"
18774       for j in $APRUTIL_LDFLAGS; do
18775         if test "x$i" = "x$j"; then
18776           apr_addto_duplicate="1"
18777           break
18778         fi
18779       done
18780       if test $apr_addto_duplicate = "0"; then
18781         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
18782         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
18783       fi
18784     done
18785   fi
18786
18787     apu_db_header=$bdb_header
18788     apu_db_lib=$bdb_libname
18789     apu_have_db=1
18790     ;;
18791   esac
18792
18793   if test "$apu_have_db" = "1"; then
18794     apu_db_version=185
18795   fi
18796
18797     if test "$apu_db_version" != "185"; then
18798       { { $as_echo "$as_me:$LINENO: error: Berkeley db185 not found" >&5
18799 $as_echo "$as_me: error: Berkeley db185 not found" >&2;}
18800    { (exit 1); exit 1; }; }
18801     fi
18802     ;;
18803   db2)
18804
18805   places="$check_places"
18806   if test -z "$places"; then
18807     places="std"
18808   fi
18809
18810   bdb_version=2
18811   if test "-1" != "-1"; then
18812     bdb_version="$bdb_version.-1"
18813     if test "-1" != "-1"; then
18814       bdb_version="$bdb_version.-1"
18815     fi
18816   fi
18817   bdb_places="$places"
18818   bdb_default_search_headers="db2/db.h db.h"
18819   bdb_default_search_lib_names="db2 db"
18820
18821
18822   apu_have_db=0
18823
18824   # Save the original values of the flags we tweak.
18825   apu_check_lib_save_libs="$LIBS"
18826   apu_check_lib_save_ldflags="$LDFLAGS"
18827   apu_check_lib_save_cppflags="$CPPFLAGS"
18828
18829   # The variable `found' is the prefix under which we've found
18830   # Berkeley DB, or `not' if we haven't found it anywhere yet.
18831   found=not
18832   for bdb_place in $bdb_places; do
18833
18834     LDFLAGS="$apu_check_lib_save_ldflags"
18835     CPPFLAGS="$apu_check_lib_save_cppflags"
18836     case "$bdb_place" in
18837       "std" )
18838         description="the standard places"
18839       ;;
18840       *":"* )
18841         header="`echo $bdb_place | sed -e 's/:.*$//'`"
18842         lib="`echo $bdb_place | sed -e 's/^.*://'`"
18843         CPPFLAGS="$CPPFLAGS -I$header"
18844         LDFLAGS="$LDFLAGS -L$lib"
18845         description="$header and $lib"
18846       ;;
18847       * )
18848         if test -d $bdb_place; then
18849           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
18850           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
18851         else
18852           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
18853 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
18854           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
18855 $as_echo "directory not found" >&6; }
18856           continue
18857         fi
18858         description="$bdb_place"
18859       ;;
18860     esac
18861
18862     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
18863     # trick to display a message instead.
18864     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
18865 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
18866     { $as_echo "$as_me:$LINENO: result: " >&5
18867 $as_echo "" >&6; }
18868
18869     for bdb_libname in $bdb_default_search_lib_names; do
18870       for bdb_header in $bdb_default_search_headers; do
18871         # Clear the header cache variable for each location
18872
18873         cache_id="`echo ac_cv_header_${bdb_header} \
18874                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
18875
18876         unset $cache_id
18877         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
18878 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
18879   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
18880 $as_echo_n "checking for $bdb_header... " >&6; }
18881 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
18882   $as_echo_n "(cached) " >&6
18883 fi
18884 ac_res=`eval 'as_val=${'$as_ac_Header'}
18885                  $as_echo "$as_val"'`
18886                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
18887 $as_echo "$ac_res" >&6; }
18888 else
18889   # Is the header compilable?
18890 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
18891 $as_echo_n "checking $bdb_header usability... " >&6; }
18892 cat >conftest.$ac_ext <<_ACEOF
18893 /* confdefs.h.  */
18894 _ACEOF
18895 cat confdefs.h >>conftest.$ac_ext
18896 cat >>conftest.$ac_ext <<_ACEOF
18897 /* end confdefs.h.  */
18898 $ac_includes_default
18899 #include <$bdb_header>
18900 _ACEOF
18901 rm -f conftest.$ac_objext
18902 if { (ac_try="$ac_compile"
18903 case "(($ac_try" in
18904   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18905   *) ac_try_echo=$ac_try;;
18906 esac
18907 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18908 $as_echo "$ac_try_echo") >&5
18909   (eval "$ac_compile") 2>conftest.er1
18910   ac_status=$?
18911   grep -v '^ *+' conftest.er1 >conftest.err
18912   rm -f conftest.er1
18913   cat conftest.err >&5
18914   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18915   (exit $ac_status); } && {
18916          test -z "$ac_c_werror_flag" ||
18917          test ! -s conftest.err
18918        } && test -s conftest.$ac_objext; then
18919   ac_header_compiler=yes
18920 else
18921   $as_echo "$as_me: failed program was:" >&5
18922 sed 's/^/| /' conftest.$ac_ext >&5
18923
18924         ac_header_compiler=no
18925 fi
18926
18927 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18928 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
18929 $as_echo "$ac_header_compiler" >&6; }
18930
18931 # Is the header present?
18932 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
18933 $as_echo_n "checking $bdb_header presence... " >&6; }
18934 cat >conftest.$ac_ext <<_ACEOF
18935 /* confdefs.h.  */
18936 _ACEOF
18937 cat confdefs.h >>conftest.$ac_ext
18938 cat >>conftest.$ac_ext <<_ACEOF
18939 /* end confdefs.h.  */
18940 #include <$bdb_header>
18941 _ACEOF
18942 if { (ac_try="$ac_cpp conftest.$ac_ext"
18943 case "(($ac_try" in
18944   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18945   *) ac_try_echo=$ac_try;;
18946 esac
18947 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18948 $as_echo "$ac_try_echo") >&5
18949   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
18950   ac_status=$?
18951   grep -v '^ *+' conftest.er1 >conftest.err
18952   rm -f conftest.er1
18953   cat conftest.err >&5
18954   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18955   (exit $ac_status); } >/dev/null && {
18956          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
18957          test ! -s conftest.err
18958        }; then
18959   ac_header_preproc=yes
18960 else
18961   $as_echo "$as_me: failed program was:" >&5
18962 sed 's/^/| /' conftest.$ac_ext >&5
18963
18964   ac_header_preproc=no
18965 fi
18966
18967 rm -f conftest.err conftest.$ac_ext
18968 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
18969 $as_echo "$ac_header_preproc" >&6; }
18970
18971 # So?  What about this header?
18972 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
18973   yes:no: )
18974     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
18975 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
18976     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
18977 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
18978     ac_header_preproc=yes
18979     ;;
18980   no:yes:* )
18981     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
18982 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
18983     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
18984 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
18985     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
18986 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
18987     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
18988 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
18989     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
18990 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
18991     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
18992 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
18993
18994     ;;
18995 esac
18996 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
18997 $as_echo_n "checking for $bdb_header... " >&6; }
18998 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
18999   $as_echo_n "(cached) " >&6
19000 else
19001   eval "$as_ac_Header=\$ac_header_preproc"
19002 fi
19003 ac_res=`eval 'as_val=${'$as_ac_Header'}
19004                  $as_echo "$as_val"'`
19005                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19006 $as_echo "$ac_res" >&6; }
19007
19008 fi
19009 as_val=`eval 'as_val=${'$as_ac_Header'}
19010                  $as_echo "$as_val"'`
19011    if test "x$as_val" = x""yes; then
19012
19013           if test "2" = "3" -o "2" = "4"; then
19014             # We generate a separate cache variable for each prefix and libname
19015             # we search under.  That way, we avoid caching information that
19016             # changes if the user runs `configure' with a different set of
19017             # switches.
19018
19019             cache_id="`echo apu_cv_check_berkeley_db_2_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
19020                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
19021
19022
19023             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
19024 $as_echo_n "checking for -l$bdb_libname... " >&6; }
19025                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
19026   $as_echo_n "(cached) " >&6
19027 else
19028
19029
19030     apu_try_berkeley_db_save_libs="$LIBS"
19031
19032     apu_check_berkeley_db_major=2
19033     apu_check_berkeley_db_minor=-1
19034     apu_check_berkeley_db_patch=-1
19035     apu_try_berkeley_db_header=$bdb_header
19036     apu_try_berkeley_db_libname=$bdb_libname
19037
19038     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
19039     if test "$cross_compiling" = yes; then
19040   apu_try_berkeley_db=yes
19041
19042 else
19043   cat >conftest.$ac_ext <<_ACEOF
19044 /* confdefs.h.  */
19045 _ACEOF
19046 cat confdefs.h >>conftest.$ac_ext
19047 cat >>conftest.$ac_ext <<_ACEOF
19048 /* end confdefs.h.  */
19049
19050 #include <stdlib.h>
19051 #include <stdio.h>
19052 #include <$apu_try_berkeley_db_header>
19053 main ()
19054 {
19055   int major, minor, patch;
19056
19057   db_version(&major, &minor, &patch);
19058
19059   /* Sanity check: ensure that db.h constants actually match the db library */
19060   if (major != DB_VERSION_MAJOR
19061       || minor != DB_VERSION_MINOR
19062       || patch != DB_VERSION_PATCH)
19063     exit (1);
19064
19065   /* Run-time check:  ensure the library claims to be the correct version. */
19066
19067   if ($apu_check_berkeley_db_major != -1) {
19068     if (major < $apu_check_berkeley_db_major)
19069       exit (1);
19070     if (major > $apu_check_berkeley_db_major)
19071       exit (0);
19072   }
19073
19074   if ($apu_check_berkeley_db_minor != -1) {
19075     if (minor < $apu_check_berkeley_db_minor)
19076       exit (1);
19077     if (minor > $apu_check_berkeley_db_minor)
19078       exit (0);
19079   }
19080
19081   if ($apu_check_berkeley_db_patch == -1
19082       || patch >= $apu_check_berkeley_db_patch)
19083     exit (0);
19084   else
19085     exit (1);
19086 }
19087
19088 _ACEOF
19089 rm -f conftest$ac_exeext
19090 if { (ac_try="$ac_link"
19091 case "(($ac_try" in
19092   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19093   *) ac_try_echo=$ac_try;;
19094 esac
19095 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19096 $as_echo "$ac_try_echo") >&5
19097   (eval "$ac_link") 2>&5
19098   ac_status=$?
19099   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19100   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19101   { (case "(($ac_try" in
19102   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19103   *) ac_try_echo=$ac_try;;
19104 esac
19105 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19106 $as_echo "$ac_try_echo") >&5
19107   (eval "$ac_try") 2>&5
19108   ac_status=$?
19109   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19110   (exit $ac_status); }; }; then
19111   apu_try_berkeley_db=yes
19112 else
19113   $as_echo "$as_me: program exited with status $ac_status" >&5
19114 $as_echo "$as_me: failed program was:" >&5
19115 sed 's/^/| /' conftest.$ac_ext >&5
19116
19117 ( exit $ac_status )
19118 apu_try_berkeley_db=no
19119 fi
19120 rm -rf conftest.dSYM
19121 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19122 fi
19123
19124
19125
19126     LIBS="$apu_try_berkeley_db_save_libs"
19127
19128
19129                 eval "$cache_id=$apu_try_berkeley_db"
19130
19131 fi
19132
19133             result="`eval echo '$'$cache_id`"
19134             { $as_echo "$as_me:$LINENO: result: $result" >&5
19135 $as_echo "$result" >&6; }
19136           elif test "2" = "1"; then
19137             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
19138 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
19139 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
19140 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
19141   $as_echo_n "(cached) " >&6
19142 else
19143   ac_check_lib_save_LIBS=$LIBS
19144 LIBS="-l$bdb_libname  $LIBS"
19145 cat >conftest.$ac_ext <<_ACEOF
19146 /* confdefs.h.  */
19147 _ACEOF
19148 cat confdefs.h >>conftest.$ac_ext
19149 cat >>conftest.$ac_ext <<_ACEOF
19150 /* end confdefs.h.  */
19151
19152 /* Override any GCC internal prototype to avoid an error.
19153    Use char because int might match the return type of a GCC
19154    builtin and then its argument prototype would still apply.  */
19155 #ifdef __cplusplus
19156 extern "C"
19157 #endif
19158 char dbopen ();
19159 int
19160 main ()
19161 {
19162 return dbopen ();
19163   ;
19164   return 0;
19165 }
19166 _ACEOF
19167 rm -f conftest.$ac_objext conftest$ac_exeext
19168 if { (ac_try="$ac_link"
19169 case "(($ac_try" in
19170   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19171   *) ac_try_echo=$ac_try;;
19172 esac
19173 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19174 $as_echo "$ac_try_echo") >&5
19175   (eval "$ac_link") 2>conftest.er1
19176   ac_status=$?
19177   grep -v '^ *+' conftest.er1 >conftest.err
19178   rm -f conftest.er1
19179   cat conftest.err >&5
19180   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19181   (exit $ac_status); } && {
19182          test -z "$ac_c_werror_flag" ||
19183          test ! -s conftest.err
19184        } && test -s conftest$ac_exeext && {
19185          test "$cross_compiling" = yes ||
19186          $as_test_x conftest$ac_exeext
19187        }; then
19188   eval "$as_ac_Lib=yes"
19189 else
19190   $as_echo "$as_me: failed program was:" >&5
19191 sed 's/^/| /' conftest.$ac_ext >&5
19192
19193         eval "$as_ac_Lib=no"
19194 fi
19195
19196 rm -rf conftest.dSYM
19197 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
19198       conftest$ac_exeext conftest.$ac_ext
19199 LIBS=$ac_check_lib_save_LIBS
19200 fi
19201 ac_res=`eval 'as_val=${'$as_ac_Lib'}
19202                  $as_echo "$as_val"'`
19203                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19204 $as_echo "$ac_res" >&6; }
19205 as_val=`eval 'as_val=${'$as_ac_Lib'}
19206                  $as_echo "$as_val"'`
19207    if test "x$as_val" = x""yes; then
19208   result=yes
19209 else
19210   result=no
19211
19212 fi
19213
19214           elif test "2" = "2"; then
19215             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
19216 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
19217 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
19218 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
19219   $as_echo_n "(cached) " >&6
19220 else
19221   ac_check_lib_save_LIBS=$LIBS
19222 LIBS="-l$bdb_libname  $LIBS"
19223 cat >conftest.$ac_ext <<_ACEOF
19224 /* confdefs.h.  */
19225 _ACEOF
19226 cat confdefs.h >>conftest.$ac_ext
19227 cat >>conftest.$ac_ext <<_ACEOF
19228 /* end confdefs.h.  */
19229
19230 /* Override any GCC internal prototype to avoid an error.
19231    Use char because int might match the return type of a GCC
19232    builtin and then its argument prototype would still apply.  */
19233 #ifdef __cplusplus
19234 extern "C"
19235 #endif
19236 char db_open ();
19237 int
19238 main ()
19239 {
19240 return db_open ();
19241   ;
19242   return 0;
19243 }
19244 _ACEOF
19245 rm -f conftest.$ac_objext conftest$ac_exeext
19246 if { (ac_try="$ac_link"
19247 case "(($ac_try" in
19248   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19249   *) ac_try_echo=$ac_try;;
19250 esac
19251 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19252 $as_echo "$ac_try_echo") >&5
19253   (eval "$ac_link") 2>conftest.er1
19254   ac_status=$?
19255   grep -v '^ *+' conftest.er1 >conftest.err
19256   rm -f conftest.er1
19257   cat conftest.err >&5
19258   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19259   (exit $ac_status); } && {
19260          test -z "$ac_c_werror_flag" ||
19261          test ! -s conftest.err
19262        } && test -s conftest$ac_exeext && {
19263          test "$cross_compiling" = yes ||
19264          $as_test_x conftest$ac_exeext
19265        }; then
19266   eval "$as_ac_Lib=yes"
19267 else
19268   $as_echo "$as_me: failed program was:" >&5
19269 sed 's/^/| /' conftest.$ac_ext >&5
19270
19271         eval "$as_ac_Lib=no"
19272 fi
19273
19274 rm -rf conftest.dSYM
19275 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
19276       conftest$ac_exeext conftest.$ac_ext
19277 LIBS=$ac_check_lib_save_LIBS
19278 fi
19279 ac_res=`eval 'as_val=${'$as_ac_Lib'}
19280                  $as_echo "$as_val"'`
19281                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19282 $as_echo "$ac_res" >&6; }
19283 as_val=`eval 'as_val=${'$as_ac_Lib'}
19284                  $as_echo "$as_val"'`
19285    if test "x$as_val" = x""yes; then
19286   result=yes
19287 else
19288   result=no
19289
19290 fi
19291
19292           fi
19293
19294 else
19295   result="no"
19296 fi
19297
19298
19299
19300         # If we found it, no need to search any more.
19301         if test "$result" = "yes"; then
19302           found="$bdb_place"
19303           break
19304         fi
19305       done
19306       test "$found" != "not" && break
19307     done
19308     test "$found" != "not" && break
19309   done
19310
19311   # Restore the original values of the flags we tweak.
19312   LDFLAGS="$apu_check_lib_save_ldflags"
19313   CPPFLAGS="$apu_check_lib_save_cppflags"
19314
19315   case "$found" in
19316   "not")
19317     apu_have_db=0
19318     ;;
19319   "std")
19320     apu_db_header=$bdb_header
19321     apu_db_lib=$bdb_libname
19322     apu_have_db=1
19323     ;;
19324   *":"*)
19325     header="`echo $found | sed -e 's/:.*$//'`"
19326     lib="`echo $found | sed -e 's/^.*://'`"
19327
19328
19329   if test "x$APRUTIL_INCLUDES" = "x"; then
19330     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
19331     APRUTIL_INCLUDES="-I$header"
19332   else
19333     apr_addto_bugger="-I$header"
19334     for i in $apr_addto_bugger; do
19335       apr_addto_duplicate="0"
19336       for j in $APRUTIL_INCLUDES; do
19337         if test "x$i" = "x$j"; then
19338           apr_addto_duplicate="1"
19339           break
19340         fi
19341       done
19342       if test $apr_addto_duplicate = "0"; then
19343         echo "  adding \"$i\" to APRUTIL_INCLUDES"
19344         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
19345       fi
19346     done
19347   fi
19348
19349
19350   if test "x$APRUTIL_LDFLAGS" = "x"; then
19351     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
19352     APRUTIL_LDFLAGS="-L$lib"
19353   else
19354     apr_addto_bugger="-L$lib"
19355     for i in $apr_addto_bugger; do
19356       apr_addto_duplicate="0"
19357       for j in $APRUTIL_LDFLAGS; do
19358         if test "x$i" = "x$j"; then
19359           apr_addto_duplicate="1"
19360           break
19361         fi
19362       done
19363       if test $apr_addto_duplicate = "0"; then
19364         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
19365         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
19366       fi
19367     done
19368   fi
19369
19370     apu_db_header=$bdb_header
19371     apu_db_lib=$bdb_libname
19372     apu_have_db=1
19373     ;;
19374   *)
19375
19376   if test "x$APRUTIL_INCLUDES" = "x"; then
19377     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
19378     APRUTIL_INCLUDES="-I$found/include"
19379   else
19380     apr_addto_bugger="-I$found/include"
19381     for i in $apr_addto_bugger; do
19382       apr_addto_duplicate="0"
19383       for j in $APRUTIL_INCLUDES; do
19384         if test "x$i" = "x$j"; then
19385           apr_addto_duplicate="1"
19386           break
19387         fi
19388       done
19389       if test $apr_addto_duplicate = "0"; then
19390         echo "  adding \"$i\" to APRUTIL_INCLUDES"
19391         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
19392       fi
19393     done
19394   fi
19395
19396
19397   if test "x$APRUTIL_LDFLAGS" = "x"; then
19398     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
19399     APRUTIL_LDFLAGS="-L$found/lib"
19400   else
19401     apr_addto_bugger="-L$found/lib"
19402     for i in $apr_addto_bugger; do
19403       apr_addto_duplicate="0"
19404       for j in $APRUTIL_LDFLAGS; do
19405         if test "x$i" = "x$j"; then
19406           apr_addto_duplicate="1"
19407           break
19408         fi
19409       done
19410       if test $apr_addto_duplicate = "0"; then
19411         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
19412         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
19413       fi
19414     done
19415   fi
19416
19417     apu_db_header=$bdb_header
19418     apu_db_lib=$bdb_libname
19419     apu_have_db=1
19420     ;;
19421   esac
19422
19423   if test "$apu_have_db" = "1"; then
19424     apu_db_version=2
19425   fi
19426
19427     if test "$apu_db_version" != "2"; then
19428       { { $as_echo "$as_me:$LINENO: error: Berkeley db2 not found" >&5
19429 $as_echo "$as_me: error: Berkeley db2 not found" >&2;}
19430    { (exit 1); exit 1; }; }
19431     fi
19432     ;;
19433   db3)
19434
19435   places="$check_places"
19436   if test -z "$places"; then
19437     places="std"
19438   fi
19439
19440   bdb_version=3
19441   if test "-1" != "-1"; then
19442     bdb_version="$bdb_version.-1"
19443     if test "-1" != "-1"; then
19444       bdb_version="$bdb_version.-1"
19445     fi
19446   fi
19447   bdb_places="$places"
19448   bdb_default_search_headers="db3/db.h db.h"
19449   bdb_default_search_lib_names="db3 db"
19450
19451
19452   apu_have_db=0
19453
19454   # Save the original values of the flags we tweak.
19455   apu_check_lib_save_libs="$LIBS"
19456   apu_check_lib_save_ldflags="$LDFLAGS"
19457   apu_check_lib_save_cppflags="$CPPFLAGS"
19458
19459   # The variable `found' is the prefix under which we've found
19460   # Berkeley DB, or `not' if we haven't found it anywhere yet.
19461   found=not
19462   for bdb_place in $bdb_places; do
19463
19464     LDFLAGS="$apu_check_lib_save_ldflags"
19465     CPPFLAGS="$apu_check_lib_save_cppflags"
19466     case "$bdb_place" in
19467       "std" )
19468         description="the standard places"
19469       ;;
19470       *":"* )
19471         header="`echo $bdb_place | sed -e 's/:.*$//'`"
19472         lib="`echo $bdb_place | sed -e 's/^.*://'`"
19473         CPPFLAGS="$CPPFLAGS -I$header"
19474         LDFLAGS="$LDFLAGS -L$lib"
19475         description="$header and $lib"
19476       ;;
19477       * )
19478         if test -d $bdb_place; then
19479           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
19480           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
19481         else
19482           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
19483 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
19484           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
19485 $as_echo "directory not found" >&6; }
19486           continue
19487         fi
19488         description="$bdb_place"
19489       ;;
19490     esac
19491
19492     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
19493     # trick to display a message instead.
19494     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
19495 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
19496     { $as_echo "$as_me:$LINENO: result: " >&5
19497 $as_echo "" >&6; }
19498
19499     for bdb_libname in $bdb_default_search_lib_names; do
19500       for bdb_header in $bdb_default_search_headers; do
19501         # Clear the header cache variable for each location
19502
19503         cache_id="`echo ac_cv_header_${bdb_header} \
19504                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
19505
19506         unset $cache_id
19507         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
19508 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
19509   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
19510 $as_echo_n "checking for $bdb_header... " >&6; }
19511 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
19512   $as_echo_n "(cached) " >&6
19513 fi
19514 ac_res=`eval 'as_val=${'$as_ac_Header'}
19515                  $as_echo "$as_val"'`
19516                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19517 $as_echo "$ac_res" >&6; }
19518 else
19519   # Is the header compilable?
19520 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
19521 $as_echo_n "checking $bdb_header usability... " >&6; }
19522 cat >conftest.$ac_ext <<_ACEOF
19523 /* confdefs.h.  */
19524 _ACEOF
19525 cat confdefs.h >>conftest.$ac_ext
19526 cat >>conftest.$ac_ext <<_ACEOF
19527 /* end confdefs.h.  */
19528 $ac_includes_default
19529 #include <$bdb_header>
19530 _ACEOF
19531 rm -f conftest.$ac_objext
19532 if { (ac_try="$ac_compile"
19533 case "(($ac_try" in
19534   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19535   *) ac_try_echo=$ac_try;;
19536 esac
19537 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19538 $as_echo "$ac_try_echo") >&5
19539   (eval "$ac_compile") 2>conftest.er1
19540   ac_status=$?
19541   grep -v '^ *+' conftest.er1 >conftest.err
19542   rm -f conftest.er1
19543   cat conftest.err >&5
19544   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19545   (exit $ac_status); } && {
19546          test -z "$ac_c_werror_flag" ||
19547          test ! -s conftest.err
19548        } && test -s conftest.$ac_objext; then
19549   ac_header_compiler=yes
19550 else
19551   $as_echo "$as_me: failed program was:" >&5
19552 sed 's/^/| /' conftest.$ac_ext >&5
19553
19554         ac_header_compiler=no
19555 fi
19556
19557 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19558 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
19559 $as_echo "$ac_header_compiler" >&6; }
19560
19561 # Is the header present?
19562 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
19563 $as_echo_n "checking $bdb_header presence... " >&6; }
19564 cat >conftest.$ac_ext <<_ACEOF
19565 /* confdefs.h.  */
19566 _ACEOF
19567 cat confdefs.h >>conftest.$ac_ext
19568 cat >>conftest.$ac_ext <<_ACEOF
19569 /* end confdefs.h.  */
19570 #include <$bdb_header>
19571 _ACEOF
19572 if { (ac_try="$ac_cpp conftest.$ac_ext"
19573 case "(($ac_try" in
19574   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19575   *) ac_try_echo=$ac_try;;
19576 esac
19577 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19578 $as_echo "$ac_try_echo") >&5
19579   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
19580   ac_status=$?
19581   grep -v '^ *+' conftest.er1 >conftest.err
19582   rm -f conftest.er1
19583   cat conftest.err >&5
19584   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19585   (exit $ac_status); } >/dev/null && {
19586          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
19587          test ! -s conftest.err
19588        }; then
19589   ac_header_preproc=yes
19590 else
19591   $as_echo "$as_me: failed program was:" >&5
19592 sed 's/^/| /' conftest.$ac_ext >&5
19593
19594   ac_header_preproc=no
19595 fi
19596
19597 rm -f conftest.err conftest.$ac_ext
19598 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
19599 $as_echo "$ac_header_preproc" >&6; }
19600
19601 # So?  What about this header?
19602 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
19603   yes:no: )
19604     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
19605 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
19606     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
19607 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
19608     ac_header_preproc=yes
19609     ;;
19610   no:yes:* )
19611     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
19612 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
19613     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
19614 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
19615     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
19616 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
19617     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
19618 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
19619     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
19620 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
19621     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
19622 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
19623
19624     ;;
19625 esac
19626 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
19627 $as_echo_n "checking for $bdb_header... " >&6; }
19628 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
19629   $as_echo_n "(cached) " >&6
19630 else
19631   eval "$as_ac_Header=\$ac_header_preproc"
19632 fi
19633 ac_res=`eval 'as_val=${'$as_ac_Header'}
19634                  $as_echo "$as_val"'`
19635                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19636 $as_echo "$ac_res" >&6; }
19637
19638 fi
19639 as_val=`eval 'as_val=${'$as_ac_Header'}
19640                  $as_echo "$as_val"'`
19641    if test "x$as_val" = x""yes; then
19642
19643           if test "3" = "3" -o "3" = "4"; then
19644             # We generate a separate cache variable for each prefix and libname
19645             # we search under.  That way, we avoid caching information that
19646             # changes if the user runs `configure' with a different set of
19647             # switches.
19648
19649             cache_id="`echo apu_cv_check_berkeley_db_3_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
19650                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
19651
19652
19653             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
19654 $as_echo_n "checking for -l$bdb_libname... " >&6; }
19655                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
19656   $as_echo_n "(cached) " >&6
19657 else
19658
19659
19660     apu_try_berkeley_db_save_libs="$LIBS"
19661
19662     apu_check_berkeley_db_major=3
19663     apu_check_berkeley_db_minor=-1
19664     apu_check_berkeley_db_patch=-1
19665     apu_try_berkeley_db_header=$bdb_header
19666     apu_try_berkeley_db_libname=$bdb_libname
19667
19668     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
19669     if test "$cross_compiling" = yes; then
19670   apu_try_berkeley_db=yes
19671
19672 else
19673   cat >conftest.$ac_ext <<_ACEOF
19674 /* confdefs.h.  */
19675 _ACEOF
19676 cat confdefs.h >>conftest.$ac_ext
19677 cat >>conftest.$ac_ext <<_ACEOF
19678 /* end confdefs.h.  */
19679
19680 #include <stdlib.h>
19681 #include <stdio.h>
19682 #include <$apu_try_berkeley_db_header>
19683 main ()
19684 {
19685   int major, minor, patch;
19686
19687   db_version(&major, &minor, &patch);
19688
19689   /* Sanity check: ensure that db.h constants actually match the db library */
19690   if (major != DB_VERSION_MAJOR
19691       || minor != DB_VERSION_MINOR
19692       || patch != DB_VERSION_PATCH)
19693     exit (1);
19694
19695   /* Run-time check:  ensure the library claims to be the correct version. */
19696
19697   if ($apu_check_berkeley_db_major != -1) {
19698     if (major < $apu_check_berkeley_db_major)
19699       exit (1);
19700     if (major > $apu_check_berkeley_db_major)
19701       exit (0);
19702   }
19703
19704   if ($apu_check_berkeley_db_minor != -1) {
19705     if (minor < $apu_check_berkeley_db_minor)
19706       exit (1);
19707     if (minor > $apu_check_berkeley_db_minor)
19708       exit (0);
19709   }
19710
19711   if ($apu_check_berkeley_db_patch == -1
19712       || patch >= $apu_check_berkeley_db_patch)
19713     exit (0);
19714   else
19715     exit (1);
19716 }
19717
19718 _ACEOF
19719 rm -f conftest$ac_exeext
19720 if { (ac_try="$ac_link"
19721 case "(($ac_try" in
19722   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19723   *) ac_try_echo=$ac_try;;
19724 esac
19725 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19726 $as_echo "$ac_try_echo") >&5
19727   (eval "$ac_link") 2>&5
19728   ac_status=$?
19729   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19730   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19731   { (case "(($ac_try" in
19732   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19733   *) ac_try_echo=$ac_try;;
19734 esac
19735 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19736 $as_echo "$ac_try_echo") >&5
19737   (eval "$ac_try") 2>&5
19738   ac_status=$?
19739   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19740   (exit $ac_status); }; }; then
19741   apu_try_berkeley_db=yes
19742 else
19743   $as_echo "$as_me: program exited with status $ac_status" >&5
19744 $as_echo "$as_me: failed program was:" >&5
19745 sed 's/^/| /' conftest.$ac_ext >&5
19746
19747 ( exit $ac_status )
19748 apu_try_berkeley_db=no
19749 fi
19750 rm -rf conftest.dSYM
19751 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19752 fi
19753
19754
19755
19756     LIBS="$apu_try_berkeley_db_save_libs"
19757
19758
19759                 eval "$cache_id=$apu_try_berkeley_db"
19760
19761 fi
19762
19763             result="`eval echo '$'$cache_id`"
19764             { $as_echo "$as_me:$LINENO: result: $result" >&5
19765 $as_echo "$result" >&6; }
19766           elif test "3" = "1"; then
19767             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
19768 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
19769 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
19770 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
19771   $as_echo_n "(cached) " >&6
19772 else
19773   ac_check_lib_save_LIBS=$LIBS
19774 LIBS="-l$bdb_libname  $LIBS"
19775 cat >conftest.$ac_ext <<_ACEOF
19776 /* confdefs.h.  */
19777 _ACEOF
19778 cat confdefs.h >>conftest.$ac_ext
19779 cat >>conftest.$ac_ext <<_ACEOF
19780 /* end confdefs.h.  */
19781
19782 /* Override any GCC internal prototype to avoid an error.
19783    Use char because int might match the return type of a GCC
19784    builtin and then its argument prototype would still apply.  */
19785 #ifdef __cplusplus
19786 extern "C"
19787 #endif
19788 char dbopen ();
19789 int
19790 main ()
19791 {
19792 return dbopen ();
19793   ;
19794   return 0;
19795 }
19796 _ACEOF
19797 rm -f conftest.$ac_objext conftest$ac_exeext
19798 if { (ac_try="$ac_link"
19799 case "(($ac_try" in
19800   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19801   *) ac_try_echo=$ac_try;;
19802 esac
19803 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19804 $as_echo "$ac_try_echo") >&5
19805   (eval "$ac_link") 2>conftest.er1
19806   ac_status=$?
19807   grep -v '^ *+' conftest.er1 >conftest.err
19808   rm -f conftest.er1
19809   cat conftest.err >&5
19810   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19811   (exit $ac_status); } && {
19812          test -z "$ac_c_werror_flag" ||
19813          test ! -s conftest.err
19814        } && test -s conftest$ac_exeext && {
19815          test "$cross_compiling" = yes ||
19816          $as_test_x conftest$ac_exeext
19817        }; then
19818   eval "$as_ac_Lib=yes"
19819 else
19820   $as_echo "$as_me: failed program was:" >&5
19821 sed 's/^/| /' conftest.$ac_ext >&5
19822
19823         eval "$as_ac_Lib=no"
19824 fi
19825
19826 rm -rf conftest.dSYM
19827 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
19828       conftest$ac_exeext conftest.$ac_ext
19829 LIBS=$ac_check_lib_save_LIBS
19830 fi
19831 ac_res=`eval 'as_val=${'$as_ac_Lib'}
19832                  $as_echo "$as_val"'`
19833                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19834 $as_echo "$ac_res" >&6; }
19835 as_val=`eval 'as_val=${'$as_ac_Lib'}
19836                  $as_echo "$as_val"'`
19837    if test "x$as_val" = x""yes; then
19838   result=yes
19839 else
19840   result=no
19841
19842 fi
19843
19844           elif test "3" = "2"; then
19845             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
19846 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
19847 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
19848 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
19849   $as_echo_n "(cached) " >&6
19850 else
19851   ac_check_lib_save_LIBS=$LIBS
19852 LIBS="-l$bdb_libname  $LIBS"
19853 cat >conftest.$ac_ext <<_ACEOF
19854 /* confdefs.h.  */
19855 _ACEOF
19856 cat confdefs.h >>conftest.$ac_ext
19857 cat >>conftest.$ac_ext <<_ACEOF
19858 /* end confdefs.h.  */
19859
19860 /* Override any GCC internal prototype to avoid an error.
19861    Use char because int might match the return type of a GCC
19862    builtin and then its argument prototype would still apply.  */
19863 #ifdef __cplusplus
19864 extern "C"
19865 #endif
19866 char db_open ();
19867 int
19868 main ()
19869 {
19870 return db_open ();
19871   ;
19872   return 0;
19873 }
19874 _ACEOF
19875 rm -f conftest.$ac_objext conftest$ac_exeext
19876 if { (ac_try="$ac_link"
19877 case "(($ac_try" in
19878   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19879   *) ac_try_echo=$ac_try;;
19880 esac
19881 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19882 $as_echo "$ac_try_echo") >&5
19883   (eval "$ac_link") 2>conftest.er1
19884   ac_status=$?
19885   grep -v '^ *+' conftest.er1 >conftest.err
19886   rm -f conftest.er1
19887   cat conftest.err >&5
19888   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19889   (exit $ac_status); } && {
19890          test -z "$ac_c_werror_flag" ||
19891          test ! -s conftest.err
19892        } && test -s conftest$ac_exeext && {
19893          test "$cross_compiling" = yes ||
19894          $as_test_x conftest$ac_exeext
19895        }; then
19896   eval "$as_ac_Lib=yes"
19897 else
19898   $as_echo "$as_me: failed program was:" >&5
19899 sed 's/^/| /' conftest.$ac_ext >&5
19900
19901         eval "$as_ac_Lib=no"
19902 fi
19903
19904 rm -rf conftest.dSYM
19905 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
19906       conftest$ac_exeext conftest.$ac_ext
19907 LIBS=$ac_check_lib_save_LIBS
19908 fi
19909 ac_res=`eval 'as_val=${'$as_ac_Lib'}
19910                  $as_echo "$as_val"'`
19911                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19912 $as_echo "$ac_res" >&6; }
19913 as_val=`eval 'as_val=${'$as_ac_Lib'}
19914                  $as_echo "$as_val"'`
19915    if test "x$as_val" = x""yes; then
19916   result=yes
19917 else
19918   result=no
19919
19920 fi
19921
19922           fi
19923
19924 else
19925   result="no"
19926 fi
19927
19928
19929
19930         # If we found it, no need to search any more.
19931         if test "$result" = "yes"; then
19932           found="$bdb_place"
19933           break
19934         fi
19935       done
19936       test "$found" != "not" && break
19937     done
19938     test "$found" != "not" && break
19939   done
19940
19941   # Restore the original values of the flags we tweak.
19942   LDFLAGS="$apu_check_lib_save_ldflags"
19943   CPPFLAGS="$apu_check_lib_save_cppflags"
19944
19945   case "$found" in
19946   "not")
19947     apu_have_db=0
19948     ;;
19949   "std")
19950     apu_db_header=$bdb_header
19951     apu_db_lib=$bdb_libname
19952     apu_have_db=1
19953     ;;
19954   *":"*)
19955     header="`echo $found | sed -e 's/:.*$//'`"
19956     lib="`echo $found | sed -e 's/^.*://'`"
19957
19958
19959   if test "x$APRUTIL_INCLUDES" = "x"; then
19960     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
19961     APRUTIL_INCLUDES="-I$header"
19962   else
19963     apr_addto_bugger="-I$header"
19964     for i in $apr_addto_bugger; do
19965       apr_addto_duplicate="0"
19966       for j in $APRUTIL_INCLUDES; do
19967         if test "x$i" = "x$j"; then
19968           apr_addto_duplicate="1"
19969           break
19970         fi
19971       done
19972       if test $apr_addto_duplicate = "0"; then
19973         echo "  adding \"$i\" to APRUTIL_INCLUDES"
19974         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
19975       fi
19976     done
19977   fi
19978
19979
19980   if test "x$APRUTIL_LDFLAGS" = "x"; then
19981     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
19982     APRUTIL_LDFLAGS="-L$lib"
19983   else
19984     apr_addto_bugger="-L$lib"
19985     for i in $apr_addto_bugger; do
19986       apr_addto_duplicate="0"
19987       for j in $APRUTIL_LDFLAGS; do
19988         if test "x$i" = "x$j"; then
19989           apr_addto_duplicate="1"
19990           break
19991         fi
19992       done
19993       if test $apr_addto_duplicate = "0"; then
19994         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
19995         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
19996       fi
19997     done
19998   fi
19999
20000     apu_db_header=$bdb_header
20001     apu_db_lib=$bdb_libname
20002     apu_have_db=1
20003     ;;
20004   *)
20005
20006   if test "x$APRUTIL_INCLUDES" = "x"; then
20007     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
20008     APRUTIL_INCLUDES="-I$found/include"
20009   else
20010     apr_addto_bugger="-I$found/include"
20011     for i in $apr_addto_bugger; do
20012       apr_addto_duplicate="0"
20013       for j in $APRUTIL_INCLUDES; do
20014         if test "x$i" = "x$j"; then
20015           apr_addto_duplicate="1"
20016           break
20017         fi
20018       done
20019       if test $apr_addto_duplicate = "0"; then
20020         echo "  adding \"$i\" to APRUTIL_INCLUDES"
20021         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
20022       fi
20023     done
20024   fi
20025
20026
20027   if test "x$APRUTIL_LDFLAGS" = "x"; then
20028     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
20029     APRUTIL_LDFLAGS="-L$found/lib"
20030   else
20031     apr_addto_bugger="-L$found/lib"
20032     for i in $apr_addto_bugger; do
20033       apr_addto_duplicate="0"
20034       for j in $APRUTIL_LDFLAGS; do
20035         if test "x$i" = "x$j"; then
20036           apr_addto_duplicate="1"
20037           break
20038         fi
20039       done
20040       if test $apr_addto_duplicate = "0"; then
20041         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
20042         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
20043       fi
20044     done
20045   fi
20046
20047     apu_db_header=$bdb_header
20048     apu_db_lib=$bdb_libname
20049     apu_have_db=1
20050     ;;
20051   esac
20052
20053   if test "$apu_have_db" = "1"; then
20054     apu_db_version=3
20055   fi
20056
20057     if test "$apu_db_version" != "3"; then
20058       { { $as_echo "$as_me:$LINENO: error: Berkeley db3 not found" >&5
20059 $as_echo "$as_me: error: Berkeley db3 not found" >&2;}
20060    { (exit 1); exit 1; }; }
20061     fi
20062     ;;
20063   db4)
20064
20065   places="$check_places"
20066   if test -z "$places"; then
20067     places="std /usr/local /usr/local/BerkeleyDB.4.0 /boot/home/config"
20068   fi
20069
20070   bdb_version="4"
20071   if test ""0"" != "-1"; then
20072     bdb_version="$bdb_version."0""
20073     if test ""-1"" != "-1"; then
20074       bdb_version="$bdb_version."-1""
20075     fi
20076   fi
20077   bdb_places="$places"
20078   bdb_default_search_headers="db4/db.h db.h"
20079   bdb_default_search_lib_names="db-4.0 db4 db"
20080
20081
20082   apu_have_db=0
20083
20084   # Save the original values of the flags we tweak.
20085   apu_check_lib_save_libs="$LIBS"
20086   apu_check_lib_save_ldflags="$LDFLAGS"
20087   apu_check_lib_save_cppflags="$CPPFLAGS"
20088
20089   # The variable `found' is the prefix under which we've found
20090   # Berkeley DB, or `not' if we haven't found it anywhere yet.
20091   found=not
20092   for bdb_place in $bdb_places; do
20093
20094     LDFLAGS="$apu_check_lib_save_ldflags"
20095     CPPFLAGS="$apu_check_lib_save_cppflags"
20096     case "$bdb_place" in
20097       "std" )
20098         description="the standard places"
20099       ;;
20100       *":"* )
20101         header="`echo $bdb_place | sed -e 's/:.*$//'`"
20102         lib="`echo $bdb_place | sed -e 's/^.*://'`"
20103         CPPFLAGS="$CPPFLAGS -I$header"
20104         LDFLAGS="$LDFLAGS -L$lib"
20105         description="$header and $lib"
20106       ;;
20107       * )
20108         if test -d $bdb_place; then
20109           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
20110           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
20111         else
20112           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
20113 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
20114           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
20115 $as_echo "directory not found" >&6; }
20116           continue
20117         fi
20118         description="$bdb_place"
20119       ;;
20120     esac
20121
20122     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
20123     # trick to display a message instead.
20124     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
20125 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
20126     { $as_echo "$as_me:$LINENO: result: " >&5
20127 $as_echo "" >&6; }
20128
20129     for bdb_libname in $bdb_default_search_lib_names; do
20130       for bdb_header in $bdb_default_search_headers; do
20131         # Clear the header cache variable for each location
20132
20133         cache_id="`echo ac_cv_header_${bdb_header} \
20134                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
20135
20136         unset $cache_id
20137         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
20138 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
20139   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
20140 $as_echo_n "checking for $bdb_header... " >&6; }
20141 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
20142   $as_echo_n "(cached) " >&6
20143 fi
20144 ac_res=`eval 'as_val=${'$as_ac_Header'}
20145                  $as_echo "$as_val"'`
20146                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
20147 $as_echo "$ac_res" >&6; }
20148 else
20149   # Is the header compilable?
20150 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
20151 $as_echo_n "checking $bdb_header usability... " >&6; }
20152 cat >conftest.$ac_ext <<_ACEOF
20153 /* confdefs.h.  */
20154 _ACEOF
20155 cat confdefs.h >>conftest.$ac_ext
20156 cat >>conftest.$ac_ext <<_ACEOF
20157 /* end confdefs.h.  */
20158 $ac_includes_default
20159 #include <$bdb_header>
20160 _ACEOF
20161 rm -f conftest.$ac_objext
20162 if { (ac_try="$ac_compile"
20163 case "(($ac_try" in
20164   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20165   *) ac_try_echo=$ac_try;;
20166 esac
20167 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20168 $as_echo "$ac_try_echo") >&5
20169   (eval "$ac_compile") 2>conftest.er1
20170   ac_status=$?
20171   grep -v '^ *+' conftest.er1 >conftest.err
20172   rm -f conftest.er1
20173   cat conftest.err >&5
20174   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20175   (exit $ac_status); } && {
20176          test -z "$ac_c_werror_flag" ||
20177          test ! -s conftest.err
20178        } && test -s conftest.$ac_objext; then
20179   ac_header_compiler=yes
20180 else
20181   $as_echo "$as_me: failed program was:" >&5
20182 sed 's/^/| /' conftest.$ac_ext >&5
20183
20184         ac_header_compiler=no
20185 fi
20186
20187 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20188 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
20189 $as_echo "$ac_header_compiler" >&6; }
20190
20191 # Is the header present?
20192 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
20193 $as_echo_n "checking $bdb_header presence... " >&6; }
20194 cat >conftest.$ac_ext <<_ACEOF
20195 /* confdefs.h.  */
20196 _ACEOF
20197 cat confdefs.h >>conftest.$ac_ext
20198 cat >>conftest.$ac_ext <<_ACEOF
20199 /* end confdefs.h.  */
20200 #include <$bdb_header>
20201 _ACEOF
20202 if { (ac_try="$ac_cpp conftest.$ac_ext"
20203 case "(($ac_try" in
20204   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20205   *) ac_try_echo=$ac_try;;
20206 esac
20207 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20208 $as_echo "$ac_try_echo") >&5
20209   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
20210   ac_status=$?
20211   grep -v '^ *+' conftest.er1 >conftest.err
20212   rm -f conftest.er1
20213   cat conftest.err >&5
20214   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20215   (exit $ac_status); } >/dev/null && {
20216          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
20217          test ! -s conftest.err
20218        }; then
20219   ac_header_preproc=yes
20220 else
20221   $as_echo "$as_me: failed program was:" >&5
20222 sed 's/^/| /' conftest.$ac_ext >&5
20223
20224   ac_header_preproc=no
20225 fi
20226
20227 rm -f conftest.err conftest.$ac_ext
20228 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
20229 $as_echo "$ac_header_preproc" >&6; }
20230
20231 # So?  What about this header?
20232 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
20233   yes:no: )
20234     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
20235 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
20236     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
20237 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
20238     ac_header_preproc=yes
20239     ;;
20240   no:yes:* )
20241     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
20242 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
20243     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
20244 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
20245     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
20246 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
20247     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
20248 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
20249     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
20250 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
20251     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
20252 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
20253
20254     ;;
20255 esac
20256 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
20257 $as_echo_n "checking for $bdb_header... " >&6; }
20258 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
20259   $as_echo_n "(cached) " >&6
20260 else
20261   eval "$as_ac_Header=\$ac_header_preproc"
20262 fi
20263 ac_res=`eval 'as_val=${'$as_ac_Header'}
20264                  $as_echo "$as_val"'`
20265                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
20266 $as_echo "$ac_res" >&6; }
20267
20268 fi
20269 as_val=`eval 'as_val=${'$as_ac_Header'}
20270                  $as_echo "$as_val"'`
20271    if test "x$as_val" = x""yes; then
20272
20273           if test ""4"" = "3" -o ""4"" = "4"; then
20274             # We generate a separate cache variable for each prefix and libname
20275             # we search under.  That way, we avoid caching information that
20276             # changes if the user runs `configure' with a different set of
20277             # switches.
20278
20279             cache_id="`echo apu_cv_check_berkeley_db_"4"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
20280                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
20281
20282
20283             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
20284 $as_echo_n "checking for -l$bdb_libname... " >&6; }
20285                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
20286   $as_echo_n "(cached) " >&6
20287 else
20288
20289
20290     apu_try_berkeley_db_save_libs="$LIBS"
20291
20292     apu_check_berkeley_db_major="4"
20293     apu_check_berkeley_db_minor="0"
20294     apu_check_berkeley_db_patch="-1"
20295     apu_try_berkeley_db_header=$bdb_header
20296     apu_try_berkeley_db_libname=$bdb_libname
20297
20298     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
20299     if test "$cross_compiling" = yes; then
20300   apu_try_berkeley_db=yes
20301
20302 else
20303   cat >conftest.$ac_ext <<_ACEOF
20304 /* confdefs.h.  */
20305 _ACEOF
20306 cat confdefs.h >>conftest.$ac_ext
20307 cat >>conftest.$ac_ext <<_ACEOF
20308 /* end confdefs.h.  */
20309
20310 #include <stdlib.h>
20311 #include <stdio.h>
20312 #include <$apu_try_berkeley_db_header>
20313 main ()
20314 {
20315   int major, minor, patch;
20316
20317   db_version(&major, &minor, &patch);
20318
20319   /* Sanity check: ensure that db.h constants actually match the db library */
20320   if (major != DB_VERSION_MAJOR
20321       || minor != DB_VERSION_MINOR
20322       || patch != DB_VERSION_PATCH)
20323     exit (1);
20324
20325   /* Run-time check:  ensure the library claims to be the correct version. */
20326
20327   if ($apu_check_berkeley_db_major != -1) {
20328     if (major < $apu_check_berkeley_db_major)
20329       exit (1);
20330     if (major > $apu_check_berkeley_db_major)
20331       exit (0);
20332   }
20333
20334   if ($apu_check_berkeley_db_minor != -1) {
20335     if (minor < $apu_check_berkeley_db_minor)
20336       exit (1);
20337     if (minor > $apu_check_berkeley_db_minor)
20338       exit (0);
20339   }
20340
20341   if ($apu_check_berkeley_db_patch == -1
20342       || patch >= $apu_check_berkeley_db_patch)
20343     exit (0);
20344   else
20345     exit (1);
20346 }
20347
20348 _ACEOF
20349 rm -f conftest$ac_exeext
20350 if { (ac_try="$ac_link"
20351 case "(($ac_try" in
20352   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20353   *) ac_try_echo=$ac_try;;
20354 esac
20355 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20356 $as_echo "$ac_try_echo") >&5
20357   (eval "$ac_link") 2>&5
20358   ac_status=$?
20359   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20360   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20361   { (case "(($ac_try" in
20362   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20363   *) ac_try_echo=$ac_try;;
20364 esac
20365 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20366 $as_echo "$ac_try_echo") >&5
20367   (eval "$ac_try") 2>&5
20368   ac_status=$?
20369   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20370   (exit $ac_status); }; }; then
20371   apu_try_berkeley_db=yes
20372 else
20373   $as_echo "$as_me: program exited with status $ac_status" >&5
20374 $as_echo "$as_me: failed program was:" >&5
20375 sed 's/^/| /' conftest.$ac_ext >&5
20376
20377 ( exit $ac_status )
20378 apu_try_berkeley_db=no
20379 fi
20380 rm -rf conftest.dSYM
20381 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20382 fi
20383
20384
20385
20386     LIBS="$apu_try_berkeley_db_save_libs"
20387
20388
20389                 eval "$cache_id=$apu_try_berkeley_db"
20390
20391 fi
20392
20393             result="`eval echo '$'$cache_id`"
20394             { $as_echo "$as_me:$LINENO: result: $result" >&5
20395 $as_echo "$result" >&6; }
20396           elif test ""4"" = "1"; then
20397             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
20398 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
20399 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
20400 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
20401   $as_echo_n "(cached) " >&6
20402 else
20403   ac_check_lib_save_LIBS=$LIBS
20404 LIBS="-l$bdb_libname  $LIBS"
20405 cat >conftest.$ac_ext <<_ACEOF
20406 /* confdefs.h.  */
20407 _ACEOF
20408 cat confdefs.h >>conftest.$ac_ext
20409 cat >>conftest.$ac_ext <<_ACEOF
20410 /* end confdefs.h.  */
20411
20412 /* Override any GCC internal prototype to avoid an error.
20413    Use char because int might match the return type of a GCC
20414    builtin and then its argument prototype would still apply.  */
20415 #ifdef __cplusplus
20416 extern "C"
20417 #endif
20418 char dbopen ();
20419 int
20420 main ()
20421 {
20422 return dbopen ();
20423   ;
20424   return 0;
20425 }
20426 _ACEOF
20427 rm -f conftest.$ac_objext conftest$ac_exeext
20428 if { (ac_try="$ac_link"
20429 case "(($ac_try" in
20430   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20431   *) ac_try_echo=$ac_try;;
20432 esac
20433 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20434 $as_echo "$ac_try_echo") >&5
20435   (eval "$ac_link") 2>conftest.er1
20436   ac_status=$?
20437   grep -v '^ *+' conftest.er1 >conftest.err
20438   rm -f conftest.er1
20439   cat conftest.err >&5
20440   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20441   (exit $ac_status); } && {
20442          test -z "$ac_c_werror_flag" ||
20443          test ! -s conftest.err
20444        } && test -s conftest$ac_exeext && {
20445          test "$cross_compiling" = yes ||
20446          $as_test_x conftest$ac_exeext
20447        }; then
20448   eval "$as_ac_Lib=yes"
20449 else
20450   $as_echo "$as_me: failed program was:" >&5
20451 sed 's/^/| /' conftest.$ac_ext >&5
20452
20453         eval "$as_ac_Lib=no"
20454 fi
20455
20456 rm -rf conftest.dSYM
20457 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
20458       conftest$ac_exeext conftest.$ac_ext
20459 LIBS=$ac_check_lib_save_LIBS
20460 fi
20461 ac_res=`eval 'as_val=${'$as_ac_Lib'}
20462                  $as_echo "$as_val"'`
20463                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
20464 $as_echo "$ac_res" >&6; }
20465 as_val=`eval 'as_val=${'$as_ac_Lib'}
20466                  $as_echo "$as_val"'`
20467    if test "x$as_val" = x""yes; then
20468   result=yes
20469 else
20470   result=no
20471
20472 fi
20473
20474           elif test ""4"" = "2"; then
20475             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
20476 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
20477 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
20478 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
20479   $as_echo_n "(cached) " >&6
20480 else
20481   ac_check_lib_save_LIBS=$LIBS
20482 LIBS="-l$bdb_libname  $LIBS"
20483 cat >conftest.$ac_ext <<_ACEOF
20484 /* confdefs.h.  */
20485 _ACEOF
20486 cat confdefs.h >>conftest.$ac_ext
20487 cat >>conftest.$ac_ext <<_ACEOF
20488 /* end confdefs.h.  */
20489
20490 /* Override any GCC internal prototype to avoid an error.
20491    Use char because int might match the return type of a GCC
20492    builtin and then its argument prototype would still apply.  */
20493 #ifdef __cplusplus
20494 extern "C"
20495 #endif
20496 char db_open ();
20497 int
20498 main ()
20499 {
20500 return db_open ();
20501   ;
20502   return 0;
20503 }
20504 _ACEOF
20505 rm -f conftest.$ac_objext conftest$ac_exeext
20506 if { (ac_try="$ac_link"
20507 case "(($ac_try" in
20508   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20509   *) ac_try_echo=$ac_try;;
20510 esac
20511 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20512 $as_echo "$ac_try_echo") >&5
20513   (eval "$ac_link") 2>conftest.er1
20514   ac_status=$?
20515   grep -v '^ *+' conftest.er1 >conftest.err
20516   rm -f conftest.er1
20517   cat conftest.err >&5
20518   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20519   (exit $ac_status); } && {
20520          test -z "$ac_c_werror_flag" ||
20521          test ! -s conftest.err
20522        } && test -s conftest$ac_exeext && {
20523          test "$cross_compiling" = yes ||
20524          $as_test_x conftest$ac_exeext
20525        }; then
20526   eval "$as_ac_Lib=yes"
20527 else
20528   $as_echo "$as_me: failed program was:" >&5
20529 sed 's/^/| /' conftest.$ac_ext >&5
20530
20531         eval "$as_ac_Lib=no"
20532 fi
20533
20534 rm -rf conftest.dSYM
20535 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
20536       conftest$ac_exeext conftest.$ac_ext
20537 LIBS=$ac_check_lib_save_LIBS
20538 fi
20539 ac_res=`eval 'as_val=${'$as_ac_Lib'}
20540                  $as_echo "$as_val"'`
20541                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
20542 $as_echo "$ac_res" >&6; }
20543 as_val=`eval 'as_val=${'$as_ac_Lib'}
20544                  $as_echo "$as_val"'`
20545    if test "x$as_val" = x""yes; then
20546   result=yes
20547 else
20548   result=no
20549
20550 fi
20551
20552           fi
20553
20554 else
20555   result="no"
20556 fi
20557
20558
20559
20560         # If we found it, no need to search any more.
20561         if test "$result" = "yes"; then
20562           found="$bdb_place"
20563           break
20564         fi
20565       done
20566       test "$found" != "not" && break
20567     done
20568     test "$found" != "not" && break
20569   done
20570
20571   # Restore the original values of the flags we tweak.
20572   LDFLAGS="$apu_check_lib_save_ldflags"
20573   CPPFLAGS="$apu_check_lib_save_cppflags"
20574
20575   case "$found" in
20576   "not")
20577     apu_have_db=0
20578     ;;
20579   "std")
20580     apu_db_header=$bdb_header
20581     apu_db_lib=$bdb_libname
20582     apu_have_db=1
20583     ;;
20584   *":"*)
20585     header="`echo $found | sed -e 's/:.*$//'`"
20586     lib="`echo $found | sed -e 's/^.*://'`"
20587
20588
20589   if test "x$APRUTIL_INCLUDES" = "x"; then
20590     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
20591     APRUTIL_INCLUDES="-I$header"
20592   else
20593     apr_addto_bugger="-I$header"
20594     for i in $apr_addto_bugger; do
20595       apr_addto_duplicate="0"
20596       for j in $APRUTIL_INCLUDES; do
20597         if test "x$i" = "x$j"; then
20598           apr_addto_duplicate="1"
20599           break
20600         fi
20601       done
20602       if test $apr_addto_duplicate = "0"; then
20603         echo "  adding \"$i\" to APRUTIL_INCLUDES"
20604         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
20605       fi
20606     done
20607   fi
20608
20609
20610   if test "x$APRUTIL_LDFLAGS" = "x"; then
20611     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
20612     APRUTIL_LDFLAGS="-L$lib"
20613   else
20614     apr_addto_bugger="-L$lib"
20615     for i in $apr_addto_bugger; do
20616       apr_addto_duplicate="0"
20617       for j in $APRUTIL_LDFLAGS; do
20618         if test "x$i" = "x$j"; then
20619           apr_addto_duplicate="1"
20620           break
20621         fi
20622       done
20623       if test $apr_addto_duplicate = "0"; then
20624         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
20625         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
20626       fi
20627     done
20628   fi
20629
20630     apu_db_header=$bdb_header
20631     apu_db_lib=$bdb_libname
20632     apu_have_db=1
20633     ;;
20634   *)
20635
20636   if test "x$APRUTIL_INCLUDES" = "x"; then
20637     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
20638     APRUTIL_INCLUDES="-I$found/include"
20639   else
20640     apr_addto_bugger="-I$found/include"
20641     for i in $apr_addto_bugger; do
20642       apr_addto_duplicate="0"
20643       for j in $APRUTIL_INCLUDES; do
20644         if test "x$i" = "x$j"; then
20645           apr_addto_duplicate="1"
20646           break
20647         fi
20648       done
20649       if test $apr_addto_duplicate = "0"; then
20650         echo "  adding \"$i\" to APRUTIL_INCLUDES"
20651         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
20652       fi
20653     done
20654   fi
20655
20656
20657   if test "x$APRUTIL_LDFLAGS" = "x"; then
20658     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
20659     APRUTIL_LDFLAGS="-L$found/lib"
20660   else
20661     apr_addto_bugger="-L$found/lib"
20662     for i in $apr_addto_bugger; do
20663       apr_addto_duplicate="0"
20664       for j in $APRUTIL_LDFLAGS; do
20665         if test "x$i" = "x$j"; then
20666           apr_addto_duplicate="1"
20667           break
20668         fi
20669       done
20670       if test $apr_addto_duplicate = "0"; then
20671         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
20672         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
20673       fi
20674     done
20675   fi
20676
20677     apu_db_header=$bdb_header
20678     apu_db_lib=$bdb_libname
20679     apu_have_db=1
20680     ;;
20681   esac
20682
20683   if test "$apu_have_db" = "1"; then
20684     apu_db_version=4
20685   fi
20686
20687     if test "$apu_db_version" != "4"; then
20688       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
20689 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
20690    { (exit 1); exit 1; }; }
20691     fi
20692     ;;
20693   db41)
20694
20695   places="$check_places"
20696   if test -z "$places"; then
20697     places="std /usr/local /usr/local/BerkeleyDB.4.1 /boot/home/config"
20698   fi
20699
20700   bdb_version="4"
20701   if test ""1"" != "-1"; then
20702     bdb_version="$bdb_version."1""
20703     if test ""-1"" != "-1"; then
20704       bdb_version="$bdb_version."-1""
20705     fi
20706   fi
20707   bdb_places="$places"
20708   bdb_default_search_headers="db41/db.h db4/db.h db.h"
20709   bdb_default_search_lib_names="db-4.1 db41 db4 db"
20710
20711
20712   apu_have_db=0
20713
20714   # Save the original values of the flags we tweak.
20715   apu_check_lib_save_libs="$LIBS"
20716   apu_check_lib_save_ldflags="$LDFLAGS"
20717   apu_check_lib_save_cppflags="$CPPFLAGS"
20718
20719   # The variable `found' is the prefix under which we've found
20720   # Berkeley DB, or `not' if we haven't found it anywhere yet.
20721   found=not
20722   for bdb_place in $bdb_places; do
20723
20724     LDFLAGS="$apu_check_lib_save_ldflags"
20725     CPPFLAGS="$apu_check_lib_save_cppflags"
20726     case "$bdb_place" in
20727       "std" )
20728         description="the standard places"
20729       ;;
20730       *":"* )
20731         header="`echo $bdb_place | sed -e 's/:.*$//'`"
20732         lib="`echo $bdb_place | sed -e 's/^.*://'`"
20733         CPPFLAGS="$CPPFLAGS -I$header"
20734         LDFLAGS="$LDFLAGS -L$lib"
20735         description="$header and $lib"
20736       ;;
20737       * )
20738         if test -d $bdb_place; then
20739           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
20740           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
20741         else
20742           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
20743 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
20744           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
20745 $as_echo "directory not found" >&6; }
20746           continue
20747         fi
20748         description="$bdb_place"
20749       ;;
20750     esac
20751
20752     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
20753     # trick to display a message instead.
20754     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
20755 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
20756     { $as_echo "$as_me:$LINENO: result: " >&5
20757 $as_echo "" >&6; }
20758
20759     for bdb_libname in $bdb_default_search_lib_names; do
20760       for bdb_header in $bdb_default_search_headers; do
20761         # Clear the header cache variable for each location
20762
20763         cache_id="`echo ac_cv_header_${bdb_header} \
20764                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
20765
20766         unset $cache_id
20767         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
20768 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
20769   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
20770 $as_echo_n "checking for $bdb_header... " >&6; }
20771 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
20772   $as_echo_n "(cached) " >&6
20773 fi
20774 ac_res=`eval 'as_val=${'$as_ac_Header'}
20775                  $as_echo "$as_val"'`
20776                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
20777 $as_echo "$ac_res" >&6; }
20778 else
20779   # Is the header compilable?
20780 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
20781 $as_echo_n "checking $bdb_header usability... " >&6; }
20782 cat >conftest.$ac_ext <<_ACEOF
20783 /* confdefs.h.  */
20784 _ACEOF
20785 cat confdefs.h >>conftest.$ac_ext
20786 cat >>conftest.$ac_ext <<_ACEOF
20787 /* end confdefs.h.  */
20788 $ac_includes_default
20789 #include <$bdb_header>
20790 _ACEOF
20791 rm -f conftest.$ac_objext
20792 if { (ac_try="$ac_compile"
20793 case "(($ac_try" in
20794   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20795   *) ac_try_echo=$ac_try;;
20796 esac
20797 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20798 $as_echo "$ac_try_echo") >&5
20799   (eval "$ac_compile") 2>conftest.er1
20800   ac_status=$?
20801   grep -v '^ *+' conftest.er1 >conftest.err
20802   rm -f conftest.er1
20803   cat conftest.err >&5
20804   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20805   (exit $ac_status); } && {
20806          test -z "$ac_c_werror_flag" ||
20807          test ! -s conftest.err
20808        } && test -s conftest.$ac_objext; then
20809   ac_header_compiler=yes
20810 else
20811   $as_echo "$as_me: failed program was:" >&5
20812 sed 's/^/| /' conftest.$ac_ext >&5
20813
20814         ac_header_compiler=no
20815 fi
20816
20817 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20818 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
20819 $as_echo "$ac_header_compiler" >&6; }
20820
20821 # Is the header present?
20822 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
20823 $as_echo_n "checking $bdb_header presence... " >&6; }
20824 cat >conftest.$ac_ext <<_ACEOF
20825 /* confdefs.h.  */
20826 _ACEOF
20827 cat confdefs.h >>conftest.$ac_ext
20828 cat >>conftest.$ac_ext <<_ACEOF
20829 /* end confdefs.h.  */
20830 #include <$bdb_header>
20831 _ACEOF
20832 if { (ac_try="$ac_cpp conftest.$ac_ext"
20833 case "(($ac_try" in
20834   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20835   *) ac_try_echo=$ac_try;;
20836 esac
20837 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20838 $as_echo "$ac_try_echo") >&5
20839   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
20840   ac_status=$?
20841   grep -v '^ *+' conftest.er1 >conftest.err
20842   rm -f conftest.er1
20843   cat conftest.err >&5
20844   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20845   (exit $ac_status); } >/dev/null && {
20846          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
20847          test ! -s conftest.err
20848        }; then
20849   ac_header_preproc=yes
20850 else
20851   $as_echo "$as_me: failed program was:" >&5
20852 sed 's/^/| /' conftest.$ac_ext >&5
20853
20854   ac_header_preproc=no
20855 fi
20856
20857 rm -f conftest.err conftest.$ac_ext
20858 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
20859 $as_echo "$ac_header_preproc" >&6; }
20860
20861 # So?  What about this header?
20862 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
20863   yes:no: )
20864     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
20865 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
20866     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
20867 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
20868     ac_header_preproc=yes
20869     ;;
20870   no:yes:* )
20871     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
20872 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
20873     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
20874 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
20875     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
20876 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
20877     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
20878 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
20879     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
20880 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
20881     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
20882 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
20883
20884     ;;
20885 esac
20886 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
20887 $as_echo_n "checking for $bdb_header... " >&6; }
20888 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
20889   $as_echo_n "(cached) " >&6
20890 else
20891   eval "$as_ac_Header=\$ac_header_preproc"
20892 fi
20893 ac_res=`eval 'as_val=${'$as_ac_Header'}
20894                  $as_echo "$as_val"'`
20895                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
20896 $as_echo "$ac_res" >&6; }
20897
20898 fi
20899 as_val=`eval 'as_val=${'$as_ac_Header'}
20900                  $as_echo "$as_val"'`
20901    if test "x$as_val" = x""yes; then
20902
20903           if test ""4"" = "3" -o ""4"" = "4"; then
20904             # We generate a separate cache variable for each prefix and libname
20905             # we search under.  That way, we avoid caching information that
20906             # changes if the user runs `configure' with a different set of
20907             # switches.
20908
20909             cache_id="`echo apu_cv_check_berkeley_db_"4"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
20910                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
20911
20912
20913             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
20914 $as_echo_n "checking for -l$bdb_libname... " >&6; }
20915                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
20916   $as_echo_n "(cached) " >&6
20917 else
20918
20919
20920     apu_try_berkeley_db_save_libs="$LIBS"
20921
20922     apu_check_berkeley_db_major="4"
20923     apu_check_berkeley_db_minor="1"
20924     apu_check_berkeley_db_patch="-1"
20925     apu_try_berkeley_db_header=$bdb_header
20926     apu_try_berkeley_db_libname=$bdb_libname
20927
20928     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
20929     if test "$cross_compiling" = yes; then
20930   apu_try_berkeley_db=yes
20931
20932 else
20933   cat >conftest.$ac_ext <<_ACEOF
20934 /* confdefs.h.  */
20935 _ACEOF
20936 cat confdefs.h >>conftest.$ac_ext
20937 cat >>conftest.$ac_ext <<_ACEOF
20938 /* end confdefs.h.  */
20939
20940 #include <stdlib.h>
20941 #include <stdio.h>
20942 #include <$apu_try_berkeley_db_header>
20943 main ()
20944 {
20945   int major, minor, patch;
20946
20947   db_version(&major, &minor, &patch);
20948
20949   /* Sanity check: ensure that db.h constants actually match the db library */
20950   if (major != DB_VERSION_MAJOR
20951       || minor != DB_VERSION_MINOR
20952       || patch != DB_VERSION_PATCH)
20953     exit (1);
20954
20955   /* Run-time check:  ensure the library claims to be the correct version. */
20956
20957   if ($apu_check_berkeley_db_major != -1) {
20958     if (major < $apu_check_berkeley_db_major)
20959       exit (1);
20960     if (major > $apu_check_berkeley_db_major)
20961       exit (0);
20962   }
20963
20964   if ($apu_check_berkeley_db_minor != -1) {
20965     if (minor < $apu_check_berkeley_db_minor)
20966       exit (1);
20967     if (minor > $apu_check_berkeley_db_minor)
20968       exit (0);
20969   }
20970
20971   if ($apu_check_berkeley_db_patch == -1
20972       || patch >= $apu_check_berkeley_db_patch)
20973     exit (0);
20974   else
20975     exit (1);
20976 }
20977
20978 _ACEOF
20979 rm -f conftest$ac_exeext
20980 if { (ac_try="$ac_link"
20981 case "(($ac_try" in
20982   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20983   *) ac_try_echo=$ac_try;;
20984 esac
20985 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20986 $as_echo "$ac_try_echo") >&5
20987   (eval "$ac_link") 2>&5
20988   ac_status=$?
20989   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20990   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20991   { (case "(($ac_try" in
20992   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20993   *) ac_try_echo=$ac_try;;
20994 esac
20995 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20996 $as_echo "$ac_try_echo") >&5
20997   (eval "$ac_try") 2>&5
20998   ac_status=$?
20999   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21000   (exit $ac_status); }; }; then
21001   apu_try_berkeley_db=yes
21002 else
21003   $as_echo "$as_me: program exited with status $ac_status" >&5
21004 $as_echo "$as_me: failed program was:" >&5
21005 sed 's/^/| /' conftest.$ac_ext >&5
21006
21007 ( exit $ac_status )
21008 apu_try_berkeley_db=no
21009 fi
21010 rm -rf conftest.dSYM
21011 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
21012 fi
21013
21014
21015
21016     LIBS="$apu_try_berkeley_db_save_libs"
21017
21018
21019                 eval "$cache_id=$apu_try_berkeley_db"
21020
21021 fi
21022
21023             result="`eval echo '$'$cache_id`"
21024             { $as_echo "$as_me:$LINENO: result: $result" >&5
21025 $as_echo "$result" >&6; }
21026           elif test ""4"" = "1"; then
21027             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
21028 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
21029 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
21030 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
21031   $as_echo_n "(cached) " >&6
21032 else
21033   ac_check_lib_save_LIBS=$LIBS
21034 LIBS="-l$bdb_libname  $LIBS"
21035 cat >conftest.$ac_ext <<_ACEOF
21036 /* confdefs.h.  */
21037 _ACEOF
21038 cat confdefs.h >>conftest.$ac_ext
21039 cat >>conftest.$ac_ext <<_ACEOF
21040 /* end confdefs.h.  */
21041
21042 /* Override any GCC internal prototype to avoid an error.
21043    Use char because int might match the return type of a GCC
21044    builtin and then its argument prototype would still apply.  */
21045 #ifdef __cplusplus
21046 extern "C"
21047 #endif
21048 char dbopen ();
21049 int
21050 main ()
21051 {
21052 return dbopen ();
21053   ;
21054   return 0;
21055 }
21056 _ACEOF
21057 rm -f conftest.$ac_objext conftest$ac_exeext
21058 if { (ac_try="$ac_link"
21059 case "(($ac_try" in
21060   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21061   *) ac_try_echo=$ac_try;;
21062 esac
21063 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21064 $as_echo "$ac_try_echo") >&5
21065   (eval "$ac_link") 2>conftest.er1
21066   ac_status=$?
21067   grep -v '^ *+' conftest.er1 >conftest.err
21068   rm -f conftest.er1
21069   cat conftest.err >&5
21070   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21071   (exit $ac_status); } && {
21072          test -z "$ac_c_werror_flag" ||
21073          test ! -s conftest.err
21074        } && test -s conftest$ac_exeext && {
21075          test "$cross_compiling" = yes ||
21076          $as_test_x conftest$ac_exeext
21077        }; then
21078   eval "$as_ac_Lib=yes"
21079 else
21080   $as_echo "$as_me: failed program was:" >&5
21081 sed 's/^/| /' conftest.$ac_ext >&5
21082
21083         eval "$as_ac_Lib=no"
21084 fi
21085
21086 rm -rf conftest.dSYM
21087 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21088       conftest$ac_exeext conftest.$ac_ext
21089 LIBS=$ac_check_lib_save_LIBS
21090 fi
21091 ac_res=`eval 'as_val=${'$as_ac_Lib'}
21092                  $as_echo "$as_val"'`
21093                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
21094 $as_echo "$ac_res" >&6; }
21095 as_val=`eval 'as_val=${'$as_ac_Lib'}
21096                  $as_echo "$as_val"'`
21097    if test "x$as_val" = x""yes; then
21098   result=yes
21099 else
21100   result=no
21101
21102 fi
21103
21104           elif test ""4"" = "2"; then
21105             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
21106 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
21107 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
21108 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
21109   $as_echo_n "(cached) " >&6
21110 else
21111   ac_check_lib_save_LIBS=$LIBS
21112 LIBS="-l$bdb_libname  $LIBS"
21113 cat >conftest.$ac_ext <<_ACEOF
21114 /* confdefs.h.  */
21115 _ACEOF
21116 cat confdefs.h >>conftest.$ac_ext
21117 cat >>conftest.$ac_ext <<_ACEOF
21118 /* end confdefs.h.  */
21119
21120 /* Override any GCC internal prototype to avoid an error.
21121    Use char because int might match the return type of a GCC
21122    builtin and then its argument prototype would still apply.  */
21123 #ifdef __cplusplus
21124 extern "C"
21125 #endif
21126 char db_open ();
21127 int
21128 main ()
21129 {
21130 return db_open ();
21131   ;
21132   return 0;
21133 }
21134 _ACEOF
21135 rm -f conftest.$ac_objext conftest$ac_exeext
21136 if { (ac_try="$ac_link"
21137 case "(($ac_try" in
21138   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21139   *) ac_try_echo=$ac_try;;
21140 esac
21141 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21142 $as_echo "$ac_try_echo") >&5
21143   (eval "$ac_link") 2>conftest.er1
21144   ac_status=$?
21145   grep -v '^ *+' conftest.er1 >conftest.err
21146   rm -f conftest.er1
21147   cat conftest.err >&5
21148   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21149   (exit $ac_status); } && {
21150          test -z "$ac_c_werror_flag" ||
21151          test ! -s conftest.err
21152        } && test -s conftest$ac_exeext && {
21153          test "$cross_compiling" = yes ||
21154          $as_test_x conftest$ac_exeext
21155        }; then
21156   eval "$as_ac_Lib=yes"
21157 else
21158   $as_echo "$as_me: failed program was:" >&5
21159 sed 's/^/| /' conftest.$ac_ext >&5
21160
21161         eval "$as_ac_Lib=no"
21162 fi
21163
21164 rm -rf conftest.dSYM
21165 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21166       conftest$ac_exeext conftest.$ac_ext
21167 LIBS=$ac_check_lib_save_LIBS
21168 fi
21169 ac_res=`eval 'as_val=${'$as_ac_Lib'}
21170                  $as_echo "$as_val"'`
21171                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
21172 $as_echo "$ac_res" >&6; }
21173 as_val=`eval 'as_val=${'$as_ac_Lib'}
21174                  $as_echo "$as_val"'`
21175    if test "x$as_val" = x""yes; then
21176   result=yes
21177 else
21178   result=no
21179
21180 fi
21181
21182           fi
21183
21184 else
21185   result="no"
21186 fi
21187
21188
21189
21190         # If we found it, no need to search any more.
21191         if test "$result" = "yes"; then
21192           found="$bdb_place"
21193           break
21194         fi
21195       done
21196       test "$found" != "not" && break
21197     done
21198     test "$found" != "not" && break
21199   done
21200
21201   # Restore the original values of the flags we tweak.
21202   LDFLAGS="$apu_check_lib_save_ldflags"
21203   CPPFLAGS="$apu_check_lib_save_cppflags"
21204
21205   case "$found" in
21206   "not")
21207     apu_have_db=0
21208     ;;
21209   "std")
21210     apu_db_header=$bdb_header
21211     apu_db_lib=$bdb_libname
21212     apu_have_db=1
21213     ;;
21214   *":"*)
21215     header="`echo $found | sed -e 's/:.*$//'`"
21216     lib="`echo $found | sed -e 's/^.*://'`"
21217
21218
21219   if test "x$APRUTIL_INCLUDES" = "x"; then
21220     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
21221     APRUTIL_INCLUDES="-I$header"
21222   else
21223     apr_addto_bugger="-I$header"
21224     for i in $apr_addto_bugger; do
21225       apr_addto_duplicate="0"
21226       for j in $APRUTIL_INCLUDES; do
21227         if test "x$i" = "x$j"; then
21228           apr_addto_duplicate="1"
21229           break
21230         fi
21231       done
21232       if test $apr_addto_duplicate = "0"; then
21233         echo "  adding \"$i\" to APRUTIL_INCLUDES"
21234         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
21235       fi
21236     done
21237   fi
21238
21239
21240   if test "x$APRUTIL_LDFLAGS" = "x"; then
21241     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
21242     APRUTIL_LDFLAGS="-L$lib"
21243   else
21244     apr_addto_bugger="-L$lib"
21245     for i in $apr_addto_bugger; do
21246       apr_addto_duplicate="0"
21247       for j in $APRUTIL_LDFLAGS; do
21248         if test "x$i" = "x$j"; then
21249           apr_addto_duplicate="1"
21250           break
21251         fi
21252       done
21253       if test $apr_addto_duplicate = "0"; then
21254         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
21255         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
21256       fi
21257     done
21258   fi
21259
21260     apu_db_header=$bdb_header
21261     apu_db_lib=$bdb_libname
21262     apu_have_db=1
21263     ;;
21264   *)
21265
21266   if test "x$APRUTIL_INCLUDES" = "x"; then
21267     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
21268     APRUTIL_INCLUDES="-I$found/include"
21269   else
21270     apr_addto_bugger="-I$found/include"
21271     for i in $apr_addto_bugger; do
21272       apr_addto_duplicate="0"
21273       for j in $APRUTIL_INCLUDES; do
21274         if test "x$i" = "x$j"; then
21275           apr_addto_duplicate="1"
21276           break
21277         fi
21278       done
21279       if test $apr_addto_duplicate = "0"; then
21280         echo "  adding \"$i\" to APRUTIL_INCLUDES"
21281         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
21282       fi
21283     done
21284   fi
21285
21286
21287   if test "x$APRUTIL_LDFLAGS" = "x"; then
21288     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
21289     APRUTIL_LDFLAGS="-L$found/lib"
21290   else
21291     apr_addto_bugger="-L$found/lib"
21292     for i in $apr_addto_bugger; do
21293       apr_addto_duplicate="0"
21294       for j in $APRUTIL_LDFLAGS; do
21295         if test "x$i" = "x$j"; then
21296           apr_addto_duplicate="1"
21297           break
21298         fi
21299       done
21300       if test $apr_addto_duplicate = "0"; then
21301         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
21302         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
21303       fi
21304     done
21305   fi
21306
21307     apu_db_header=$bdb_header
21308     apu_db_lib=$bdb_libname
21309     apu_have_db=1
21310     ;;
21311   esac
21312
21313   if test "$apu_have_db" = "1"; then
21314     apu_db_version=4
21315   fi
21316
21317     if test "$apu_db_version" != "4"; then
21318       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
21319 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
21320    { (exit 1); exit 1; }; }
21321     fi
21322     ;;
21323   db42)
21324
21325   places="$check_places"
21326   if test -z "$places"; then
21327     places="std /usr/local /usr/local/BerkeleyDB.4.2 /boot/home/config"
21328   fi
21329
21330   bdb_version="4"
21331   if test ""2"" != "-1"; then
21332     bdb_version="$bdb_version."2""
21333     if test ""-1"" != "-1"; then
21334       bdb_version="$bdb_version."-1""
21335     fi
21336   fi
21337   bdb_places="$places"
21338   bdb_default_search_headers="db42/db.h db4/db.h db.h"
21339   bdb_default_search_lib_names="db-4.2 db42 db4 db"
21340
21341
21342   apu_have_db=0
21343
21344   # Save the original values of the flags we tweak.
21345   apu_check_lib_save_libs="$LIBS"
21346   apu_check_lib_save_ldflags="$LDFLAGS"
21347   apu_check_lib_save_cppflags="$CPPFLAGS"
21348
21349   # The variable `found' is the prefix under which we've found
21350   # Berkeley DB, or `not' if we haven't found it anywhere yet.
21351   found=not
21352   for bdb_place in $bdb_places; do
21353
21354     LDFLAGS="$apu_check_lib_save_ldflags"
21355     CPPFLAGS="$apu_check_lib_save_cppflags"
21356     case "$bdb_place" in
21357       "std" )
21358         description="the standard places"
21359       ;;
21360       *":"* )
21361         header="`echo $bdb_place | sed -e 's/:.*$//'`"
21362         lib="`echo $bdb_place | sed -e 's/^.*://'`"
21363         CPPFLAGS="$CPPFLAGS -I$header"
21364         LDFLAGS="$LDFLAGS -L$lib"
21365         description="$header and $lib"
21366       ;;
21367       * )
21368         if test -d $bdb_place; then
21369           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
21370           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
21371         else
21372           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
21373 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
21374           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
21375 $as_echo "directory not found" >&6; }
21376           continue
21377         fi
21378         description="$bdb_place"
21379       ;;
21380     esac
21381
21382     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
21383     # trick to display a message instead.
21384     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
21385 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
21386     { $as_echo "$as_me:$LINENO: result: " >&5
21387 $as_echo "" >&6; }
21388
21389     for bdb_libname in $bdb_default_search_lib_names; do
21390       for bdb_header in $bdb_default_search_headers; do
21391         # Clear the header cache variable for each location
21392
21393         cache_id="`echo ac_cv_header_${bdb_header} \
21394                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
21395
21396         unset $cache_id
21397         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
21398 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
21399   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
21400 $as_echo_n "checking for $bdb_header... " >&6; }
21401 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
21402   $as_echo_n "(cached) " >&6
21403 fi
21404 ac_res=`eval 'as_val=${'$as_ac_Header'}
21405                  $as_echo "$as_val"'`
21406                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
21407 $as_echo "$ac_res" >&6; }
21408 else
21409   # Is the header compilable?
21410 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
21411 $as_echo_n "checking $bdb_header usability... " >&6; }
21412 cat >conftest.$ac_ext <<_ACEOF
21413 /* confdefs.h.  */
21414 _ACEOF
21415 cat confdefs.h >>conftest.$ac_ext
21416 cat >>conftest.$ac_ext <<_ACEOF
21417 /* end confdefs.h.  */
21418 $ac_includes_default
21419 #include <$bdb_header>
21420 _ACEOF
21421 rm -f conftest.$ac_objext
21422 if { (ac_try="$ac_compile"
21423 case "(($ac_try" in
21424   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21425   *) ac_try_echo=$ac_try;;
21426 esac
21427 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21428 $as_echo "$ac_try_echo") >&5
21429   (eval "$ac_compile") 2>conftest.er1
21430   ac_status=$?
21431   grep -v '^ *+' conftest.er1 >conftest.err
21432   rm -f conftest.er1
21433   cat conftest.err >&5
21434   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21435   (exit $ac_status); } && {
21436          test -z "$ac_c_werror_flag" ||
21437          test ! -s conftest.err
21438        } && test -s conftest.$ac_objext; then
21439   ac_header_compiler=yes
21440 else
21441   $as_echo "$as_me: failed program was:" >&5
21442 sed 's/^/| /' conftest.$ac_ext >&5
21443
21444         ac_header_compiler=no
21445 fi
21446
21447 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21448 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
21449 $as_echo "$ac_header_compiler" >&6; }
21450
21451 # Is the header present?
21452 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
21453 $as_echo_n "checking $bdb_header presence... " >&6; }
21454 cat >conftest.$ac_ext <<_ACEOF
21455 /* confdefs.h.  */
21456 _ACEOF
21457 cat confdefs.h >>conftest.$ac_ext
21458 cat >>conftest.$ac_ext <<_ACEOF
21459 /* end confdefs.h.  */
21460 #include <$bdb_header>
21461 _ACEOF
21462 if { (ac_try="$ac_cpp conftest.$ac_ext"
21463 case "(($ac_try" in
21464   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21465   *) ac_try_echo=$ac_try;;
21466 esac
21467 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21468 $as_echo "$ac_try_echo") >&5
21469   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
21470   ac_status=$?
21471   grep -v '^ *+' conftest.er1 >conftest.err
21472   rm -f conftest.er1
21473   cat conftest.err >&5
21474   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21475   (exit $ac_status); } >/dev/null && {
21476          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
21477          test ! -s conftest.err
21478        }; then
21479   ac_header_preproc=yes
21480 else
21481   $as_echo "$as_me: failed program was:" >&5
21482 sed 's/^/| /' conftest.$ac_ext >&5
21483
21484   ac_header_preproc=no
21485 fi
21486
21487 rm -f conftest.err conftest.$ac_ext
21488 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
21489 $as_echo "$ac_header_preproc" >&6; }
21490
21491 # So?  What about this header?
21492 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
21493   yes:no: )
21494     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
21495 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
21496     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
21497 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
21498     ac_header_preproc=yes
21499     ;;
21500   no:yes:* )
21501     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
21502 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
21503     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
21504 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
21505     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
21506 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
21507     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
21508 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
21509     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
21510 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
21511     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
21512 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
21513
21514     ;;
21515 esac
21516 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
21517 $as_echo_n "checking for $bdb_header... " >&6; }
21518 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
21519   $as_echo_n "(cached) " >&6
21520 else
21521   eval "$as_ac_Header=\$ac_header_preproc"
21522 fi
21523 ac_res=`eval 'as_val=${'$as_ac_Header'}
21524                  $as_echo "$as_val"'`
21525                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
21526 $as_echo "$ac_res" >&6; }
21527
21528 fi
21529 as_val=`eval 'as_val=${'$as_ac_Header'}
21530                  $as_echo "$as_val"'`
21531    if test "x$as_val" = x""yes; then
21532
21533           if test ""4"" = "3" -o ""4"" = "4"; then
21534             # We generate a separate cache variable for each prefix and libname
21535             # we search under.  That way, we avoid caching information that
21536             # changes if the user runs `configure' with a different set of
21537             # switches.
21538
21539             cache_id="`echo apu_cv_check_berkeley_db_"4"_"2"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
21540                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
21541
21542
21543             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
21544 $as_echo_n "checking for -l$bdb_libname... " >&6; }
21545                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
21546   $as_echo_n "(cached) " >&6
21547 else
21548
21549
21550     apu_try_berkeley_db_save_libs="$LIBS"
21551
21552     apu_check_berkeley_db_major="4"
21553     apu_check_berkeley_db_minor="2"
21554     apu_check_berkeley_db_patch="-1"
21555     apu_try_berkeley_db_header=$bdb_header
21556     apu_try_berkeley_db_libname=$bdb_libname
21557
21558     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
21559     if test "$cross_compiling" = yes; then
21560   apu_try_berkeley_db=yes
21561
21562 else
21563   cat >conftest.$ac_ext <<_ACEOF
21564 /* confdefs.h.  */
21565 _ACEOF
21566 cat confdefs.h >>conftest.$ac_ext
21567 cat >>conftest.$ac_ext <<_ACEOF
21568 /* end confdefs.h.  */
21569
21570 #include <stdlib.h>
21571 #include <stdio.h>
21572 #include <$apu_try_berkeley_db_header>
21573 main ()
21574 {
21575   int major, minor, patch;
21576
21577   db_version(&major, &minor, &patch);
21578
21579   /* Sanity check: ensure that db.h constants actually match the db library */
21580   if (major != DB_VERSION_MAJOR
21581       || minor != DB_VERSION_MINOR
21582       || patch != DB_VERSION_PATCH)
21583     exit (1);
21584
21585   /* Run-time check:  ensure the library claims to be the correct version. */
21586
21587   if ($apu_check_berkeley_db_major != -1) {
21588     if (major < $apu_check_berkeley_db_major)
21589       exit (1);
21590     if (major > $apu_check_berkeley_db_major)
21591       exit (0);
21592   }
21593
21594   if ($apu_check_berkeley_db_minor != -1) {
21595     if (minor < $apu_check_berkeley_db_minor)
21596       exit (1);
21597     if (minor > $apu_check_berkeley_db_minor)
21598       exit (0);
21599   }
21600
21601   if ($apu_check_berkeley_db_patch == -1
21602       || patch >= $apu_check_berkeley_db_patch)
21603     exit (0);
21604   else
21605     exit (1);
21606 }
21607
21608 _ACEOF
21609 rm -f conftest$ac_exeext
21610 if { (ac_try="$ac_link"
21611 case "(($ac_try" in
21612   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21613   *) ac_try_echo=$ac_try;;
21614 esac
21615 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21616 $as_echo "$ac_try_echo") >&5
21617   (eval "$ac_link") 2>&5
21618   ac_status=$?
21619   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21620   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
21621   { (case "(($ac_try" in
21622   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21623   *) ac_try_echo=$ac_try;;
21624 esac
21625 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21626 $as_echo "$ac_try_echo") >&5
21627   (eval "$ac_try") 2>&5
21628   ac_status=$?
21629   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21630   (exit $ac_status); }; }; then
21631   apu_try_berkeley_db=yes
21632 else
21633   $as_echo "$as_me: program exited with status $ac_status" >&5
21634 $as_echo "$as_me: failed program was:" >&5
21635 sed 's/^/| /' conftest.$ac_ext >&5
21636
21637 ( exit $ac_status )
21638 apu_try_berkeley_db=no
21639 fi
21640 rm -rf conftest.dSYM
21641 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
21642 fi
21643
21644
21645
21646     LIBS="$apu_try_berkeley_db_save_libs"
21647
21648
21649                 eval "$cache_id=$apu_try_berkeley_db"
21650
21651 fi
21652
21653             result="`eval echo '$'$cache_id`"
21654             { $as_echo "$as_me:$LINENO: result: $result" >&5
21655 $as_echo "$result" >&6; }
21656           elif test ""4"" = "1"; then
21657             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
21658 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
21659 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
21660 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
21661   $as_echo_n "(cached) " >&6
21662 else
21663   ac_check_lib_save_LIBS=$LIBS
21664 LIBS="-l$bdb_libname  $LIBS"
21665 cat >conftest.$ac_ext <<_ACEOF
21666 /* confdefs.h.  */
21667 _ACEOF
21668 cat confdefs.h >>conftest.$ac_ext
21669 cat >>conftest.$ac_ext <<_ACEOF
21670 /* end confdefs.h.  */
21671
21672 /* Override any GCC internal prototype to avoid an error.
21673    Use char because int might match the return type of a GCC
21674    builtin and then its argument prototype would still apply.  */
21675 #ifdef __cplusplus
21676 extern "C"
21677 #endif
21678 char dbopen ();
21679 int
21680 main ()
21681 {
21682 return dbopen ();
21683   ;
21684   return 0;
21685 }
21686 _ACEOF
21687 rm -f conftest.$ac_objext conftest$ac_exeext
21688 if { (ac_try="$ac_link"
21689 case "(($ac_try" in
21690   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21691   *) ac_try_echo=$ac_try;;
21692 esac
21693 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21694 $as_echo "$ac_try_echo") >&5
21695   (eval "$ac_link") 2>conftest.er1
21696   ac_status=$?
21697   grep -v '^ *+' conftest.er1 >conftest.err
21698   rm -f conftest.er1
21699   cat conftest.err >&5
21700   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21701   (exit $ac_status); } && {
21702          test -z "$ac_c_werror_flag" ||
21703          test ! -s conftest.err
21704        } && test -s conftest$ac_exeext && {
21705          test "$cross_compiling" = yes ||
21706          $as_test_x conftest$ac_exeext
21707        }; then
21708   eval "$as_ac_Lib=yes"
21709 else
21710   $as_echo "$as_me: failed program was:" >&5
21711 sed 's/^/| /' conftest.$ac_ext >&5
21712
21713         eval "$as_ac_Lib=no"
21714 fi
21715
21716 rm -rf conftest.dSYM
21717 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21718       conftest$ac_exeext conftest.$ac_ext
21719 LIBS=$ac_check_lib_save_LIBS
21720 fi
21721 ac_res=`eval 'as_val=${'$as_ac_Lib'}
21722                  $as_echo "$as_val"'`
21723                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
21724 $as_echo "$ac_res" >&6; }
21725 as_val=`eval 'as_val=${'$as_ac_Lib'}
21726                  $as_echo "$as_val"'`
21727    if test "x$as_val" = x""yes; then
21728   result=yes
21729 else
21730   result=no
21731
21732 fi
21733
21734           elif test ""4"" = "2"; then
21735             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
21736 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
21737 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
21738 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
21739   $as_echo_n "(cached) " >&6
21740 else
21741   ac_check_lib_save_LIBS=$LIBS
21742 LIBS="-l$bdb_libname  $LIBS"
21743 cat >conftest.$ac_ext <<_ACEOF
21744 /* confdefs.h.  */
21745 _ACEOF
21746 cat confdefs.h >>conftest.$ac_ext
21747 cat >>conftest.$ac_ext <<_ACEOF
21748 /* end confdefs.h.  */
21749
21750 /* Override any GCC internal prototype to avoid an error.
21751    Use char because int might match the return type of a GCC
21752    builtin and then its argument prototype would still apply.  */
21753 #ifdef __cplusplus
21754 extern "C"
21755 #endif
21756 char db_open ();
21757 int
21758 main ()
21759 {
21760 return db_open ();
21761   ;
21762   return 0;
21763 }
21764 _ACEOF
21765 rm -f conftest.$ac_objext conftest$ac_exeext
21766 if { (ac_try="$ac_link"
21767 case "(($ac_try" in
21768   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21769   *) ac_try_echo=$ac_try;;
21770 esac
21771 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21772 $as_echo "$ac_try_echo") >&5
21773   (eval "$ac_link") 2>conftest.er1
21774   ac_status=$?
21775   grep -v '^ *+' conftest.er1 >conftest.err
21776   rm -f conftest.er1
21777   cat conftest.err >&5
21778   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21779   (exit $ac_status); } && {
21780          test -z "$ac_c_werror_flag" ||
21781          test ! -s conftest.err
21782        } && test -s conftest$ac_exeext && {
21783          test "$cross_compiling" = yes ||
21784          $as_test_x conftest$ac_exeext
21785        }; then
21786   eval "$as_ac_Lib=yes"
21787 else
21788   $as_echo "$as_me: failed program was:" >&5
21789 sed 's/^/| /' conftest.$ac_ext >&5
21790
21791         eval "$as_ac_Lib=no"
21792 fi
21793
21794 rm -rf conftest.dSYM
21795 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21796       conftest$ac_exeext conftest.$ac_ext
21797 LIBS=$ac_check_lib_save_LIBS
21798 fi
21799 ac_res=`eval 'as_val=${'$as_ac_Lib'}
21800                  $as_echo "$as_val"'`
21801                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
21802 $as_echo "$ac_res" >&6; }
21803 as_val=`eval 'as_val=${'$as_ac_Lib'}
21804                  $as_echo "$as_val"'`
21805    if test "x$as_val" = x""yes; then
21806   result=yes
21807 else
21808   result=no
21809
21810 fi
21811
21812           fi
21813
21814 else
21815   result="no"
21816 fi
21817
21818
21819
21820         # If we found it, no need to search any more.
21821         if test "$result" = "yes"; then
21822           found="$bdb_place"
21823           break
21824         fi
21825       done
21826       test "$found" != "not" && break
21827     done
21828     test "$found" != "not" && break
21829   done
21830
21831   # Restore the original values of the flags we tweak.
21832   LDFLAGS="$apu_check_lib_save_ldflags"
21833   CPPFLAGS="$apu_check_lib_save_cppflags"
21834
21835   case "$found" in
21836   "not")
21837     apu_have_db=0
21838     ;;
21839   "std")
21840     apu_db_header=$bdb_header
21841     apu_db_lib=$bdb_libname
21842     apu_have_db=1
21843     ;;
21844   *":"*)
21845     header="`echo $found | sed -e 's/:.*$//'`"
21846     lib="`echo $found | sed -e 's/^.*://'`"
21847
21848
21849   if test "x$APRUTIL_INCLUDES" = "x"; then
21850     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
21851     APRUTIL_INCLUDES="-I$header"
21852   else
21853     apr_addto_bugger="-I$header"
21854     for i in $apr_addto_bugger; do
21855       apr_addto_duplicate="0"
21856       for j in $APRUTIL_INCLUDES; do
21857         if test "x$i" = "x$j"; then
21858           apr_addto_duplicate="1"
21859           break
21860         fi
21861       done
21862       if test $apr_addto_duplicate = "0"; then
21863         echo "  adding \"$i\" to APRUTIL_INCLUDES"
21864         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
21865       fi
21866     done
21867   fi
21868
21869
21870   if test "x$APRUTIL_LDFLAGS" = "x"; then
21871     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
21872     APRUTIL_LDFLAGS="-L$lib"
21873   else
21874     apr_addto_bugger="-L$lib"
21875     for i in $apr_addto_bugger; do
21876       apr_addto_duplicate="0"
21877       for j in $APRUTIL_LDFLAGS; do
21878         if test "x$i" = "x$j"; then
21879           apr_addto_duplicate="1"
21880           break
21881         fi
21882       done
21883       if test $apr_addto_duplicate = "0"; then
21884         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
21885         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
21886       fi
21887     done
21888   fi
21889
21890     apu_db_header=$bdb_header
21891     apu_db_lib=$bdb_libname
21892     apu_have_db=1
21893     ;;
21894   *)
21895
21896   if test "x$APRUTIL_INCLUDES" = "x"; then
21897     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
21898     APRUTIL_INCLUDES="-I$found/include"
21899   else
21900     apr_addto_bugger="-I$found/include"
21901     for i in $apr_addto_bugger; do
21902       apr_addto_duplicate="0"
21903       for j in $APRUTIL_INCLUDES; do
21904         if test "x$i" = "x$j"; then
21905           apr_addto_duplicate="1"
21906           break
21907         fi
21908       done
21909       if test $apr_addto_duplicate = "0"; then
21910         echo "  adding \"$i\" to APRUTIL_INCLUDES"
21911         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
21912       fi
21913     done
21914   fi
21915
21916
21917   if test "x$APRUTIL_LDFLAGS" = "x"; then
21918     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
21919     APRUTIL_LDFLAGS="-L$found/lib"
21920   else
21921     apr_addto_bugger="-L$found/lib"
21922     for i in $apr_addto_bugger; do
21923       apr_addto_duplicate="0"
21924       for j in $APRUTIL_LDFLAGS; do
21925         if test "x$i" = "x$j"; then
21926           apr_addto_duplicate="1"
21927           break
21928         fi
21929       done
21930       if test $apr_addto_duplicate = "0"; then
21931         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
21932         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
21933       fi
21934     done
21935   fi
21936
21937     apu_db_header=$bdb_header
21938     apu_db_lib=$bdb_libname
21939     apu_have_db=1
21940     ;;
21941   esac
21942
21943   if test "$apu_have_db" = "1"; then
21944     apu_db_version=4
21945   fi
21946
21947     if test "$apu_db_version" != "4"; then
21948       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
21949 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
21950    { (exit 1); exit 1; }; }
21951     fi
21952     ;;
21953   db43)
21954
21955   places="$check_places"
21956   if test -z "$places"; then
21957     places="std /usr/local/BerkeleyDB.4.3 /boot/home/config"
21958   fi
21959
21960   bdb_version="4"
21961   if test ""3"" != "-1"; then
21962     bdb_version="$bdb_version."3""
21963     if test ""-1"" != "-1"; then
21964       bdb_version="$bdb_version."-1""
21965     fi
21966   fi
21967   bdb_places="$places"
21968   bdb_default_search_headers="db43/db.h db4/db.h db.h"
21969   bdb_default_search_lib_names="db-4.3 db4-4.3 db43 db4 db"
21970
21971
21972   apu_have_db=0
21973
21974   # Save the original values of the flags we tweak.
21975   apu_check_lib_save_libs="$LIBS"
21976   apu_check_lib_save_ldflags="$LDFLAGS"
21977   apu_check_lib_save_cppflags="$CPPFLAGS"
21978
21979   # The variable `found' is the prefix under which we've found
21980   # Berkeley DB, or `not' if we haven't found it anywhere yet.
21981   found=not
21982   for bdb_place in $bdb_places; do
21983
21984     LDFLAGS="$apu_check_lib_save_ldflags"
21985     CPPFLAGS="$apu_check_lib_save_cppflags"
21986     case "$bdb_place" in
21987       "std" )
21988         description="the standard places"
21989       ;;
21990       *":"* )
21991         header="`echo $bdb_place | sed -e 's/:.*$//'`"
21992         lib="`echo $bdb_place | sed -e 's/^.*://'`"
21993         CPPFLAGS="$CPPFLAGS -I$header"
21994         LDFLAGS="$LDFLAGS -L$lib"
21995         description="$header and $lib"
21996       ;;
21997       * )
21998         if test -d $bdb_place; then
21999           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
22000           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
22001         else
22002           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
22003 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
22004           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
22005 $as_echo "directory not found" >&6; }
22006           continue
22007         fi
22008         description="$bdb_place"
22009       ;;
22010     esac
22011
22012     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
22013     # trick to display a message instead.
22014     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
22015 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
22016     { $as_echo "$as_me:$LINENO: result: " >&5
22017 $as_echo "" >&6; }
22018
22019     for bdb_libname in $bdb_default_search_lib_names; do
22020       for bdb_header in $bdb_default_search_headers; do
22021         # Clear the header cache variable for each location
22022
22023         cache_id="`echo ac_cv_header_${bdb_header} \
22024                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
22025
22026         unset $cache_id
22027         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
22028 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
22029   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
22030 $as_echo_n "checking for $bdb_header... " >&6; }
22031 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
22032   $as_echo_n "(cached) " >&6
22033 fi
22034 ac_res=`eval 'as_val=${'$as_ac_Header'}
22035                  $as_echo "$as_val"'`
22036                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22037 $as_echo "$ac_res" >&6; }
22038 else
22039   # Is the header compilable?
22040 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
22041 $as_echo_n "checking $bdb_header usability... " >&6; }
22042 cat >conftest.$ac_ext <<_ACEOF
22043 /* confdefs.h.  */
22044 _ACEOF
22045 cat confdefs.h >>conftest.$ac_ext
22046 cat >>conftest.$ac_ext <<_ACEOF
22047 /* end confdefs.h.  */
22048 $ac_includes_default
22049 #include <$bdb_header>
22050 _ACEOF
22051 rm -f conftest.$ac_objext
22052 if { (ac_try="$ac_compile"
22053 case "(($ac_try" in
22054   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22055   *) ac_try_echo=$ac_try;;
22056 esac
22057 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22058 $as_echo "$ac_try_echo") >&5
22059   (eval "$ac_compile") 2>conftest.er1
22060   ac_status=$?
22061   grep -v '^ *+' conftest.er1 >conftest.err
22062   rm -f conftest.er1
22063   cat conftest.err >&5
22064   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22065   (exit $ac_status); } && {
22066          test -z "$ac_c_werror_flag" ||
22067          test ! -s conftest.err
22068        } && test -s conftest.$ac_objext; then
22069   ac_header_compiler=yes
22070 else
22071   $as_echo "$as_me: failed program was:" >&5
22072 sed 's/^/| /' conftest.$ac_ext >&5
22073
22074         ac_header_compiler=no
22075 fi
22076
22077 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22078 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
22079 $as_echo "$ac_header_compiler" >&6; }
22080
22081 # Is the header present?
22082 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
22083 $as_echo_n "checking $bdb_header presence... " >&6; }
22084 cat >conftest.$ac_ext <<_ACEOF
22085 /* confdefs.h.  */
22086 _ACEOF
22087 cat confdefs.h >>conftest.$ac_ext
22088 cat >>conftest.$ac_ext <<_ACEOF
22089 /* end confdefs.h.  */
22090 #include <$bdb_header>
22091 _ACEOF
22092 if { (ac_try="$ac_cpp conftest.$ac_ext"
22093 case "(($ac_try" in
22094   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22095   *) ac_try_echo=$ac_try;;
22096 esac
22097 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22098 $as_echo "$ac_try_echo") >&5
22099   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
22100   ac_status=$?
22101   grep -v '^ *+' conftest.er1 >conftest.err
22102   rm -f conftest.er1
22103   cat conftest.err >&5
22104   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22105   (exit $ac_status); } >/dev/null && {
22106          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
22107          test ! -s conftest.err
22108        }; then
22109   ac_header_preproc=yes
22110 else
22111   $as_echo "$as_me: failed program was:" >&5
22112 sed 's/^/| /' conftest.$ac_ext >&5
22113
22114   ac_header_preproc=no
22115 fi
22116
22117 rm -f conftest.err conftest.$ac_ext
22118 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
22119 $as_echo "$ac_header_preproc" >&6; }
22120
22121 # So?  What about this header?
22122 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
22123   yes:no: )
22124     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
22125 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
22126     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
22127 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
22128     ac_header_preproc=yes
22129     ;;
22130   no:yes:* )
22131     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
22132 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
22133     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
22134 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
22135     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
22136 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
22137     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
22138 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
22139     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
22140 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
22141     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
22142 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
22143
22144     ;;
22145 esac
22146 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
22147 $as_echo_n "checking for $bdb_header... " >&6; }
22148 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
22149   $as_echo_n "(cached) " >&6
22150 else
22151   eval "$as_ac_Header=\$ac_header_preproc"
22152 fi
22153 ac_res=`eval 'as_val=${'$as_ac_Header'}
22154                  $as_echo "$as_val"'`
22155                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22156 $as_echo "$ac_res" >&6; }
22157
22158 fi
22159 as_val=`eval 'as_val=${'$as_ac_Header'}
22160                  $as_echo "$as_val"'`
22161    if test "x$as_val" = x""yes; then
22162
22163           if test ""4"" = "3" -o ""4"" = "4"; then
22164             # We generate a separate cache variable for each prefix and libname
22165             # we search under.  That way, we avoid caching information that
22166             # changes if the user runs `configure' with a different set of
22167             # switches.
22168
22169             cache_id="`echo apu_cv_check_berkeley_db_"4"_"3"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
22170                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
22171
22172
22173             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
22174 $as_echo_n "checking for -l$bdb_libname... " >&6; }
22175                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
22176   $as_echo_n "(cached) " >&6
22177 else
22178
22179
22180     apu_try_berkeley_db_save_libs="$LIBS"
22181
22182     apu_check_berkeley_db_major="4"
22183     apu_check_berkeley_db_minor="3"
22184     apu_check_berkeley_db_patch="-1"
22185     apu_try_berkeley_db_header=$bdb_header
22186     apu_try_berkeley_db_libname=$bdb_libname
22187
22188     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
22189     if test "$cross_compiling" = yes; then
22190   apu_try_berkeley_db=yes
22191
22192 else
22193   cat >conftest.$ac_ext <<_ACEOF
22194 /* confdefs.h.  */
22195 _ACEOF
22196 cat confdefs.h >>conftest.$ac_ext
22197 cat >>conftest.$ac_ext <<_ACEOF
22198 /* end confdefs.h.  */
22199
22200 #include <stdlib.h>
22201 #include <stdio.h>
22202 #include <$apu_try_berkeley_db_header>
22203 main ()
22204 {
22205   int major, minor, patch;
22206
22207   db_version(&major, &minor, &patch);
22208
22209   /* Sanity check: ensure that db.h constants actually match the db library */
22210   if (major != DB_VERSION_MAJOR
22211       || minor != DB_VERSION_MINOR
22212       || patch != DB_VERSION_PATCH)
22213     exit (1);
22214
22215   /* Run-time check:  ensure the library claims to be the correct version. */
22216
22217   if ($apu_check_berkeley_db_major != -1) {
22218     if (major < $apu_check_berkeley_db_major)
22219       exit (1);
22220     if (major > $apu_check_berkeley_db_major)
22221       exit (0);
22222   }
22223
22224   if ($apu_check_berkeley_db_minor != -1) {
22225     if (minor < $apu_check_berkeley_db_minor)
22226       exit (1);
22227     if (minor > $apu_check_berkeley_db_minor)
22228       exit (0);
22229   }
22230
22231   if ($apu_check_berkeley_db_patch == -1
22232       || patch >= $apu_check_berkeley_db_patch)
22233     exit (0);
22234   else
22235     exit (1);
22236 }
22237
22238 _ACEOF
22239 rm -f conftest$ac_exeext
22240 if { (ac_try="$ac_link"
22241 case "(($ac_try" in
22242   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22243   *) ac_try_echo=$ac_try;;
22244 esac
22245 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22246 $as_echo "$ac_try_echo") >&5
22247   (eval "$ac_link") 2>&5
22248   ac_status=$?
22249   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22250   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
22251   { (case "(($ac_try" in
22252   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22253   *) ac_try_echo=$ac_try;;
22254 esac
22255 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22256 $as_echo "$ac_try_echo") >&5
22257   (eval "$ac_try") 2>&5
22258   ac_status=$?
22259   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22260   (exit $ac_status); }; }; then
22261   apu_try_berkeley_db=yes
22262 else
22263   $as_echo "$as_me: program exited with status $ac_status" >&5
22264 $as_echo "$as_me: failed program was:" >&5
22265 sed 's/^/| /' conftest.$ac_ext >&5
22266
22267 ( exit $ac_status )
22268 apu_try_berkeley_db=no
22269 fi
22270 rm -rf conftest.dSYM
22271 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
22272 fi
22273
22274
22275
22276     LIBS="$apu_try_berkeley_db_save_libs"
22277
22278
22279                 eval "$cache_id=$apu_try_berkeley_db"
22280
22281 fi
22282
22283             result="`eval echo '$'$cache_id`"
22284             { $as_echo "$as_me:$LINENO: result: $result" >&5
22285 $as_echo "$result" >&6; }
22286           elif test ""4"" = "1"; then
22287             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
22288 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
22289 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
22290 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
22291   $as_echo_n "(cached) " >&6
22292 else
22293   ac_check_lib_save_LIBS=$LIBS
22294 LIBS="-l$bdb_libname  $LIBS"
22295 cat >conftest.$ac_ext <<_ACEOF
22296 /* confdefs.h.  */
22297 _ACEOF
22298 cat confdefs.h >>conftest.$ac_ext
22299 cat >>conftest.$ac_ext <<_ACEOF
22300 /* end confdefs.h.  */
22301
22302 /* Override any GCC internal prototype to avoid an error.
22303    Use char because int might match the return type of a GCC
22304    builtin and then its argument prototype would still apply.  */
22305 #ifdef __cplusplus
22306 extern "C"
22307 #endif
22308 char dbopen ();
22309 int
22310 main ()
22311 {
22312 return dbopen ();
22313   ;
22314   return 0;
22315 }
22316 _ACEOF
22317 rm -f conftest.$ac_objext conftest$ac_exeext
22318 if { (ac_try="$ac_link"
22319 case "(($ac_try" in
22320   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22321   *) ac_try_echo=$ac_try;;
22322 esac
22323 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22324 $as_echo "$ac_try_echo") >&5
22325   (eval "$ac_link") 2>conftest.er1
22326   ac_status=$?
22327   grep -v '^ *+' conftest.er1 >conftest.err
22328   rm -f conftest.er1
22329   cat conftest.err >&5
22330   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22331   (exit $ac_status); } && {
22332          test -z "$ac_c_werror_flag" ||
22333          test ! -s conftest.err
22334        } && test -s conftest$ac_exeext && {
22335          test "$cross_compiling" = yes ||
22336          $as_test_x conftest$ac_exeext
22337        }; then
22338   eval "$as_ac_Lib=yes"
22339 else
22340   $as_echo "$as_me: failed program was:" >&5
22341 sed 's/^/| /' conftest.$ac_ext >&5
22342
22343         eval "$as_ac_Lib=no"
22344 fi
22345
22346 rm -rf conftest.dSYM
22347 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
22348       conftest$ac_exeext conftest.$ac_ext
22349 LIBS=$ac_check_lib_save_LIBS
22350 fi
22351 ac_res=`eval 'as_val=${'$as_ac_Lib'}
22352                  $as_echo "$as_val"'`
22353                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22354 $as_echo "$ac_res" >&6; }
22355 as_val=`eval 'as_val=${'$as_ac_Lib'}
22356                  $as_echo "$as_val"'`
22357    if test "x$as_val" = x""yes; then
22358   result=yes
22359 else
22360   result=no
22361
22362 fi
22363
22364           elif test ""4"" = "2"; then
22365             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
22366 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
22367 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
22368 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
22369   $as_echo_n "(cached) " >&6
22370 else
22371   ac_check_lib_save_LIBS=$LIBS
22372 LIBS="-l$bdb_libname  $LIBS"
22373 cat >conftest.$ac_ext <<_ACEOF
22374 /* confdefs.h.  */
22375 _ACEOF
22376 cat confdefs.h >>conftest.$ac_ext
22377 cat >>conftest.$ac_ext <<_ACEOF
22378 /* end confdefs.h.  */
22379
22380 /* Override any GCC internal prototype to avoid an error.
22381    Use char because int might match the return type of a GCC
22382    builtin and then its argument prototype would still apply.  */
22383 #ifdef __cplusplus
22384 extern "C"
22385 #endif
22386 char db_open ();
22387 int
22388 main ()
22389 {
22390 return db_open ();
22391   ;
22392   return 0;
22393 }
22394 _ACEOF
22395 rm -f conftest.$ac_objext conftest$ac_exeext
22396 if { (ac_try="$ac_link"
22397 case "(($ac_try" in
22398   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22399   *) ac_try_echo=$ac_try;;
22400 esac
22401 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22402 $as_echo "$ac_try_echo") >&5
22403   (eval "$ac_link") 2>conftest.er1
22404   ac_status=$?
22405   grep -v '^ *+' conftest.er1 >conftest.err
22406   rm -f conftest.er1
22407   cat conftest.err >&5
22408   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22409   (exit $ac_status); } && {
22410          test -z "$ac_c_werror_flag" ||
22411          test ! -s conftest.err
22412        } && test -s conftest$ac_exeext && {
22413          test "$cross_compiling" = yes ||
22414          $as_test_x conftest$ac_exeext
22415        }; then
22416   eval "$as_ac_Lib=yes"
22417 else
22418   $as_echo "$as_me: failed program was:" >&5
22419 sed 's/^/| /' conftest.$ac_ext >&5
22420
22421         eval "$as_ac_Lib=no"
22422 fi
22423
22424 rm -rf conftest.dSYM
22425 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
22426       conftest$ac_exeext conftest.$ac_ext
22427 LIBS=$ac_check_lib_save_LIBS
22428 fi
22429 ac_res=`eval 'as_val=${'$as_ac_Lib'}
22430                  $as_echo "$as_val"'`
22431                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22432 $as_echo "$ac_res" >&6; }
22433 as_val=`eval 'as_val=${'$as_ac_Lib'}
22434                  $as_echo "$as_val"'`
22435    if test "x$as_val" = x""yes; then
22436   result=yes
22437 else
22438   result=no
22439
22440 fi
22441
22442           fi
22443
22444 else
22445   result="no"
22446 fi
22447
22448
22449
22450         # If we found it, no need to search any more.
22451         if test "$result" = "yes"; then
22452           found="$bdb_place"
22453           break
22454         fi
22455       done
22456       test "$found" != "not" && break
22457     done
22458     test "$found" != "not" && break
22459   done
22460
22461   # Restore the original values of the flags we tweak.
22462   LDFLAGS="$apu_check_lib_save_ldflags"
22463   CPPFLAGS="$apu_check_lib_save_cppflags"
22464
22465   case "$found" in
22466   "not")
22467     apu_have_db=0
22468     ;;
22469   "std")
22470     apu_db_header=$bdb_header
22471     apu_db_lib=$bdb_libname
22472     apu_have_db=1
22473     ;;
22474   *":"*)
22475     header="`echo $found | sed -e 's/:.*$//'`"
22476     lib="`echo $found | sed -e 's/^.*://'`"
22477
22478
22479   if test "x$APRUTIL_INCLUDES" = "x"; then
22480     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
22481     APRUTIL_INCLUDES="-I$header"
22482   else
22483     apr_addto_bugger="-I$header"
22484     for i in $apr_addto_bugger; do
22485       apr_addto_duplicate="0"
22486       for j in $APRUTIL_INCLUDES; do
22487         if test "x$i" = "x$j"; then
22488           apr_addto_duplicate="1"
22489           break
22490         fi
22491       done
22492       if test $apr_addto_duplicate = "0"; then
22493         echo "  adding \"$i\" to APRUTIL_INCLUDES"
22494         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
22495       fi
22496     done
22497   fi
22498
22499
22500   if test "x$APRUTIL_LDFLAGS" = "x"; then
22501     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
22502     APRUTIL_LDFLAGS="-L$lib"
22503   else
22504     apr_addto_bugger="-L$lib"
22505     for i in $apr_addto_bugger; do
22506       apr_addto_duplicate="0"
22507       for j in $APRUTIL_LDFLAGS; do
22508         if test "x$i" = "x$j"; then
22509           apr_addto_duplicate="1"
22510           break
22511         fi
22512       done
22513       if test $apr_addto_duplicate = "0"; then
22514         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
22515         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
22516       fi
22517     done
22518   fi
22519
22520     apu_db_header=$bdb_header
22521     apu_db_lib=$bdb_libname
22522     apu_have_db=1
22523     ;;
22524   *)
22525
22526   if test "x$APRUTIL_INCLUDES" = "x"; then
22527     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
22528     APRUTIL_INCLUDES="-I$found/include"
22529   else
22530     apr_addto_bugger="-I$found/include"
22531     for i in $apr_addto_bugger; do
22532       apr_addto_duplicate="0"
22533       for j in $APRUTIL_INCLUDES; do
22534         if test "x$i" = "x$j"; then
22535           apr_addto_duplicate="1"
22536           break
22537         fi
22538       done
22539       if test $apr_addto_duplicate = "0"; then
22540         echo "  adding \"$i\" to APRUTIL_INCLUDES"
22541         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
22542       fi
22543     done
22544   fi
22545
22546
22547   if test "x$APRUTIL_LDFLAGS" = "x"; then
22548     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
22549     APRUTIL_LDFLAGS="-L$found/lib"
22550   else
22551     apr_addto_bugger="-L$found/lib"
22552     for i in $apr_addto_bugger; do
22553       apr_addto_duplicate="0"
22554       for j in $APRUTIL_LDFLAGS; do
22555         if test "x$i" = "x$j"; then
22556           apr_addto_duplicate="1"
22557           break
22558         fi
22559       done
22560       if test $apr_addto_duplicate = "0"; then
22561         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
22562         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
22563       fi
22564     done
22565   fi
22566
22567     apu_db_header=$bdb_header
22568     apu_db_lib=$bdb_libname
22569     apu_have_db=1
22570     ;;
22571   esac
22572
22573   if test "$apu_have_db" = "1"; then
22574     apu_db_version=4
22575   fi
22576
22577     if test "$apu_db_version" != "4"; then
22578       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
22579 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
22580    { (exit 1); exit 1; }; }
22581     fi
22582     ;;
22583   db44)
22584
22585   places="$check_places"
22586   if test -z "$places"; then
22587     places="std /usr/local/BerkeleyDB.4.4 /boot/home/config"
22588   fi
22589
22590   bdb_version="4"
22591   if test ""4"" != "-1"; then
22592     bdb_version="$bdb_version."4""
22593     if test ""-1"" != "-1"; then
22594       bdb_version="$bdb_version."-1""
22595     fi
22596   fi
22597   bdb_places="$places"
22598   bdb_default_search_headers="db44/db.h db4/db.h db.h"
22599   bdb_default_search_lib_names="db-4.4 db4-4.4 db44 db4 db"
22600
22601
22602   apu_have_db=0
22603
22604   # Save the original values of the flags we tweak.
22605   apu_check_lib_save_libs="$LIBS"
22606   apu_check_lib_save_ldflags="$LDFLAGS"
22607   apu_check_lib_save_cppflags="$CPPFLAGS"
22608
22609   # The variable `found' is the prefix under which we've found
22610   # Berkeley DB, or `not' if we haven't found it anywhere yet.
22611   found=not
22612   for bdb_place in $bdb_places; do
22613
22614     LDFLAGS="$apu_check_lib_save_ldflags"
22615     CPPFLAGS="$apu_check_lib_save_cppflags"
22616     case "$bdb_place" in
22617       "std" )
22618         description="the standard places"
22619       ;;
22620       *":"* )
22621         header="`echo $bdb_place | sed -e 's/:.*$//'`"
22622         lib="`echo $bdb_place | sed -e 's/^.*://'`"
22623         CPPFLAGS="$CPPFLAGS -I$header"
22624         LDFLAGS="$LDFLAGS -L$lib"
22625         description="$header and $lib"
22626       ;;
22627       * )
22628         if test -d $bdb_place; then
22629           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
22630           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
22631         else
22632           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
22633 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
22634           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
22635 $as_echo "directory not found" >&6; }
22636           continue
22637         fi
22638         description="$bdb_place"
22639       ;;
22640     esac
22641
22642     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
22643     # trick to display a message instead.
22644     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
22645 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
22646     { $as_echo "$as_me:$LINENO: result: " >&5
22647 $as_echo "" >&6; }
22648
22649     for bdb_libname in $bdb_default_search_lib_names; do
22650       for bdb_header in $bdb_default_search_headers; do
22651         # Clear the header cache variable for each location
22652
22653         cache_id="`echo ac_cv_header_${bdb_header} \
22654                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
22655
22656         unset $cache_id
22657         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
22658 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
22659   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
22660 $as_echo_n "checking for $bdb_header... " >&6; }
22661 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
22662   $as_echo_n "(cached) " >&6
22663 fi
22664 ac_res=`eval 'as_val=${'$as_ac_Header'}
22665                  $as_echo "$as_val"'`
22666                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22667 $as_echo "$ac_res" >&6; }
22668 else
22669   # Is the header compilable?
22670 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
22671 $as_echo_n "checking $bdb_header usability... " >&6; }
22672 cat >conftest.$ac_ext <<_ACEOF
22673 /* confdefs.h.  */
22674 _ACEOF
22675 cat confdefs.h >>conftest.$ac_ext
22676 cat >>conftest.$ac_ext <<_ACEOF
22677 /* end confdefs.h.  */
22678 $ac_includes_default
22679 #include <$bdb_header>
22680 _ACEOF
22681 rm -f conftest.$ac_objext
22682 if { (ac_try="$ac_compile"
22683 case "(($ac_try" in
22684   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22685   *) ac_try_echo=$ac_try;;
22686 esac
22687 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22688 $as_echo "$ac_try_echo") >&5
22689   (eval "$ac_compile") 2>conftest.er1
22690   ac_status=$?
22691   grep -v '^ *+' conftest.er1 >conftest.err
22692   rm -f conftest.er1
22693   cat conftest.err >&5
22694   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22695   (exit $ac_status); } && {
22696          test -z "$ac_c_werror_flag" ||
22697          test ! -s conftest.err
22698        } && test -s conftest.$ac_objext; then
22699   ac_header_compiler=yes
22700 else
22701   $as_echo "$as_me: failed program was:" >&5
22702 sed 's/^/| /' conftest.$ac_ext >&5
22703
22704         ac_header_compiler=no
22705 fi
22706
22707 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22708 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
22709 $as_echo "$ac_header_compiler" >&6; }
22710
22711 # Is the header present?
22712 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
22713 $as_echo_n "checking $bdb_header presence... " >&6; }
22714 cat >conftest.$ac_ext <<_ACEOF
22715 /* confdefs.h.  */
22716 _ACEOF
22717 cat confdefs.h >>conftest.$ac_ext
22718 cat >>conftest.$ac_ext <<_ACEOF
22719 /* end confdefs.h.  */
22720 #include <$bdb_header>
22721 _ACEOF
22722 if { (ac_try="$ac_cpp conftest.$ac_ext"
22723 case "(($ac_try" in
22724   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22725   *) ac_try_echo=$ac_try;;
22726 esac
22727 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22728 $as_echo "$ac_try_echo") >&5
22729   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
22730   ac_status=$?
22731   grep -v '^ *+' conftest.er1 >conftest.err
22732   rm -f conftest.er1
22733   cat conftest.err >&5
22734   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22735   (exit $ac_status); } >/dev/null && {
22736          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
22737          test ! -s conftest.err
22738        }; then
22739   ac_header_preproc=yes
22740 else
22741   $as_echo "$as_me: failed program was:" >&5
22742 sed 's/^/| /' conftest.$ac_ext >&5
22743
22744   ac_header_preproc=no
22745 fi
22746
22747 rm -f conftest.err conftest.$ac_ext
22748 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
22749 $as_echo "$ac_header_preproc" >&6; }
22750
22751 # So?  What about this header?
22752 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
22753   yes:no: )
22754     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
22755 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
22756     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
22757 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
22758     ac_header_preproc=yes
22759     ;;
22760   no:yes:* )
22761     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
22762 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
22763     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
22764 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
22765     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
22766 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
22767     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
22768 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
22769     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
22770 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
22771     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
22772 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
22773
22774     ;;
22775 esac
22776 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
22777 $as_echo_n "checking for $bdb_header... " >&6; }
22778 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
22779   $as_echo_n "(cached) " >&6
22780 else
22781   eval "$as_ac_Header=\$ac_header_preproc"
22782 fi
22783 ac_res=`eval 'as_val=${'$as_ac_Header'}
22784                  $as_echo "$as_val"'`
22785                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22786 $as_echo "$ac_res" >&6; }
22787
22788 fi
22789 as_val=`eval 'as_val=${'$as_ac_Header'}
22790                  $as_echo "$as_val"'`
22791    if test "x$as_val" = x""yes; then
22792
22793           if test ""4"" = "3" -o ""4"" = "4"; then
22794             # We generate a separate cache variable for each prefix and libname
22795             # we search under.  That way, we avoid caching information that
22796             # changes if the user runs `configure' with a different set of
22797             # switches.
22798
22799             cache_id="`echo apu_cv_check_berkeley_db_"4"_"4"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
22800                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
22801
22802
22803             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
22804 $as_echo_n "checking for -l$bdb_libname... " >&6; }
22805                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
22806   $as_echo_n "(cached) " >&6
22807 else
22808
22809
22810     apu_try_berkeley_db_save_libs="$LIBS"
22811
22812     apu_check_berkeley_db_major="4"
22813     apu_check_berkeley_db_minor="4"
22814     apu_check_berkeley_db_patch="-1"
22815     apu_try_berkeley_db_header=$bdb_header
22816     apu_try_berkeley_db_libname=$bdb_libname
22817
22818     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
22819     if test "$cross_compiling" = yes; then
22820   apu_try_berkeley_db=yes
22821
22822 else
22823   cat >conftest.$ac_ext <<_ACEOF
22824 /* confdefs.h.  */
22825 _ACEOF
22826 cat confdefs.h >>conftest.$ac_ext
22827 cat >>conftest.$ac_ext <<_ACEOF
22828 /* end confdefs.h.  */
22829
22830 #include <stdlib.h>
22831 #include <stdio.h>
22832 #include <$apu_try_berkeley_db_header>
22833 main ()
22834 {
22835   int major, minor, patch;
22836
22837   db_version(&major, &minor, &patch);
22838
22839   /* Sanity check: ensure that db.h constants actually match the db library */
22840   if (major != DB_VERSION_MAJOR
22841       || minor != DB_VERSION_MINOR
22842       || patch != DB_VERSION_PATCH)
22843     exit (1);
22844
22845   /* Run-time check:  ensure the library claims to be the correct version. */
22846
22847   if ($apu_check_berkeley_db_major != -1) {
22848     if (major < $apu_check_berkeley_db_major)
22849       exit (1);
22850     if (major > $apu_check_berkeley_db_major)
22851       exit (0);
22852   }
22853
22854   if ($apu_check_berkeley_db_minor != -1) {
22855     if (minor < $apu_check_berkeley_db_minor)
22856       exit (1);
22857     if (minor > $apu_check_berkeley_db_minor)
22858       exit (0);
22859   }
22860
22861   if ($apu_check_berkeley_db_patch == -1
22862       || patch >= $apu_check_berkeley_db_patch)
22863     exit (0);
22864   else
22865     exit (1);
22866 }
22867
22868 _ACEOF
22869 rm -f conftest$ac_exeext
22870 if { (ac_try="$ac_link"
22871 case "(($ac_try" in
22872   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22873   *) ac_try_echo=$ac_try;;
22874 esac
22875 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22876 $as_echo "$ac_try_echo") >&5
22877   (eval "$ac_link") 2>&5
22878   ac_status=$?
22879   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22880   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
22881   { (case "(($ac_try" in
22882   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22883   *) ac_try_echo=$ac_try;;
22884 esac
22885 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22886 $as_echo "$ac_try_echo") >&5
22887   (eval "$ac_try") 2>&5
22888   ac_status=$?
22889   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22890   (exit $ac_status); }; }; then
22891   apu_try_berkeley_db=yes
22892 else
22893   $as_echo "$as_me: program exited with status $ac_status" >&5
22894 $as_echo "$as_me: failed program was:" >&5
22895 sed 's/^/| /' conftest.$ac_ext >&5
22896
22897 ( exit $ac_status )
22898 apu_try_berkeley_db=no
22899 fi
22900 rm -rf conftest.dSYM
22901 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
22902 fi
22903
22904
22905
22906     LIBS="$apu_try_berkeley_db_save_libs"
22907
22908
22909                 eval "$cache_id=$apu_try_berkeley_db"
22910
22911 fi
22912
22913             result="`eval echo '$'$cache_id`"
22914             { $as_echo "$as_me:$LINENO: result: $result" >&5
22915 $as_echo "$result" >&6; }
22916           elif test ""4"" = "1"; then
22917             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
22918 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
22919 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
22920 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
22921   $as_echo_n "(cached) " >&6
22922 else
22923   ac_check_lib_save_LIBS=$LIBS
22924 LIBS="-l$bdb_libname  $LIBS"
22925 cat >conftest.$ac_ext <<_ACEOF
22926 /* confdefs.h.  */
22927 _ACEOF
22928 cat confdefs.h >>conftest.$ac_ext
22929 cat >>conftest.$ac_ext <<_ACEOF
22930 /* end confdefs.h.  */
22931
22932 /* Override any GCC internal prototype to avoid an error.
22933    Use char because int might match the return type of a GCC
22934    builtin and then its argument prototype would still apply.  */
22935 #ifdef __cplusplus
22936 extern "C"
22937 #endif
22938 char dbopen ();
22939 int
22940 main ()
22941 {
22942 return dbopen ();
22943   ;
22944   return 0;
22945 }
22946 _ACEOF
22947 rm -f conftest.$ac_objext conftest$ac_exeext
22948 if { (ac_try="$ac_link"
22949 case "(($ac_try" in
22950   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22951   *) ac_try_echo=$ac_try;;
22952 esac
22953 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22954 $as_echo "$ac_try_echo") >&5
22955   (eval "$ac_link") 2>conftest.er1
22956   ac_status=$?
22957   grep -v '^ *+' conftest.er1 >conftest.err
22958   rm -f conftest.er1
22959   cat conftest.err >&5
22960   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22961   (exit $ac_status); } && {
22962          test -z "$ac_c_werror_flag" ||
22963          test ! -s conftest.err
22964        } && test -s conftest$ac_exeext && {
22965          test "$cross_compiling" = yes ||
22966          $as_test_x conftest$ac_exeext
22967        }; then
22968   eval "$as_ac_Lib=yes"
22969 else
22970   $as_echo "$as_me: failed program was:" >&5
22971 sed 's/^/| /' conftest.$ac_ext >&5
22972
22973         eval "$as_ac_Lib=no"
22974 fi
22975
22976 rm -rf conftest.dSYM
22977 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
22978       conftest$ac_exeext conftest.$ac_ext
22979 LIBS=$ac_check_lib_save_LIBS
22980 fi
22981 ac_res=`eval 'as_val=${'$as_ac_Lib'}
22982                  $as_echo "$as_val"'`
22983                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22984 $as_echo "$ac_res" >&6; }
22985 as_val=`eval 'as_val=${'$as_ac_Lib'}
22986                  $as_echo "$as_val"'`
22987    if test "x$as_val" = x""yes; then
22988   result=yes
22989 else
22990   result=no
22991
22992 fi
22993
22994           elif test ""4"" = "2"; then
22995             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
22996 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
22997 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
22998 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
22999   $as_echo_n "(cached) " >&6
23000 else
23001   ac_check_lib_save_LIBS=$LIBS
23002 LIBS="-l$bdb_libname  $LIBS"
23003 cat >conftest.$ac_ext <<_ACEOF
23004 /* confdefs.h.  */
23005 _ACEOF
23006 cat confdefs.h >>conftest.$ac_ext
23007 cat >>conftest.$ac_ext <<_ACEOF
23008 /* end confdefs.h.  */
23009
23010 /* Override any GCC internal prototype to avoid an error.
23011    Use char because int might match the return type of a GCC
23012    builtin and then its argument prototype would still apply.  */
23013 #ifdef __cplusplus
23014 extern "C"
23015 #endif
23016 char db_open ();
23017 int
23018 main ()
23019 {
23020 return db_open ();
23021   ;
23022   return 0;
23023 }
23024 _ACEOF
23025 rm -f conftest.$ac_objext conftest$ac_exeext
23026 if { (ac_try="$ac_link"
23027 case "(($ac_try" in
23028   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23029   *) ac_try_echo=$ac_try;;
23030 esac
23031 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23032 $as_echo "$ac_try_echo") >&5
23033   (eval "$ac_link") 2>conftest.er1
23034   ac_status=$?
23035   grep -v '^ *+' conftest.er1 >conftest.err
23036   rm -f conftest.er1
23037   cat conftest.err >&5
23038   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23039   (exit $ac_status); } && {
23040          test -z "$ac_c_werror_flag" ||
23041          test ! -s conftest.err
23042        } && test -s conftest$ac_exeext && {
23043          test "$cross_compiling" = yes ||
23044          $as_test_x conftest$ac_exeext
23045        }; then
23046   eval "$as_ac_Lib=yes"
23047 else
23048   $as_echo "$as_me: failed program was:" >&5
23049 sed 's/^/| /' conftest.$ac_ext >&5
23050
23051         eval "$as_ac_Lib=no"
23052 fi
23053
23054 rm -rf conftest.dSYM
23055 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
23056       conftest$ac_exeext conftest.$ac_ext
23057 LIBS=$ac_check_lib_save_LIBS
23058 fi
23059 ac_res=`eval 'as_val=${'$as_ac_Lib'}
23060                  $as_echo "$as_val"'`
23061                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
23062 $as_echo "$ac_res" >&6; }
23063 as_val=`eval 'as_val=${'$as_ac_Lib'}
23064                  $as_echo "$as_val"'`
23065    if test "x$as_val" = x""yes; then
23066   result=yes
23067 else
23068   result=no
23069
23070 fi
23071
23072           fi
23073
23074 else
23075   result="no"
23076 fi
23077
23078
23079
23080         # If we found it, no need to search any more.
23081         if test "$result" = "yes"; then
23082           found="$bdb_place"
23083           break
23084         fi
23085       done
23086       test "$found" != "not" && break
23087     done
23088     test "$found" != "not" && break
23089   done
23090
23091   # Restore the original values of the flags we tweak.
23092   LDFLAGS="$apu_check_lib_save_ldflags"
23093   CPPFLAGS="$apu_check_lib_save_cppflags"
23094
23095   case "$found" in
23096   "not")
23097     apu_have_db=0
23098     ;;
23099   "std")
23100     apu_db_header=$bdb_header
23101     apu_db_lib=$bdb_libname
23102     apu_have_db=1
23103     ;;
23104   *":"*)
23105     header="`echo $found | sed -e 's/:.*$//'`"
23106     lib="`echo $found | sed -e 's/^.*://'`"
23107
23108
23109   if test "x$APRUTIL_INCLUDES" = "x"; then
23110     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
23111     APRUTIL_INCLUDES="-I$header"
23112   else
23113     apr_addto_bugger="-I$header"
23114     for i in $apr_addto_bugger; do
23115       apr_addto_duplicate="0"
23116       for j in $APRUTIL_INCLUDES; do
23117         if test "x$i" = "x$j"; then
23118           apr_addto_duplicate="1"
23119           break
23120         fi
23121       done
23122       if test $apr_addto_duplicate = "0"; then
23123         echo "  adding \"$i\" to APRUTIL_INCLUDES"
23124         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
23125       fi
23126     done
23127   fi
23128
23129
23130   if test "x$APRUTIL_LDFLAGS" = "x"; then
23131     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
23132     APRUTIL_LDFLAGS="-L$lib"
23133   else
23134     apr_addto_bugger="-L$lib"
23135     for i in $apr_addto_bugger; do
23136       apr_addto_duplicate="0"
23137       for j in $APRUTIL_LDFLAGS; do
23138         if test "x$i" = "x$j"; then
23139           apr_addto_duplicate="1"
23140           break
23141         fi
23142       done
23143       if test $apr_addto_duplicate = "0"; then
23144         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
23145         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
23146       fi
23147     done
23148   fi
23149
23150     apu_db_header=$bdb_header
23151     apu_db_lib=$bdb_libname
23152     apu_have_db=1
23153     ;;
23154   *)
23155
23156   if test "x$APRUTIL_INCLUDES" = "x"; then
23157     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
23158     APRUTIL_INCLUDES="-I$found/include"
23159   else
23160     apr_addto_bugger="-I$found/include"
23161     for i in $apr_addto_bugger; do
23162       apr_addto_duplicate="0"
23163       for j in $APRUTIL_INCLUDES; do
23164         if test "x$i" = "x$j"; then
23165           apr_addto_duplicate="1"
23166           break
23167         fi
23168       done
23169       if test $apr_addto_duplicate = "0"; then
23170         echo "  adding \"$i\" to APRUTIL_INCLUDES"
23171         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
23172       fi
23173     done
23174   fi
23175
23176
23177   if test "x$APRUTIL_LDFLAGS" = "x"; then
23178     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
23179     APRUTIL_LDFLAGS="-L$found/lib"
23180   else
23181     apr_addto_bugger="-L$found/lib"
23182     for i in $apr_addto_bugger; do
23183       apr_addto_duplicate="0"
23184       for j in $APRUTIL_LDFLAGS; do
23185         if test "x$i" = "x$j"; then
23186           apr_addto_duplicate="1"
23187           break
23188         fi
23189       done
23190       if test $apr_addto_duplicate = "0"; then
23191         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
23192         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
23193       fi
23194     done
23195   fi
23196
23197     apu_db_header=$bdb_header
23198     apu_db_lib=$bdb_libname
23199     apu_have_db=1
23200     ;;
23201   esac
23202
23203   if test "$apu_have_db" = "1"; then
23204     apu_db_version=4
23205   fi
23206
23207     if test "$apu_db_version" != "4"; then
23208       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
23209 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
23210    { (exit 1); exit 1; }; }
23211     fi
23212     ;;
23213   db45)
23214
23215   places="$check_places"
23216   if test -z "$places"; then
23217     places="std /usr/local/BerkeleyDB.4.5 /boot/home/config"
23218   fi
23219
23220   bdb_version="4"
23221   if test ""5"" != "-1"; then
23222     bdb_version="$bdb_version."5""
23223     if test ""-1"" != "-1"; then
23224       bdb_version="$bdb_version."-1""
23225     fi
23226   fi
23227   bdb_places="$places"
23228   bdb_default_search_headers="db45/db.h db4/db.h db.h"
23229   bdb_default_search_lib_names="db-4.5 db4-4.5 db45 db4 db"
23230
23231
23232   apu_have_db=0
23233
23234   # Save the original values of the flags we tweak.
23235   apu_check_lib_save_libs="$LIBS"
23236   apu_check_lib_save_ldflags="$LDFLAGS"
23237   apu_check_lib_save_cppflags="$CPPFLAGS"
23238
23239   # The variable `found' is the prefix under which we've found
23240   # Berkeley DB, or `not' if we haven't found it anywhere yet.
23241   found=not
23242   for bdb_place in $bdb_places; do
23243
23244     LDFLAGS="$apu_check_lib_save_ldflags"
23245     CPPFLAGS="$apu_check_lib_save_cppflags"
23246     case "$bdb_place" in
23247       "std" )
23248         description="the standard places"
23249       ;;
23250       *":"* )
23251         header="`echo $bdb_place | sed -e 's/:.*$//'`"
23252         lib="`echo $bdb_place | sed -e 's/^.*://'`"
23253         CPPFLAGS="$CPPFLAGS -I$header"
23254         LDFLAGS="$LDFLAGS -L$lib"
23255         description="$header and $lib"
23256       ;;
23257       * )
23258         if test -d $bdb_place; then
23259           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
23260           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
23261         else
23262           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
23263 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
23264           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
23265 $as_echo "directory not found" >&6; }
23266           continue
23267         fi
23268         description="$bdb_place"
23269       ;;
23270     esac
23271
23272     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
23273     # trick to display a message instead.
23274     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
23275 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
23276     { $as_echo "$as_me:$LINENO: result: " >&5
23277 $as_echo "" >&6; }
23278
23279     for bdb_libname in $bdb_default_search_lib_names; do
23280       for bdb_header in $bdb_default_search_headers; do
23281         # Clear the header cache variable for each location
23282
23283         cache_id="`echo ac_cv_header_${bdb_header} \
23284                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
23285
23286         unset $cache_id
23287         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
23288 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
23289   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
23290 $as_echo_n "checking for $bdb_header... " >&6; }
23291 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
23292   $as_echo_n "(cached) " >&6
23293 fi
23294 ac_res=`eval 'as_val=${'$as_ac_Header'}
23295                  $as_echo "$as_val"'`
23296                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
23297 $as_echo "$ac_res" >&6; }
23298 else
23299   # Is the header compilable?
23300 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
23301 $as_echo_n "checking $bdb_header usability... " >&6; }
23302 cat >conftest.$ac_ext <<_ACEOF
23303 /* confdefs.h.  */
23304 _ACEOF
23305 cat confdefs.h >>conftest.$ac_ext
23306 cat >>conftest.$ac_ext <<_ACEOF
23307 /* end confdefs.h.  */
23308 $ac_includes_default
23309 #include <$bdb_header>
23310 _ACEOF
23311 rm -f conftest.$ac_objext
23312 if { (ac_try="$ac_compile"
23313 case "(($ac_try" in
23314   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23315   *) ac_try_echo=$ac_try;;
23316 esac
23317 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23318 $as_echo "$ac_try_echo") >&5
23319   (eval "$ac_compile") 2>conftest.er1
23320   ac_status=$?
23321   grep -v '^ *+' conftest.er1 >conftest.err
23322   rm -f conftest.er1
23323   cat conftest.err >&5
23324   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23325   (exit $ac_status); } && {
23326          test -z "$ac_c_werror_flag" ||
23327          test ! -s conftest.err
23328        } && test -s conftest.$ac_objext; then
23329   ac_header_compiler=yes
23330 else
23331   $as_echo "$as_me: failed program was:" >&5
23332 sed 's/^/| /' conftest.$ac_ext >&5
23333
23334         ac_header_compiler=no
23335 fi
23336
23337 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23338 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
23339 $as_echo "$ac_header_compiler" >&6; }
23340
23341 # Is the header present?
23342 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
23343 $as_echo_n "checking $bdb_header presence... " >&6; }
23344 cat >conftest.$ac_ext <<_ACEOF
23345 /* confdefs.h.  */
23346 _ACEOF
23347 cat confdefs.h >>conftest.$ac_ext
23348 cat >>conftest.$ac_ext <<_ACEOF
23349 /* end confdefs.h.  */
23350 #include <$bdb_header>
23351 _ACEOF
23352 if { (ac_try="$ac_cpp conftest.$ac_ext"
23353 case "(($ac_try" in
23354   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23355   *) ac_try_echo=$ac_try;;
23356 esac
23357 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23358 $as_echo "$ac_try_echo") >&5
23359   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
23360   ac_status=$?
23361   grep -v '^ *+' conftest.er1 >conftest.err
23362   rm -f conftest.er1
23363   cat conftest.err >&5
23364   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23365   (exit $ac_status); } >/dev/null && {
23366          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
23367          test ! -s conftest.err
23368        }; then
23369   ac_header_preproc=yes
23370 else
23371   $as_echo "$as_me: failed program was:" >&5
23372 sed 's/^/| /' conftest.$ac_ext >&5
23373
23374   ac_header_preproc=no
23375 fi
23376
23377 rm -f conftest.err conftest.$ac_ext
23378 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
23379 $as_echo "$ac_header_preproc" >&6; }
23380
23381 # So?  What about this header?
23382 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
23383   yes:no: )
23384     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
23385 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
23386     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
23387 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
23388     ac_header_preproc=yes
23389     ;;
23390   no:yes:* )
23391     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
23392 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
23393     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
23394 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
23395     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
23396 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
23397     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
23398 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
23399     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
23400 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
23401     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
23402 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
23403
23404     ;;
23405 esac
23406 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
23407 $as_echo_n "checking for $bdb_header... " >&6; }
23408 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
23409   $as_echo_n "(cached) " >&6
23410 else
23411   eval "$as_ac_Header=\$ac_header_preproc"
23412 fi
23413 ac_res=`eval 'as_val=${'$as_ac_Header'}
23414                  $as_echo "$as_val"'`
23415                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
23416 $as_echo "$ac_res" >&6; }
23417
23418 fi
23419 as_val=`eval 'as_val=${'$as_ac_Header'}
23420                  $as_echo "$as_val"'`
23421    if test "x$as_val" = x""yes; then
23422
23423           if test ""4"" = "3" -o ""4"" = "4"; then
23424             # We generate a separate cache variable for each prefix and libname
23425             # we search under.  That way, we avoid caching information that
23426             # changes if the user runs `configure' with a different set of
23427             # switches.
23428
23429             cache_id="`echo apu_cv_check_berkeley_db_"4"_"5"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
23430                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
23431
23432
23433             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
23434 $as_echo_n "checking for -l$bdb_libname... " >&6; }
23435                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
23436   $as_echo_n "(cached) " >&6
23437 else
23438
23439
23440     apu_try_berkeley_db_save_libs="$LIBS"
23441
23442     apu_check_berkeley_db_major="4"
23443     apu_check_berkeley_db_minor="5"
23444     apu_check_berkeley_db_patch="-1"
23445     apu_try_berkeley_db_header=$bdb_header
23446     apu_try_berkeley_db_libname=$bdb_libname
23447
23448     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
23449     if test "$cross_compiling" = yes; then
23450   apu_try_berkeley_db=yes
23451
23452 else
23453   cat >conftest.$ac_ext <<_ACEOF
23454 /* confdefs.h.  */
23455 _ACEOF
23456 cat confdefs.h >>conftest.$ac_ext
23457 cat >>conftest.$ac_ext <<_ACEOF
23458 /* end confdefs.h.  */
23459
23460 #include <stdlib.h>
23461 #include <stdio.h>
23462 #include <$apu_try_berkeley_db_header>
23463 main ()
23464 {
23465   int major, minor, patch;
23466
23467   db_version(&major, &minor, &patch);
23468
23469   /* Sanity check: ensure that db.h constants actually match the db library */
23470   if (major != DB_VERSION_MAJOR
23471       || minor != DB_VERSION_MINOR
23472       || patch != DB_VERSION_PATCH)
23473     exit (1);
23474
23475   /* Run-time check:  ensure the library claims to be the correct version. */
23476
23477   if ($apu_check_berkeley_db_major != -1) {
23478     if (major < $apu_check_berkeley_db_major)
23479       exit (1);
23480     if (major > $apu_check_berkeley_db_major)
23481       exit (0);
23482   }
23483
23484   if ($apu_check_berkeley_db_minor != -1) {
23485     if (minor < $apu_check_berkeley_db_minor)
23486       exit (1);
23487     if (minor > $apu_check_berkeley_db_minor)
23488       exit (0);
23489   }
23490
23491   if ($apu_check_berkeley_db_patch == -1
23492       || patch >= $apu_check_berkeley_db_patch)
23493     exit (0);
23494   else
23495     exit (1);
23496 }
23497
23498 _ACEOF
23499 rm -f conftest$ac_exeext
23500 if { (ac_try="$ac_link"
23501 case "(($ac_try" in
23502   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23503   *) ac_try_echo=$ac_try;;
23504 esac
23505 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23506 $as_echo "$ac_try_echo") >&5
23507   (eval "$ac_link") 2>&5
23508   ac_status=$?
23509   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23510   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
23511   { (case "(($ac_try" in
23512   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23513   *) ac_try_echo=$ac_try;;
23514 esac
23515 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23516 $as_echo "$ac_try_echo") >&5
23517   (eval "$ac_try") 2>&5
23518   ac_status=$?
23519   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23520   (exit $ac_status); }; }; then
23521   apu_try_berkeley_db=yes
23522 else
23523   $as_echo "$as_me: program exited with status $ac_status" >&5
23524 $as_echo "$as_me: failed program was:" >&5
23525 sed 's/^/| /' conftest.$ac_ext >&5
23526
23527 ( exit $ac_status )
23528 apu_try_berkeley_db=no
23529 fi
23530 rm -rf conftest.dSYM
23531 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
23532 fi
23533
23534
23535
23536     LIBS="$apu_try_berkeley_db_save_libs"
23537
23538
23539                 eval "$cache_id=$apu_try_berkeley_db"
23540
23541 fi
23542
23543             result="`eval echo '$'$cache_id`"
23544             { $as_echo "$as_me:$LINENO: result: $result" >&5
23545 $as_echo "$result" >&6; }
23546           elif test ""4"" = "1"; then
23547             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
23548 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
23549 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
23550 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
23551   $as_echo_n "(cached) " >&6
23552 else
23553   ac_check_lib_save_LIBS=$LIBS
23554 LIBS="-l$bdb_libname  $LIBS"
23555 cat >conftest.$ac_ext <<_ACEOF
23556 /* confdefs.h.  */
23557 _ACEOF
23558 cat confdefs.h >>conftest.$ac_ext
23559 cat >>conftest.$ac_ext <<_ACEOF
23560 /* end confdefs.h.  */
23561
23562 /* Override any GCC internal prototype to avoid an error.
23563    Use char because int might match the return type of a GCC
23564    builtin and then its argument prototype would still apply.  */
23565 #ifdef __cplusplus
23566 extern "C"
23567 #endif
23568 char dbopen ();
23569 int
23570 main ()
23571 {
23572 return dbopen ();
23573   ;
23574   return 0;
23575 }
23576 _ACEOF
23577 rm -f conftest.$ac_objext conftest$ac_exeext
23578 if { (ac_try="$ac_link"
23579 case "(($ac_try" in
23580   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23581   *) ac_try_echo=$ac_try;;
23582 esac
23583 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23584 $as_echo "$ac_try_echo") >&5
23585   (eval "$ac_link") 2>conftest.er1
23586   ac_status=$?
23587   grep -v '^ *+' conftest.er1 >conftest.err
23588   rm -f conftest.er1
23589   cat conftest.err >&5
23590   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23591   (exit $ac_status); } && {
23592          test -z "$ac_c_werror_flag" ||
23593          test ! -s conftest.err
23594        } && test -s conftest$ac_exeext && {
23595          test "$cross_compiling" = yes ||
23596          $as_test_x conftest$ac_exeext
23597        }; then
23598   eval "$as_ac_Lib=yes"
23599 else
23600   $as_echo "$as_me: failed program was:" >&5
23601 sed 's/^/| /' conftest.$ac_ext >&5
23602
23603         eval "$as_ac_Lib=no"
23604 fi
23605
23606 rm -rf conftest.dSYM
23607 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
23608       conftest$ac_exeext conftest.$ac_ext
23609 LIBS=$ac_check_lib_save_LIBS
23610 fi
23611 ac_res=`eval 'as_val=${'$as_ac_Lib'}
23612                  $as_echo "$as_val"'`
23613                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
23614 $as_echo "$ac_res" >&6; }
23615 as_val=`eval 'as_val=${'$as_ac_Lib'}
23616                  $as_echo "$as_val"'`
23617    if test "x$as_val" = x""yes; then
23618   result=yes
23619 else
23620   result=no
23621
23622 fi
23623
23624           elif test ""4"" = "2"; then
23625             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
23626 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
23627 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
23628 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
23629   $as_echo_n "(cached) " >&6
23630 else
23631   ac_check_lib_save_LIBS=$LIBS
23632 LIBS="-l$bdb_libname  $LIBS"
23633 cat >conftest.$ac_ext <<_ACEOF
23634 /* confdefs.h.  */
23635 _ACEOF
23636 cat confdefs.h >>conftest.$ac_ext
23637 cat >>conftest.$ac_ext <<_ACEOF
23638 /* end confdefs.h.  */
23639
23640 /* Override any GCC internal prototype to avoid an error.
23641    Use char because int might match the return type of a GCC
23642    builtin and then its argument prototype would still apply.  */
23643 #ifdef __cplusplus
23644 extern "C"
23645 #endif
23646 char db_open ();
23647 int
23648 main ()
23649 {
23650 return db_open ();
23651   ;
23652   return 0;
23653 }
23654 _ACEOF
23655 rm -f conftest.$ac_objext conftest$ac_exeext
23656 if { (ac_try="$ac_link"
23657 case "(($ac_try" in
23658   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23659   *) ac_try_echo=$ac_try;;
23660 esac
23661 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23662 $as_echo "$ac_try_echo") >&5
23663   (eval "$ac_link") 2>conftest.er1
23664   ac_status=$?
23665   grep -v '^ *+' conftest.er1 >conftest.err
23666   rm -f conftest.er1
23667   cat conftest.err >&5
23668   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23669   (exit $ac_status); } && {
23670          test -z "$ac_c_werror_flag" ||
23671          test ! -s conftest.err
23672        } && test -s conftest$ac_exeext && {
23673          test "$cross_compiling" = yes ||
23674          $as_test_x conftest$ac_exeext
23675        }; then
23676   eval "$as_ac_Lib=yes"
23677 else
23678   $as_echo "$as_me: failed program was:" >&5
23679 sed 's/^/| /' conftest.$ac_ext >&5
23680
23681         eval "$as_ac_Lib=no"
23682 fi
23683
23684 rm -rf conftest.dSYM
23685 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
23686       conftest$ac_exeext conftest.$ac_ext
23687 LIBS=$ac_check_lib_save_LIBS
23688 fi
23689 ac_res=`eval 'as_val=${'$as_ac_Lib'}
23690                  $as_echo "$as_val"'`
23691                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
23692 $as_echo "$ac_res" >&6; }
23693 as_val=`eval 'as_val=${'$as_ac_Lib'}
23694                  $as_echo "$as_val"'`
23695    if test "x$as_val" = x""yes; then
23696   result=yes
23697 else
23698   result=no
23699
23700 fi
23701
23702           fi
23703
23704 else
23705   result="no"
23706 fi
23707
23708
23709
23710         # If we found it, no need to search any more.
23711         if test "$result" = "yes"; then
23712           found="$bdb_place"
23713           break
23714         fi
23715       done
23716       test "$found" != "not" && break
23717     done
23718     test "$found" != "not" && break
23719   done
23720
23721   # Restore the original values of the flags we tweak.
23722   LDFLAGS="$apu_check_lib_save_ldflags"
23723   CPPFLAGS="$apu_check_lib_save_cppflags"
23724
23725   case "$found" in
23726   "not")
23727     apu_have_db=0
23728     ;;
23729   "std")
23730     apu_db_header=$bdb_header
23731     apu_db_lib=$bdb_libname
23732     apu_have_db=1
23733     ;;
23734   *":"*)
23735     header="`echo $found | sed -e 's/:.*$//'`"
23736     lib="`echo $found | sed -e 's/^.*://'`"
23737
23738
23739   if test "x$APRUTIL_INCLUDES" = "x"; then
23740     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
23741     APRUTIL_INCLUDES="-I$header"
23742   else
23743     apr_addto_bugger="-I$header"
23744     for i in $apr_addto_bugger; do
23745       apr_addto_duplicate="0"
23746       for j in $APRUTIL_INCLUDES; do
23747         if test "x$i" = "x$j"; then
23748           apr_addto_duplicate="1"
23749           break
23750         fi
23751       done
23752       if test $apr_addto_duplicate = "0"; then
23753         echo "  adding \"$i\" to APRUTIL_INCLUDES"
23754         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
23755       fi
23756     done
23757   fi
23758
23759
23760   if test "x$APRUTIL_LDFLAGS" = "x"; then
23761     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
23762     APRUTIL_LDFLAGS="-L$lib"
23763   else
23764     apr_addto_bugger="-L$lib"
23765     for i in $apr_addto_bugger; do
23766       apr_addto_duplicate="0"
23767       for j in $APRUTIL_LDFLAGS; do
23768         if test "x$i" = "x$j"; then
23769           apr_addto_duplicate="1"
23770           break
23771         fi
23772       done
23773       if test $apr_addto_duplicate = "0"; then
23774         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
23775         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
23776       fi
23777     done
23778   fi
23779
23780     apu_db_header=$bdb_header
23781     apu_db_lib=$bdb_libname
23782     apu_have_db=1
23783     ;;
23784   *)
23785
23786   if test "x$APRUTIL_INCLUDES" = "x"; then
23787     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
23788     APRUTIL_INCLUDES="-I$found/include"
23789   else
23790     apr_addto_bugger="-I$found/include"
23791     for i in $apr_addto_bugger; do
23792       apr_addto_duplicate="0"
23793       for j in $APRUTIL_INCLUDES; do
23794         if test "x$i" = "x$j"; then
23795           apr_addto_duplicate="1"
23796           break
23797         fi
23798       done
23799       if test $apr_addto_duplicate = "0"; then
23800         echo "  adding \"$i\" to APRUTIL_INCLUDES"
23801         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
23802       fi
23803     done
23804   fi
23805
23806
23807   if test "x$APRUTIL_LDFLAGS" = "x"; then
23808     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
23809     APRUTIL_LDFLAGS="-L$found/lib"
23810   else
23811     apr_addto_bugger="-L$found/lib"
23812     for i in $apr_addto_bugger; do
23813       apr_addto_duplicate="0"
23814       for j in $APRUTIL_LDFLAGS; do
23815         if test "x$i" = "x$j"; then
23816           apr_addto_duplicate="1"
23817           break
23818         fi
23819       done
23820       if test $apr_addto_duplicate = "0"; then
23821         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
23822         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
23823       fi
23824     done
23825   fi
23826
23827     apu_db_header=$bdb_header
23828     apu_db_lib=$bdb_libname
23829     apu_have_db=1
23830     ;;
23831   esac
23832
23833   if test "$apu_have_db" = "1"; then
23834     apu_db_version=4
23835   fi
23836
23837     if test "$apu_db_version" != "4"; then
23838       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
23839 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
23840    { (exit 1); exit 1; }; }
23841     fi
23842     ;;
23843   db46)
23844
23845   places="$check_places"
23846   if test -z "$places"; then
23847     places="std /usr/local/BerkeleyDB.4.6 /boot/home/config"
23848   fi
23849
23850   bdb_version="4"
23851   if test ""6"" != "-1"; then
23852     bdb_version="$bdb_version."6""
23853     if test ""-1"" != "-1"; then
23854       bdb_version="$bdb_version."-1""
23855     fi
23856   fi
23857   bdb_places="$places"
23858   bdb_default_search_headers="db46/db.h db4/db.h db.h"
23859   bdb_default_search_lib_names="db-4.6 db4-4.6 db46 db4 db"
23860
23861
23862   apu_have_db=0
23863
23864   # Save the original values of the flags we tweak.
23865   apu_check_lib_save_libs="$LIBS"
23866   apu_check_lib_save_ldflags="$LDFLAGS"
23867   apu_check_lib_save_cppflags="$CPPFLAGS"
23868
23869   # The variable `found' is the prefix under which we've found
23870   # Berkeley DB, or `not' if we haven't found it anywhere yet.
23871   found=not
23872   for bdb_place in $bdb_places; do
23873
23874     LDFLAGS="$apu_check_lib_save_ldflags"
23875     CPPFLAGS="$apu_check_lib_save_cppflags"
23876     case "$bdb_place" in
23877       "std" )
23878         description="the standard places"
23879       ;;
23880       *":"* )
23881         header="`echo $bdb_place | sed -e 's/:.*$//'`"
23882         lib="`echo $bdb_place | sed -e 's/^.*://'`"
23883         CPPFLAGS="$CPPFLAGS -I$header"
23884         LDFLAGS="$LDFLAGS -L$lib"
23885         description="$header and $lib"
23886       ;;
23887       * )
23888         if test -d $bdb_place; then
23889           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
23890           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
23891         else
23892           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
23893 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
23894           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
23895 $as_echo "directory not found" >&6; }
23896           continue
23897         fi
23898         description="$bdb_place"
23899       ;;
23900     esac
23901
23902     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
23903     # trick to display a message instead.
23904     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
23905 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
23906     { $as_echo "$as_me:$LINENO: result: " >&5
23907 $as_echo "" >&6; }
23908
23909     for bdb_libname in $bdb_default_search_lib_names; do
23910       for bdb_header in $bdb_default_search_headers; do
23911         # Clear the header cache variable for each location
23912
23913         cache_id="`echo ac_cv_header_${bdb_header} \
23914                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
23915
23916         unset $cache_id
23917         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
23918 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
23919   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
23920 $as_echo_n "checking for $bdb_header... " >&6; }
23921 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
23922   $as_echo_n "(cached) " >&6
23923 fi
23924 ac_res=`eval 'as_val=${'$as_ac_Header'}
23925                  $as_echo "$as_val"'`
23926                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
23927 $as_echo "$ac_res" >&6; }
23928 else
23929   # Is the header compilable?
23930 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
23931 $as_echo_n "checking $bdb_header usability... " >&6; }
23932 cat >conftest.$ac_ext <<_ACEOF
23933 /* confdefs.h.  */
23934 _ACEOF
23935 cat confdefs.h >>conftest.$ac_ext
23936 cat >>conftest.$ac_ext <<_ACEOF
23937 /* end confdefs.h.  */
23938 $ac_includes_default
23939 #include <$bdb_header>
23940 _ACEOF
23941 rm -f conftest.$ac_objext
23942 if { (ac_try="$ac_compile"
23943 case "(($ac_try" in
23944   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23945   *) ac_try_echo=$ac_try;;
23946 esac
23947 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23948 $as_echo "$ac_try_echo") >&5
23949   (eval "$ac_compile") 2>conftest.er1
23950   ac_status=$?
23951   grep -v '^ *+' conftest.er1 >conftest.err
23952   rm -f conftest.er1
23953   cat conftest.err >&5
23954   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23955   (exit $ac_status); } && {
23956          test -z "$ac_c_werror_flag" ||
23957          test ! -s conftest.err
23958        } && test -s conftest.$ac_objext; then
23959   ac_header_compiler=yes
23960 else
23961   $as_echo "$as_me: failed program was:" >&5
23962 sed 's/^/| /' conftest.$ac_ext >&5
23963
23964         ac_header_compiler=no
23965 fi
23966
23967 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23968 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
23969 $as_echo "$ac_header_compiler" >&6; }
23970
23971 # Is the header present?
23972 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
23973 $as_echo_n "checking $bdb_header presence... " >&6; }
23974 cat >conftest.$ac_ext <<_ACEOF
23975 /* confdefs.h.  */
23976 _ACEOF
23977 cat confdefs.h >>conftest.$ac_ext
23978 cat >>conftest.$ac_ext <<_ACEOF
23979 /* end confdefs.h.  */
23980 #include <$bdb_header>
23981 _ACEOF
23982 if { (ac_try="$ac_cpp conftest.$ac_ext"
23983 case "(($ac_try" in
23984   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23985   *) ac_try_echo=$ac_try;;
23986 esac
23987 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23988 $as_echo "$ac_try_echo") >&5
23989   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
23990   ac_status=$?
23991   grep -v '^ *+' conftest.er1 >conftest.err
23992   rm -f conftest.er1
23993   cat conftest.err >&5
23994   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23995   (exit $ac_status); } >/dev/null && {
23996          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
23997          test ! -s conftest.err
23998        }; then
23999   ac_header_preproc=yes
24000 else
24001   $as_echo "$as_me: failed program was:" >&5
24002 sed 's/^/| /' conftest.$ac_ext >&5
24003
24004   ac_header_preproc=no
24005 fi
24006
24007 rm -f conftest.err conftest.$ac_ext
24008 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
24009 $as_echo "$ac_header_preproc" >&6; }
24010
24011 # So?  What about this header?
24012 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
24013   yes:no: )
24014     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
24015 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
24016     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
24017 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
24018     ac_header_preproc=yes
24019     ;;
24020   no:yes:* )
24021     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
24022 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
24023     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
24024 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
24025     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
24026 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
24027     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
24028 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
24029     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
24030 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
24031     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
24032 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
24033
24034     ;;
24035 esac
24036 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
24037 $as_echo_n "checking for $bdb_header... " >&6; }
24038 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
24039   $as_echo_n "(cached) " >&6
24040 else
24041   eval "$as_ac_Header=\$ac_header_preproc"
24042 fi
24043 ac_res=`eval 'as_val=${'$as_ac_Header'}
24044                  $as_echo "$as_val"'`
24045                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
24046 $as_echo "$ac_res" >&6; }
24047
24048 fi
24049 as_val=`eval 'as_val=${'$as_ac_Header'}
24050                  $as_echo "$as_val"'`
24051    if test "x$as_val" = x""yes; then
24052
24053           if test ""4"" = "3" -o ""4"" = "4"; then
24054             # We generate a separate cache variable for each prefix and libname
24055             # we search under.  That way, we avoid caching information that
24056             # changes if the user runs `configure' with a different set of
24057             # switches.
24058
24059             cache_id="`echo apu_cv_check_berkeley_db_"4"_"6"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
24060                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
24061
24062
24063             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
24064 $as_echo_n "checking for -l$bdb_libname... " >&6; }
24065                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
24066   $as_echo_n "(cached) " >&6
24067 else
24068
24069
24070     apu_try_berkeley_db_save_libs="$LIBS"
24071
24072     apu_check_berkeley_db_major="4"
24073     apu_check_berkeley_db_minor="6"
24074     apu_check_berkeley_db_patch="-1"
24075     apu_try_berkeley_db_header=$bdb_header
24076     apu_try_berkeley_db_libname=$bdb_libname
24077
24078     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
24079     if test "$cross_compiling" = yes; then
24080   apu_try_berkeley_db=yes
24081
24082 else
24083   cat >conftest.$ac_ext <<_ACEOF
24084 /* confdefs.h.  */
24085 _ACEOF
24086 cat confdefs.h >>conftest.$ac_ext
24087 cat >>conftest.$ac_ext <<_ACEOF
24088 /* end confdefs.h.  */
24089
24090 #include <stdlib.h>
24091 #include <stdio.h>
24092 #include <$apu_try_berkeley_db_header>
24093 main ()
24094 {
24095   int major, minor, patch;
24096
24097   db_version(&major, &minor, &patch);
24098
24099   /* Sanity check: ensure that db.h constants actually match the db library */
24100   if (major != DB_VERSION_MAJOR
24101       || minor != DB_VERSION_MINOR
24102       || patch != DB_VERSION_PATCH)
24103     exit (1);
24104
24105   /* Run-time check:  ensure the library claims to be the correct version. */
24106
24107   if ($apu_check_berkeley_db_major != -1) {
24108     if (major < $apu_check_berkeley_db_major)
24109       exit (1);
24110     if (major > $apu_check_berkeley_db_major)
24111       exit (0);
24112   }
24113
24114   if ($apu_check_berkeley_db_minor != -1) {
24115     if (minor < $apu_check_berkeley_db_minor)
24116       exit (1);
24117     if (minor > $apu_check_berkeley_db_minor)
24118       exit (0);
24119   }
24120
24121   if ($apu_check_berkeley_db_patch == -1
24122       || patch >= $apu_check_berkeley_db_patch)
24123     exit (0);
24124   else
24125     exit (1);
24126 }
24127
24128 _ACEOF
24129 rm -f conftest$ac_exeext
24130 if { (ac_try="$ac_link"
24131 case "(($ac_try" in
24132   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24133   *) ac_try_echo=$ac_try;;
24134 esac
24135 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24136 $as_echo "$ac_try_echo") >&5
24137   (eval "$ac_link") 2>&5
24138   ac_status=$?
24139   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24140   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
24141   { (case "(($ac_try" in
24142   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24143   *) ac_try_echo=$ac_try;;
24144 esac
24145 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24146 $as_echo "$ac_try_echo") >&5
24147   (eval "$ac_try") 2>&5
24148   ac_status=$?
24149   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24150   (exit $ac_status); }; }; then
24151   apu_try_berkeley_db=yes
24152 else
24153   $as_echo "$as_me: program exited with status $ac_status" >&5
24154 $as_echo "$as_me: failed program was:" >&5
24155 sed 's/^/| /' conftest.$ac_ext >&5
24156
24157 ( exit $ac_status )
24158 apu_try_berkeley_db=no
24159 fi
24160 rm -rf conftest.dSYM
24161 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
24162 fi
24163
24164
24165
24166     LIBS="$apu_try_berkeley_db_save_libs"
24167
24168
24169                 eval "$cache_id=$apu_try_berkeley_db"
24170
24171 fi
24172
24173             result="`eval echo '$'$cache_id`"
24174             { $as_echo "$as_me:$LINENO: result: $result" >&5
24175 $as_echo "$result" >&6; }
24176           elif test ""4"" = "1"; then
24177             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
24178 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
24179 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
24180 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
24181   $as_echo_n "(cached) " >&6
24182 else
24183   ac_check_lib_save_LIBS=$LIBS
24184 LIBS="-l$bdb_libname  $LIBS"
24185 cat >conftest.$ac_ext <<_ACEOF
24186 /* confdefs.h.  */
24187 _ACEOF
24188 cat confdefs.h >>conftest.$ac_ext
24189 cat >>conftest.$ac_ext <<_ACEOF
24190 /* end confdefs.h.  */
24191
24192 /* Override any GCC internal prototype to avoid an error.
24193    Use char because int might match the return type of a GCC
24194    builtin and then its argument prototype would still apply.  */
24195 #ifdef __cplusplus
24196 extern "C"
24197 #endif
24198 char dbopen ();
24199 int
24200 main ()
24201 {
24202 return dbopen ();
24203   ;
24204   return 0;
24205 }
24206 _ACEOF
24207 rm -f conftest.$ac_objext conftest$ac_exeext
24208 if { (ac_try="$ac_link"
24209 case "(($ac_try" in
24210   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24211   *) ac_try_echo=$ac_try;;
24212 esac
24213 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24214 $as_echo "$ac_try_echo") >&5
24215   (eval "$ac_link") 2>conftest.er1
24216   ac_status=$?
24217   grep -v '^ *+' conftest.er1 >conftest.err
24218   rm -f conftest.er1
24219   cat conftest.err >&5
24220   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24221   (exit $ac_status); } && {
24222          test -z "$ac_c_werror_flag" ||
24223          test ! -s conftest.err
24224        } && test -s conftest$ac_exeext && {
24225          test "$cross_compiling" = yes ||
24226          $as_test_x conftest$ac_exeext
24227        }; then
24228   eval "$as_ac_Lib=yes"
24229 else
24230   $as_echo "$as_me: failed program was:" >&5
24231 sed 's/^/| /' conftest.$ac_ext >&5
24232
24233         eval "$as_ac_Lib=no"
24234 fi
24235
24236 rm -rf conftest.dSYM
24237 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
24238       conftest$ac_exeext conftest.$ac_ext
24239 LIBS=$ac_check_lib_save_LIBS
24240 fi
24241 ac_res=`eval 'as_val=${'$as_ac_Lib'}
24242                  $as_echo "$as_val"'`
24243                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
24244 $as_echo "$ac_res" >&6; }
24245 as_val=`eval 'as_val=${'$as_ac_Lib'}
24246                  $as_echo "$as_val"'`
24247    if test "x$as_val" = x""yes; then
24248   result=yes
24249 else
24250   result=no
24251
24252 fi
24253
24254           elif test ""4"" = "2"; then
24255             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
24256 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
24257 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
24258 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
24259   $as_echo_n "(cached) " >&6
24260 else
24261   ac_check_lib_save_LIBS=$LIBS
24262 LIBS="-l$bdb_libname  $LIBS"
24263 cat >conftest.$ac_ext <<_ACEOF
24264 /* confdefs.h.  */
24265 _ACEOF
24266 cat confdefs.h >>conftest.$ac_ext
24267 cat >>conftest.$ac_ext <<_ACEOF
24268 /* end confdefs.h.  */
24269
24270 /* Override any GCC internal prototype to avoid an error.
24271    Use char because int might match the return type of a GCC
24272    builtin and then its argument prototype would still apply.  */
24273 #ifdef __cplusplus
24274 extern "C"
24275 #endif
24276 char db_open ();
24277 int
24278 main ()
24279 {
24280 return db_open ();
24281   ;
24282   return 0;
24283 }
24284 _ACEOF
24285 rm -f conftest.$ac_objext conftest$ac_exeext
24286 if { (ac_try="$ac_link"
24287 case "(($ac_try" in
24288   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24289   *) ac_try_echo=$ac_try;;
24290 esac
24291 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24292 $as_echo "$ac_try_echo") >&5
24293   (eval "$ac_link") 2>conftest.er1
24294   ac_status=$?
24295   grep -v '^ *+' conftest.er1 >conftest.err
24296   rm -f conftest.er1
24297   cat conftest.err >&5
24298   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24299   (exit $ac_status); } && {
24300          test -z "$ac_c_werror_flag" ||
24301          test ! -s conftest.err
24302        } && test -s conftest$ac_exeext && {
24303          test "$cross_compiling" = yes ||
24304          $as_test_x conftest$ac_exeext
24305        }; then
24306   eval "$as_ac_Lib=yes"
24307 else
24308   $as_echo "$as_me: failed program was:" >&5
24309 sed 's/^/| /' conftest.$ac_ext >&5
24310
24311         eval "$as_ac_Lib=no"
24312 fi
24313
24314 rm -rf conftest.dSYM
24315 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
24316       conftest$ac_exeext conftest.$ac_ext
24317 LIBS=$ac_check_lib_save_LIBS
24318 fi
24319 ac_res=`eval 'as_val=${'$as_ac_Lib'}
24320                  $as_echo "$as_val"'`
24321                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
24322 $as_echo "$ac_res" >&6; }
24323 as_val=`eval 'as_val=${'$as_ac_Lib'}
24324                  $as_echo "$as_val"'`
24325    if test "x$as_val" = x""yes; then
24326   result=yes
24327 else
24328   result=no
24329
24330 fi
24331
24332           fi
24333
24334 else
24335   result="no"
24336 fi
24337
24338
24339
24340         # If we found it, no need to search any more.
24341         if test "$result" = "yes"; then
24342           found="$bdb_place"
24343           break
24344         fi
24345       done
24346       test "$found" != "not" && break
24347     done
24348     test "$found" != "not" && break
24349   done
24350
24351   # Restore the original values of the flags we tweak.
24352   LDFLAGS="$apu_check_lib_save_ldflags"
24353   CPPFLAGS="$apu_check_lib_save_cppflags"
24354
24355   case "$found" in
24356   "not")
24357     apu_have_db=0
24358     ;;
24359   "std")
24360     apu_db_header=$bdb_header
24361     apu_db_lib=$bdb_libname
24362     apu_have_db=1
24363     ;;
24364   *":"*)
24365     header="`echo $found | sed -e 's/:.*$//'`"
24366     lib="`echo $found | sed -e 's/^.*://'`"
24367
24368
24369   if test "x$APRUTIL_INCLUDES" = "x"; then
24370     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
24371     APRUTIL_INCLUDES="-I$header"
24372   else
24373     apr_addto_bugger="-I$header"
24374     for i in $apr_addto_bugger; do
24375       apr_addto_duplicate="0"
24376       for j in $APRUTIL_INCLUDES; do
24377         if test "x$i" = "x$j"; then
24378           apr_addto_duplicate="1"
24379           break
24380         fi
24381       done
24382       if test $apr_addto_duplicate = "0"; then
24383         echo "  adding \"$i\" to APRUTIL_INCLUDES"
24384         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
24385       fi
24386     done
24387   fi
24388
24389
24390   if test "x$APRUTIL_LDFLAGS" = "x"; then
24391     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
24392     APRUTIL_LDFLAGS="-L$lib"
24393   else
24394     apr_addto_bugger="-L$lib"
24395     for i in $apr_addto_bugger; do
24396       apr_addto_duplicate="0"
24397       for j in $APRUTIL_LDFLAGS; do
24398         if test "x$i" = "x$j"; then
24399           apr_addto_duplicate="1"
24400           break
24401         fi
24402       done
24403       if test $apr_addto_duplicate = "0"; then
24404         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
24405         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
24406       fi
24407     done
24408   fi
24409
24410     apu_db_header=$bdb_header
24411     apu_db_lib=$bdb_libname
24412     apu_have_db=1
24413     ;;
24414   *)
24415
24416   if test "x$APRUTIL_INCLUDES" = "x"; then
24417     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
24418     APRUTIL_INCLUDES="-I$found/include"
24419   else
24420     apr_addto_bugger="-I$found/include"
24421     for i in $apr_addto_bugger; do
24422       apr_addto_duplicate="0"
24423       for j in $APRUTIL_INCLUDES; do
24424         if test "x$i" = "x$j"; then
24425           apr_addto_duplicate="1"
24426           break
24427         fi
24428       done
24429       if test $apr_addto_duplicate = "0"; then
24430         echo "  adding \"$i\" to APRUTIL_INCLUDES"
24431         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
24432       fi
24433     done
24434   fi
24435
24436
24437   if test "x$APRUTIL_LDFLAGS" = "x"; then
24438     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
24439     APRUTIL_LDFLAGS="-L$found/lib"
24440   else
24441     apr_addto_bugger="-L$found/lib"
24442     for i in $apr_addto_bugger; do
24443       apr_addto_duplicate="0"
24444       for j in $APRUTIL_LDFLAGS; do
24445         if test "x$i" = "x$j"; then
24446           apr_addto_duplicate="1"
24447           break
24448         fi
24449       done
24450       if test $apr_addto_duplicate = "0"; then
24451         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
24452         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
24453       fi
24454     done
24455   fi
24456
24457     apu_db_header=$bdb_header
24458     apu_db_lib=$bdb_libname
24459     apu_have_db=1
24460     ;;
24461   esac
24462
24463   if test "$apu_have_db" = "1"; then
24464     apu_db_version=4
24465   fi
24466
24467     if test "$apu_db_version" != "4"; then
24468       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
24469 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
24470    { (exit 1); exit 1; }; }
24471     fi
24472     ;;
24473   db47)
24474
24475   places="$check_places"
24476   if test -z "$places"; then
24477     places="std /usr/local/BerkeleyDB.4.7 /boot/home/config"
24478   fi
24479
24480   bdb_version="4"
24481   if test ""7"" != "-1"; then
24482     bdb_version="$bdb_version."7""
24483     if test ""-1"" != "-1"; then
24484       bdb_version="$bdb_version."-1""
24485     fi
24486   fi
24487   bdb_places="$places"
24488   bdb_default_search_headers="db47/db.h db4/db.h db.h"
24489   bdb_default_search_lib_names="db-4.7 db4-4.7 db47 db4 db"
24490
24491
24492   apu_have_db=0
24493
24494   # Save the original values of the flags we tweak.
24495   apu_check_lib_save_libs="$LIBS"
24496   apu_check_lib_save_ldflags="$LDFLAGS"
24497   apu_check_lib_save_cppflags="$CPPFLAGS"
24498
24499   # The variable `found' is the prefix under which we've found
24500   # Berkeley DB, or `not' if we haven't found it anywhere yet.
24501   found=not
24502   for bdb_place in $bdb_places; do
24503
24504     LDFLAGS="$apu_check_lib_save_ldflags"
24505     CPPFLAGS="$apu_check_lib_save_cppflags"
24506     case "$bdb_place" in
24507       "std" )
24508         description="the standard places"
24509       ;;
24510       *":"* )
24511         header="`echo $bdb_place | sed -e 's/:.*$//'`"
24512         lib="`echo $bdb_place | sed -e 's/^.*://'`"
24513         CPPFLAGS="$CPPFLAGS -I$header"
24514         LDFLAGS="$LDFLAGS -L$lib"
24515         description="$header and $lib"
24516       ;;
24517       * )
24518         if test -d $bdb_place; then
24519           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
24520           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
24521         else
24522           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
24523 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
24524           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
24525 $as_echo "directory not found" >&6; }
24526           continue
24527         fi
24528         description="$bdb_place"
24529       ;;
24530     esac
24531
24532     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
24533     # trick to display a message instead.
24534     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
24535 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
24536     { $as_echo "$as_me:$LINENO: result: " >&5
24537 $as_echo "" >&6; }
24538
24539     for bdb_libname in $bdb_default_search_lib_names; do
24540       for bdb_header in $bdb_default_search_headers; do
24541         # Clear the header cache variable for each location
24542
24543         cache_id="`echo ac_cv_header_${bdb_header} \
24544                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
24545
24546         unset $cache_id
24547         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
24548 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
24549   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
24550 $as_echo_n "checking for $bdb_header... " >&6; }
24551 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
24552   $as_echo_n "(cached) " >&6
24553 fi
24554 ac_res=`eval 'as_val=${'$as_ac_Header'}
24555                  $as_echo "$as_val"'`
24556                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
24557 $as_echo "$ac_res" >&6; }
24558 else
24559   # Is the header compilable?
24560 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
24561 $as_echo_n "checking $bdb_header usability... " >&6; }
24562 cat >conftest.$ac_ext <<_ACEOF
24563 /* confdefs.h.  */
24564 _ACEOF
24565 cat confdefs.h >>conftest.$ac_ext
24566 cat >>conftest.$ac_ext <<_ACEOF
24567 /* end confdefs.h.  */
24568 $ac_includes_default
24569 #include <$bdb_header>
24570 _ACEOF
24571 rm -f conftest.$ac_objext
24572 if { (ac_try="$ac_compile"
24573 case "(($ac_try" in
24574   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24575   *) ac_try_echo=$ac_try;;
24576 esac
24577 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24578 $as_echo "$ac_try_echo") >&5
24579   (eval "$ac_compile") 2>conftest.er1
24580   ac_status=$?
24581   grep -v '^ *+' conftest.er1 >conftest.err
24582   rm -f conftest.er1
24583   cat conftest.err >&5
24584   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24585   (exit $ac_status); } && {
24586          test -z "$ac_c_werror_flag" ||
24587          test ! -s conftest.err
24588        } && test -s conftest.$ac_objext; then
24589   ac_header_compiler=yes
24590 else
24591   $as_echo "$as_me: failed program was:" >&5
24592 sed 's/^/| /' conftest.$ac_ext >&5
24593
24594         ac_header_compiler=no
24595 fi
24596
24597 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24598 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
24599 $as_echo "$ac_header_compiler" >&6; }
24600
24601 # Is the header present?
24602 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
24603 $as_echo_n "checking $bdb_header presence... " >&6; }
24604 cat >conftest.$ac_ext <<_ACEOF
24605 /* confdefs.h.  */
24606 _ACEOF
24607 cat confdefs.h >>conftest.$ac_ext
24608 cat >>conftest.$ac_ext <<_ACEOF
24609 /* end confdefs.h.  */
24610 #include <$bdb_header>
24611 _ACEOF
24612 if { (ac_try="$ac_cpp conftest.$ac_ext"
24613 case "(($ac_try" in
24614   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24615   *) ac_try_echo=$ac_try;;
24616 esac
24617 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24618 $as_echo "$ac_try_echo") >&5
24619   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
24620   ac_status=$?
24621   grep -v '^ *+' conftest.er1 >conftest.err
24622   rm -f conftest.er1
24623   cat conftest.err >&5
24624   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24625   (exit $ac_status); } >/dev/null && {
24626          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
24627          test ! -s conftest.err
24628        }; then
24629   ac_header_preproc=yes
24630 else
24631   $as_echo "$as_me: failed program was:" >&5
24632 sed 's/^/| /' conftest.$ac_ext >&5
24633
24634   ac_header_preproc=no
24635 fi
24636
24637 rm -f conftest.err conftest.$ac_ext
24638 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
24639 $as_echo "$ac_header_preproc" >&6; }
24640
24641 # So?  What about this header?
24642 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
24643   yes:no: )
24644     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
24645 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
24646     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
24647 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
24648     ac_header_preproc=yes
24649     ;;
24650   no:yes:* )
24651     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
24652 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
24653     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
24654 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
24655     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
24656 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
24657     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
24658 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
24659     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
24660 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
24661     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
24662 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
24663
24664     ;;
24665 esac
24666 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
24667 $as_echo_n "checking for $bdb_header... " >&6; }
24668 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
24669   $as_echo_n "(cached) " >&6
24670 else
24671   eval "$as_ac_Header=\$ac_header_preproc"
24672 fi
24673 ac_res=`eval 'as_val=${'$as_ac_Header'}
24674                  $as_echo "$as_val"'`
24675                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
24676 $as_echo "$ac_res" >&6; }
24677
24678 fi
24679 as_val=`eval 'as_val=${'$as_ac_Header'}
24680                  $as_echo "$as_val"'`
24681    if test "x$as_val" = x""yes; then
24682
24683           if test ""4"" = "3" -o ""4"" = "4"; then
24684             # We generate a separate cache variable for each prefix and libname
24685             # we search under.  That way, we avoid caching information that
24686             # changes if the user runs `configure' with a different set of
24687             # switches.
24688
24689             cache_id="`echo apu_cv_check_berkeley_db_"4"_"7"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
24690                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
24691
24692
24693             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
24694 $as_echo_n "checking for -l$bdb_libname... " >&6; }
24695                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
24696   $as_echo_n "(cached) " >&6
24697 else
24698
24699
24700     apu_try_berkeley_db_save_libs="$LIBS"
24701
24702     apu_check_berkeley_db_major="4"
24703     apu_check_berkeley_db_minor="7"
24704     apu_check_berkeley_db_patch="-1"
24705     apu_try_berkeley_db_header=$bdb_header
24706     apu_try_berkeley_db_libname=$bdb_libname
24707
24708     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
24709     if test "$cross_compiling" = yes; then
24710   apu_try_berkeley_db=yes
24711
24712 else
24713   cat >conftest.$ac_ext <<_ACEOF
24714 /* confdefs.h.  */
24715 _ACEOF
24716 cat confdefs.h >>conftest.$ac_ext
24717 cat >>conftest.$ac_ext <<_ACEOF
24718 /* end confdefs.h.  */
24719
24720 #include <stdlib.h>
24721 #include <stdio.h>
24722 #include <$apu_try_berkeley_db_header>
24723 main ()
24724 {
24725   int major, minor, patch;
24726
24727   db_version(&major, &minor, &patch);
24728
24729   /* Sanity check: ensure that db.h constants actually match the db library */
24730   if (major != DB_VERSION_MAJOR
24731       || minor != DB_VERSION_MINOR
24732       || patch != DB_VERSION_PATCH)
24733     exit (1);
24734
24735   /* Run-time check:  ensure the library claims to be the correct version. */
24736
24737   if ($apu_check_berkeley_db_major != -1) {
24738     if (major < $apu_check_berkeley_db_major)
24739       exit (1);
24740     if (major > $apu_check_berkeley_db_major)
24741       exit (0);
24742   }
24743
24744   if ($apu_check_berkeley_db_minor != -1) {
24745     if (minor < $apu_check_berkeley_db_minor)
24746       exit (1);
24747     if (minor > $apu_check_berkeley_db_minor)
24748       exit (0);
24749   }
24750
24751   if ($apu_check_berkeley_db_patch == -1
24752       || patch >= $apu_check_berkeley_db_patch)
24753     exit (0);
24754   else
24755     exit (1);
24756 }
24757
24758 _ACEOF
24759 rm -f conftest$ac_exeext
24760 if { (ac_try="$ac_link"
24761 case "(($ac_try" in
24762   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24763   *) ac_try_echo=$ac_try;;
24764 esac
24765 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24766 $as_echo "$ac_try_echo") >&5
24767   (eval "$ac_link") 2>&5
24768   ac_status=$?
24769   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24770   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
24771   { (case "(($ac_try" in
24772   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24773   *) ac_try_echo=$ac_try;;
24774 esac
24775 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24776 $as_echo "$ac_try_echo") >&5
24777   (eval "$ac_try") 2>&5
24778   ac_status=$?
24779   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24780   (exit $ac_status); }; }; then
24781   apu_try_berkeley_db=yes
24782 else
24783   $as_echo "$as_me: program exited with status $ac_status" >&5
24784 $as_echo "$as_me: failed program was:" >&5
24785 sed 's/^/| /' conftest.$ac_ext >&5
24786
24787 ( exit $ac_status )
24788 apu_try_berkeley_db=no
24789 fi
24790 rm -rf conftest.dSYM
24791 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
24792 fi
24793
24794
24795
24796     LIBS="$apu_try_berkeley_db_save_libs"
24797
24798
24799                 eval "$cache_id=$apu_try_berkeley_db"
24800
24801 fi
24802
24803             result="`eval echo '$'$cache_id`"
24804             { $as_echo "$as_me:$LINENO: result: $result" >&5
24805 $as_echo "$result" >&6; }
24806           elif test ""4"" = "1"; then
24807             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
24808 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
24809 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
24810 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
24811   $as_echo_n "(cached) " >&6
24812 else
24813   ac_check_lib_save_LIBS=$LIBS
24814 LIBS="-l$bdb_libname  $LIBS"
24815 cat >conftest.$ac_ext <<_ACEOF
24816 /* confdefs.h.  */
24817 _ACEOF
24818 cat confdefs.h >>conftest.$ac_ext
24819 cat >>conftest.$ac_ext <<_ACEOF
24820 /* end confdefs.h.  */
24821
24822 /* Override any GCC internal prototype to avoid an error.
24823    Use char because int might match the return type of a GCC
24824    builtin and then its argument prototype would still apply.  */
24825 #ifdef __cplusplus
24826 extern "C"
24827 #endif
24828 char dbopen ();
24829 int
24830 main ()
24831 {
24832 return dbopen ();
24833   ;
24834   return 0;
24835 }
24836 _ACEOF
24837 rm -f conftest.$ac_objext conftest$ac_exeext
24838 if { (ac_try="$ac_link"
24839 case "(($ac_try" in
24840   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24841   *) ac_try_echo=$ac_try;;
24842 esac
24843 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24844 $as_echo "$ac_try_echo") >&5
24845   (eval "$ac_link") 2>conftest.er1
24846   ac_status=$?
24847   grep -v '^ *+' conftest.er1 >conftest.err
24848   rm -f conftest.er1
24849   cat conftest.err >&5
24850   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24851   (exit $ac_status); } && {
24852          test -z "$ac_c_werror_flag" ||
24853          test ! -s conftest.err
24854        } && test -s conftest$ac_exeext && {
24855          test "$cross_compiling" = yes ||
24856          $as_test_x conftest$ac_exeext
24857        }; then
24858   eval "$as_ac_Lib=yes"
24859 else
24860   $as_echo "$as_me: failed program was:" >&5
24861 sed 's/^/| /' conftest.$ac_ext >&5
24862
24863         eval "$as_ac_Lib=no"
24864 fi
24865
24866 rm -rf conftest.dSYM
24867 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
24868       conftest$ac_exeext conftest.$ac_ext
24869 LIBS=$ac_check_lib_save_LIBS
24870 fi
24871 ac_res=`eval 'as_val=${'$as_ac_Lib'}
24872                  $as_echo "$as_val"'`
24873                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
24874 $as_echo "$ac_res" >&6; }
24875 as_val=`eval 'as_val=${'$as_ac_Lib'}
24876                  $as_echo "$as_val"'`
24877    if test "x$as_val" = x""yes; then
24878   result=yes
24879 else
24880   result=no
24881
24882 fi
24883
24884           elif test ""4"" = "2"; then
24885             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
24886 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
24887 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
24888 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
24889   $as_echo_n "(cached) " >&6
24890 else
24891   ac_check_lib_save_LIBS=$LIBS
24892 LIBS="-l$bdb_libname  $LIBS"
24893 cat >conftest.$ac_ext <<_ACEOF
24894 /* confdefs.h.  */
24895 _ACEOF
24896 cat confdefs.h >>conftest.$ac_ext
24897 cat >>conftest.$ac_ext <<_ACEOF
24898 /* end confdefs.h.  */
24899
24900 /* Override any GCC internal prototype to avoid an error.
24901    Use char because int might match the return type of a GCC
24902    builtin and then its argument prototype would still apply.  */
24903 #ifdef __cplusplus
24904 extern "C"
24905 #endif
24906 char db_open ();
24907 int
24908 main ()
24909 {
24910 return db_open ();
24911   ;
24912   return 0;
24913 }
24914 _ACEOF
24915 rm -f conftest.$ac_objext conftest$ac_exeext
24916 if { (ac_try="$ac_link"
24917 case "(($ac_try" in
24918   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
24919   *) ac_try_echo=$ac_try;;
24920 esac
24921 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
24922 $as_echo "$ac_try_echo") >&5
24923   (eval "$ac_link") 2>conftest.er1
24924   ac_status=$?
24925   grep -v '^ *+' conftest.er1 >conftest.err
24926   rm -f conftest.er1
24927   cat conftest.err >&5
24928   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
24929   (exit $ac_status); } && {
24930          test -z "$ac_c_werror_flag" ||
24931          test ! -s conftest.err
24932        } && test -s conftest$ac_exeext && {
24933          test "$cross_compiling" = yes ||
24934          $as_test_x conftest$ac_exeext
24935        }; then
24936   eval "$as_ac_Lib=yes"
24937 else
24938   $as_echo "$as_me: failed program was:" >&5
24939 sed 's/^/| /' conftest.$ac_ext >&5
24940
24941         eval "$as_ac_Lib=no"
24942 fi
24943
24944 rm -rf conftest.dSYM
24945 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
24946       conftest$ac_exeext conftest.$ac_ext
24947 LIBS=$ac_check_lib_save_LIBS
24948 fi
24949 ac_res=`eval 'as_val=${'$as_ac_Lib'}
24950                  $as_echo "$as_val"'`
24951                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
24952 $as_echo "$ac_res" >&6; }
24953 as_val=`eval 'as_val=${'$as_ac_Lib'}
24954                  $as_echo "$as_val"'`
24955    if test "x$as_val" = x""yes; then
24956   result=yes
24957 else
24958   result=no
24959
24960 fi
24961
24962           fi
24963
24964 else
24965   result="no"
24966 fi
24967
24968
24969
24970         # If we found it, no need to search any more.
24971         if test "$result" = "yes"; then
24972           found="$bdb_place"
24973           break
24974         fi
24975       done
24976       test "$found" != "not" && break
24977     done
24978     test "$found" != "not" && break
24979   done
24980
24981   # Restore the original values of the flags we tweak.
24982   LDFLAGS="$apu_check_lib_save_ldflags"
24983   CPPFLAGS="$apu_check_lib_save_cppflags"
24984
24985   case "$found" in
24986   "not")
24987     apu_have_db=0
24988     ;;
24989   "std")
24990     apu_db_header=$bdb_header
24991     apu_db_lib=$bdb_libname
24992     apu_have_db=1
24993     ;;
24994   *":"*)
24995     header="`echo $found | sed -e 's/:.*$//'`"
24996     lib="`echo $found | sed -e 's/^.*://'`"
24997
24998
24999   if test "x$APRUTIL_INCLUDES" = "x"; then
25000     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
25001     APRUTIL_INCLUDES="-I$header"
25002   else
25003     apr_addto_bugger="-I$header"
25004     for i in $apr_addto_bugger; do
25005       apr_addto_duplicate="0"
25006       for j in $APRUTIL_INCLUDES; do
25007         if test "x$i" = "x$j"; then
25008           apr_addto_duplicate="1"
25009           break
25010         fi
25011       done
25012       if test $apr_addto_duplicate = "0"; then
25013         echo "  adding \"$i\" to APRUTIL_INCLUDES"
25014         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
25015       fi
25016     done
25017   fi
25018
25019
25020   if test "x$APRUTIL_LDFLAGS" = "x"; then
25021     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
25022     APRUTIL_LDFLAGS="-L$lib"
25023   else
25024     apr_addto_bugger="-L$lib"
25025     for i in $apr_addto_bugger; do
25026       apr_addto_duplicate="0"
25027       for j in $APRUTIL_LDFLAGS; do
25028         if test "x$i" = "x$j"; then
25029           apr_addto_duplicate="1"
25030           break
25031         fi
25032       done
25033       if test $apr_addto_duplicate = "0"; then
25034         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
25035         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
25036       fi
25037     done
25038   fi
25039
25040     apu_db_header=$bdb_header
25041     apu_db_lib=$bdb_libname
25042     apu_have_db=1
25043     ;;
25044   *)
25045
25046   if test "x$APRUTIL_INCLUDES" = "x"; then
25047     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
25048     APRUTIL_INCLUDES="-I$found/include"
25049   else
25050     apr_addto_bugger="-I$found/include"
25051     for i in $apr_addto_bugger; do
25052       apr_addto_duplicate="0"
25053       for j in $APRUTIL_INCLUDES; do
25054         if test "x$i" = "x$j"; then
25055           apr_addto_duplicate="1"
25056           break
25057         fi
25058       done
25059       if test $apr_addto_duplicate = "0"; then
25060         echo "  adding \"$i\" to APRUTIL_INCLUDES"
25061         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
25062       fi
25063     done
25064   fi
25065
25066
25067   if test "x$APRUTIL_LDFLAGS" = "x"; then
25068     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
25069     APRUTIL_LDFLAGS="-L$found/lib"
25070   else
25071     apr_addto_bugger="-L$found/lib"
25072     for i in $apr_addto_bugger; do
25073       apr_addto_duplicate="0"
25074       for j in $APRUTIL_LDFLAGS; do
25075         if test "x$i" = "x$j"; then
25076           apr_addto_duplicate="1"
25077           break
25078         fi
25079       done
25080       if test $apr_addto_duplicate = "0"; then
25081         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
25082         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
25083       fi
25084     done
25085   fi
25086
25087     apu_db_header=$bdb_header
25088     apu_db_lib=$bdb_libname
25089     apu_have_db=1
25090     ;;
25091   esac
25092
25093   if test "$apu_have_db" = "1"; then
25094     apu_db_version=4
25095   fi
25096
25097     if test "$apu_db_version" != "4"; then
25098       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
25099 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
25100    { (exit 1); exit 1; }; }
25101     fi
25102     ;;
25103   db48)
25104
25105   places="$check_places"
25106   if test -z "$places"; then
25107     places="std /usr/local/BerkeleyDB.4.8 /boot/home/config"
25108   fi
25109
25110   bdb_version="4"
25111   if test ""8"" != "-1"; then
25112     bdb_version="$bdb_version."8""
25113     if test ""-1"" != "-1"; then
25114       bdb_version="$bdb_version."-1""
25115     fi
25116   fi
25117   bdb_places="$places"
25118   bdb_default_search_headers="db48/db.h db4/db.h db.h"
25119   bdb_default_search_lib_names="db-4.8 db4-4.8 db48 db4 db"
25120
25121
25122   apu_have_db=0
25123
25124   # Save the original values of the flags we tweak.
25125   apu_check_lib_save_libs="$LIBS"
25126   apu_check_lib_save_ldflags="$LDFLAGS"
25127   apu_check_lib_save_cppflags="$CPPFLAGS"
25128
25129   # The variable `found' is the prefix under which we've found
25130   # Berkeley DB, or `not' if we haven't found it anywhere yet.
25131   found=not
25132   for bdb_place in $bdb_places; do
25133
25134     LDFLAGS="$apu_check_lib_save_ldflags"
25135     CPPFLAGS="$apu_check_lib_save_cppflags"
25136     case "$bdb_place" in
25137       "std" )
25138         description="the standard places"
25139       ;;
25140       *":"* )
25141         header="`echo $bdb_place | sed -e 's/:.*$//'`"
25142         lib="`echo $bdb_place | sed -e 's/^.*://'`"
25143         CPPFLAGS="$CPPFLAGS -I$header"
25144         LDFLAGS="$LDFLAGS -L$lib"
25145         description="$header and $lib"
25146       ;;
25147       * )
25148         if test -d $bdb_place; then
25149           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
25150           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
25151         else
25152           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
25153 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
25154           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
25155 $as_echo "directory not found" >&6; }
25156           continue
25157         fi
25158         description="$bdb_place"
25159       ;;
25160     esac
25161
25162     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
25163     # trick to display a message instead.
25164     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
25165 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
25166     { $as_echo "$as_me:$LINENO: result: " >&5
25167 $as_echo "" >&6; }
25168
25169     for bdb_libname in $bdb_default_search_lib_names; do
25170       for bdb_header in $bdb_default_search_headers; do
25171         # Clear the header cache variable for each location
25172
25173         cache_id="`echo ac_cv_header_${bdb_header} \
25174                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
25175
25176         unset $cache_id
25177         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
25178 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
25179   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
25180 $as_echo_n "checking for $bdb_header... " >&6; }
25181 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
25182   $as_echo_n "(cached) " >&6
25183 fi
25184 ac_res=`eval 'as_val=${'$as_ac_Header'}
25185                  $as_echo "$as_val"'`
25186                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
25187 $as_echo "$ac_res" >&6; }
25188 else
25189   # Is the header compilable?
25190 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
25191 $as_echo_n "checking $bdb_header usability... " >&6; }
25192 cat >conftest.$ac_ext <<_ACEOF
25193 /* confdefs.h.  */
25194 _ACEOF
25195 cat confdefs.h >>conftest.$ac_ext
25196 cat >>conftest.$ac_ext <<_ACEOF
25197 /* end confdefs.h.  */
25198 $ac_includes_default
25199 #include <$bdb_header>
25200 _ACEOF
25201 rm -f conftest.$ac_objext
25202 if { (ac_try="$ac_compile"
25203 case "(($ac_try" in
25204   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25205   *) ac_try_echo=$ac_try;;
25206 esac
25207 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25208 $as_echo "$ac_try_echo") >&5
25209   (eval "$ac_compile") 2>conftest.er1
25210   ac_status=$?
25211   grep -v '^ *+' conftest.er1 >conftest.err
25212   rm -f conftest.er1
25213   cat conftest.err >&5
25214   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25215   (exit $ac_status); } && {
25216          test -z "$ac_c_werror_flag" ||
25217          test ! -s conftest.err
25218        } && test -s conftest.$ac_objext; then
25219   ac_header_compiler=yes
25220 else
25221   $as_echo "$as_me: failed program was:" >&5
25222 sed 's/^/| /' conftest.$ac_ext >&5
25223
25224         ac_header_compiler=no
25225 fi
25226
25227 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25228 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
25229 $as_echo "$ac_header_compiler" >&6; }
25230
25231 # Is the header present?
25232 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
25233 $as_echo_n "checking $bdb_header presence... " >&6; }
25234 cat >conftest.$ac_ext <<_ACEOF
25235 /* confdefs.h.  */
25236 _ACEOF
25237 cat confdefs.h >>conftest.$ac_ext
25238 cat >>conftest.$ac_ext <<_ACEOF
25239 /* end confdefs.h.  */
25240 #include <$bdb_header>
25241 _ACEOF
25242 if { (ac_try="$ac_cpp conftest.$ac_ext"
25243 case "(($ac_try" in
25244   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25245   *) ac_try_echo=$ac_try;;
25246 esac
25247 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25248 $as_echo "$ac_try_echo") >&5
25249   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
25250   ac_status=$?
25251   grep -v '^ *+' conftest.er1 >conftest.err
25252   rm -f conftest.er1
25253   cat conftest.err >&5
25254   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25255   (exit $ac_status); } >/dev/null && {
25256          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
25257          test ! -s conftest.err
25258        }; then
25259   ac_header_preproc=yes
25260 else
25261   $as_echo "$as_me: failed program was:" >&5
25262 sed 's/^/| /' conftest.$ac_ext >&5
25263
25264   ac_header_preproc=no
25265 fi
25266
25267 rm -f conftest.err conftest.$ac_ext
25268 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
25269 $as_echo "$ac_header_preproc" >&6; }
25270
25271 # So?  What about this header?
25272 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
25273   yes:no: )
25274     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
25275 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
25276     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
25277 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
25278     ac_header_preproc=yes
25279     ;;
25280   no:yes:* )
25281     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
25282 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
25283     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
25284 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
25285     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
25286 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
25287     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
25288 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
25289     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
25290 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
25291     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
25292 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
25293
25294     ;;
25295 esac
25296 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
25297 $as_echo_n "checking for $bdb_header... " >&6; }
25298 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
25299   $as_echo_n "(cached) " >&6
25300 else
25301   eval "$as_ac_Header=\$ac_header_preproc"
25302 fi
25303 ac_res=`eval 'as_val=${'$as_ac_Header'}
25304                  $as_echo "$as_val"'`
25305                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
25306 $as_echo "$ac_res" >&6; }
25307
25308 fi
25309 as_val=`eval 'as_val=${'$as_ac_Header'}
25310                  $as_echo "$as_val"'`
25311    if test "x$as_val" = x""yes; then
25312
25313           if test ""4"" = "3" -o ""4"" = "4"; then
25314             # We generate a separate cache variable for each prefix and libname
25315             # we search under.  That way, we avoid caching information that
25316             # changes if the user runs `configure' with a different set of
25317             # switches.
25318
25319             cache_id="`echo apu_cv_check_berkeley_db_"4"_"8"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
25320                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
25321
25322
25323             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
25324 $as_echo_n "checking for -l$bdb_libname... " >&6; }
25325                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
25326   $as_echo_n "(cached) " >&6
25327 else
25328
25329
25330     apu_try_berkeley_db_save_libs="$LIBS"
25331
25332     apu_check_berkeley_db_major="4"
25333     apu_check_berkeley_db_minor="8"
25334     apu_check_berkeley_db_patch="-1"
25335     apu_try_berkeley_db_header=$bdb_header
25336     apu_try_berkeley_db_libname=$bdb_libname
25337
25338     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
25339     if test "$cross_compiling" = yes; then
25340   apu_try_berkeley_db=yes
25341
25342 else
25343   cat >conftest.$ac_ext <<_ACEOF
25344 /* confdefs.h.  */
25345 _ACEOF
25346 cat confdefs.h >>conftest.$ac_ext
25347 cat >>conftest.$ac_ext <<_ACEOF
25348 /* end confdefs.h.  */
25349
25350 #include <stdlib.h>
25351 #include <stdio.h>
25352 #include <$apu_try_berkeley_db_header>
25353 main ()
25354 {
25355   int major, minor, patch;
25356
25357   db_version(&major, &minor, &patch);
25358
25359   /* Sanity check: ensure that db.h constants actually match the db library */
25360   if (major != DB_VERSION_MAJOR
25361       || minor != DB_VERSION_MINOR
25362       || patch != DB_VERSION_PATCH)
25363     exit (1);
25364
25365   /* Run-time check:  ensure the library claims to be the correct version. */
25366
25367   if ($apu_check_berkeley_db_major != -1) {
25368     if (major < $apu_check_berkeley_db_major)
25369       exit (1);
25370     if (major > $apu_check_berkeley_db_major)
25371       exit (0);
25372   }
25373
25374   if ($apu_check_berkeley_db_minor != -1) {
25375     if (minor < $apu_check_berkeley_db_minor)
25376       exit (1);
25377     if (minor > $apu_check_berkeley_db_minor)
25378       exit (0);
25379   }
25380
25381   if ($apu_check_berkeley_db_patch == -1
25382       || patch >= $apu_check_berkeley_db_patch)
25383     exit (0);
25384   else
25385     exit (1);
25386 }
25387
25388 _ACEOF
25389 rm -f conftest$ac_exeext
25390 if { (ac_try="$ac_link"
25391 case "(($ac_try" in
25392   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25393   *) ac_try_echo=$ac_try;;
25394 esac
25395 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25396 $as_echo "$ac_try_echo") >&5
25397   (eval "$ac_link") 2>&5
25398   ac_status=$?
25399   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25400   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
25401   { (case "(($ac_try" in
25402   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25403   *) ac_try_echo=$ac_try;;
25404 esac
25405 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25406 $as_echo "$ac_try_echo") >&5
25407   (eval "$ac_try") 2>&5
25408   ac_status=$?
25409   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25410   (exit $ac_status); }; }; then
25411   apu_try_berkeley_db=yes
25412 else
25413   $as_echo "$as_me: program exited with status $ac_status" >&5
25414 $as_echo "$as_me: failed program was:" >&5
25415 sed 's/^/| /' conftest.$ac_ext >&5
25416
25417 ( exit $ac_status )
25418 apu_try_berkeley_db=no
25419 fi
25420 rm -rf conftest.dSYM
25421 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
25422 fi
25423
25424
25425
25426     LIBS="$apu_try_berkeley_db_save_libs"
25427
25428
25429                 eval "$cache_id=$apu_try_berkeley_db"
25430
25431 fi
25432
25433             result="`eval echo '$'$cache_id`"
25434             { $as_echo "$as_me:$LINENO: result: $result" >&5
25435 $as_echo "$result" >&6; }
25436           elif test ""4"" = "1"; then
25437             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
25438 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
25439 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
25440 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
25441   $as_echo_n "(cached) " >&6
25442 else
25443   ac_check_lib_save_LIBS=$LIBS
25444 LIBS="-l$bdb_libname  $LIBS"
25445 cat >conftest.$ac_ext <<_ACEOF
25446 /* confdefs.h.  */
25447 _ACEOF
25448 cat confdefs.h >>conftest.$ac_ext
25449 cat >>conftest.$ac_ext <<_ACEOF
25450 /* end confdefs.h.  */
25451
25452 /* Override any GCC internal prototype to avoid an error.
25453    Use char because int might match the return type of a GCC
25454    builtin and then its argument prototype would still apply.  */
25455 #ifdef __cplusplus
25456 extern "C"
25457 #endif
25458 char dbopen ();
25459 int
25460 main ()
25461 {
25462 return dbopen ();
25463   ;
25464   return 0;
25465 }
25466 _ACEOF
25467 rm -f conftest.$ac_objext conftest$ac_exeext
25468 if { (ac_try="$ac_link"
25469 case "(($ac_try" in
25470   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25471   *) ac_try_echo=$ac_try;;
25472 esac
25473 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25474 $as_echo "$ac_try_echo") >&5
25475   (eval "$ac_link") 2>conftest.er1
25476   ac_status=$?
25477   grep -v '^ *+' conftest.er1 >conftest.err
25478   rm -f conftest.er1
25479   cat conftest.err >&5
25480   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25481   (exit $ac_status); } && {
25482          test -z "$ac_c_werror_flag" ||
25483          test ! -s conftest.err
25484        } && test -s conftest$ac_exeext && {
25485          test "$cross_compiling" = yes ||
25486          $as_test_x conftest$ac_exeext
25487        }; then
25488   eval "$as_ac_Lib=yes"
25489 else
25490   $as_echo "$as_me: failed program was:" >&5
25491 sed 's/^/| /' conftest.$ac_ext >&5
25492
25493         eval "$as_ac_Lib=no"
25494 fi
25495
25496 rm -rf conftest.dSYM
25497 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
25498       conftest$ac_exeext conftest.$ac_ext
25499 LIBS=$ac_check_lib_save_LIBS
25500 fi
25501 ac_res=`eval 'as_val=${'$as_ac_Lib'}
25502                  $as_echo "$as_val"'`
25503                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
25504 $as_echo "$ac_res" >&6; }
25505 as_val=`eval 'as_val=${'$as_ac_Lib'}
25506                  $as_echo "$as_val"'`
25507    if test "x$as_val" = x""yes; then
25508   result=yes
25509 else
25510   result=no
25511
25512 fi
25513
25514           elif test ""4"" = "2"; then
25515             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
25516 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
25517 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
25518 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
25519   $as_echo_n "(cached) " >&6
25520 else
25521   ac_check_lib_save_LIBS=$LIBS
25522 LIBS="-l$bdb_libname  $LIBS"
25523 cat >conftest.$ac_ext <<_ACEOF
25524 /* confdefs.h.  */
25525 _ACEOF
25526 cat confdefs.h >>conftest.$ac_ext
25527 cat >>conftest.$ac_ext <<_ACEOF
25528 /* end confdefs.h.  */
25529
25530 /* Override any GCC internal prototype to avoid an error.
25531    Use char because int might match the return type of a GCC
25532    builtin and then its argument prototype would still apply.  */
25533 #ifdef __cplusplus
25534 extern "C"
25535 #endif
25536 char db_open ();
25537 int
25538 main ()
25539 {
25540 return db_open ();
25541   ;
25542   return 0;
25543 }
25544 _ACEOF
25545 rm -f conftest.$ac_objext conftest$ac_exeext
25546 if { (ac_try="$ac_link"
25547 case "(($ac_try" in
25548   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25549   *) ac_try_echo=$ac_try;;
25550 esac
25551 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25552 $as_echo "$ac_try_echo") >&5
25553   (eval "$ac_link") 2>conftest.er1
25554   ac_status=$?
25555   grep -v '^ *+' conftest.er1 >conftest.err
25556   rm -f conftest.er1
25557   cat conftest.err >&5
25558   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25559   (exit $ac_status); } && {
25560          test -z "$ac_c_werror_flag" ||
25561          test ! -s conftest.err
25562        } && test -s conftest$ac_exeext && {
25563          test "$cross_compiling" = yes ||
25564          $as_test_x conftest$ac_exeext
25565        }; then
25566   eval "$as_ac_Lib=yes"
25567 else
25568   $as_echo "$as_me: failed program was:" >&5
25569 sed 's/^/| /' conftest.$ac_ext >&5
25570
25571         eval "$as_ac_Lib=no"
25572 fi
25573
25574 rm -rf conftest.dSYM
25575 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
25576       conftest$ac_exeext conftest.$ac_ext
25577 LIBS=$ac_check_lib_save_LIBS
25578 fi
25579 ac_res=`eval 'as_val=${'$as_ac_Lib'}
25580                  $as_echo "$as_val"'`
25581                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
25582 $as_echo "$ac_res" >&6; }
25583 as_val=`eval 'as_val=${'$as_ac_Lib'}
25584                  $as_echo "$as_val"'`
25585    if test "x$as_val" = x""yes; then
25586   result=yes
25587 else
25588   result=no
25589
25590 fi
25591
25592           fi
25593
25594 else
25595   result="no"
25596 fi
25597
25598
25599
25600         # If we found it, no need to search any more.
25601         if test "$result" = "yes"; then
25602           found="$bdb_place"
25603           break
25604         fi
25605       done
25606       test "$found" != "not" && break
25607     done
25608     test "$found" != "not" && break
25609   done
25610
25611   # Restore the original values of the flags we tweak.
25612   LDFLAGS="$apu_check_lib_save_ldflags"
25613   CPPFLAGS="$apu_check_lib_save_cppflags"
25614
25615   case "$found" in
25616   "not")
25617     apu_have_db=0
25618     ;;
25619   "std")
25620     apu_db_header=$bdb_header
25621     apu_db_lib=$bdb_libname
25622     apu_have_db=1
25623     ;;
25624   *":"*)
25625     header="`echo $found | sed -e 's/:.*$//'`"
25626     lib="`echo $found | sed -e 's/^.*://'`"
25627
25628
25629   if test "x$APRUTIL_INCLUDES" = "x"; then
25630     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
25631     APRUTIL_INCLUDES="-I$header"
25632   else
25633     apr_addto_bugger="-I$header"
25634     for i in $apr_addto_bugger; do
25635       apr_addto_duplicate="0"
25636       for j in $APRUTIL_INCLUDES; do
25637         if test "x$i" = "x$j"; then
25638           apr_addto_duplicate="1"
25639           break
25640         fi
25641       done
25642       if test $apr_addto_duplicate = "0"; then
25643         echo "  adding \"$i\" to APRUTIL_INCLUDES"
25644         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
25645       fi
25646     done
25647   fi
25648
25649
25650   if test "x$APRUTIL_LDFLAGS" = "x"; then
25651     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
25652     APRUTIL_LDFLAGS="-L$lib"
25653   else
25654     apr_addto_bugger="-L$lib"
25655     for i in $apr_addto_bugger; do
25656       apr_addto_duplicate="0"
25657       for j in $APRUTIL_LDFLAGS; do
25658         if test "x$i" = "x$j"; then
25659           apr_addto_duplicate="1"
25660           break
25661         fi
25662       done
25663       if test $apr_addto_duplicate = "0"; then
25664         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
25665         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
25666       fi
25667     done
25668   fi
25669
25670     apu_db_header=$bdb_header
25671     apu_db_lib=$bdb_libname
25672     apu_have_db=1
25673     ;;
25674   *)
25675
25676   if test "x$APRUTIL_INCLUDES" = "x"; then
25677     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
25678     APRUTIL_INCLUDES="-I$found/include"
25679   else
25680     apr_addto_bugger="-I$found/include"
25681     for i in $apr_addto_bugger; do
25682       apr_addto_duplicate="0"
25683       for j in $APRUTIL_INCLUDES; do
25684         if test "x$i" = "x$j"; then
25685           apr_addto_duplicate="1"
25686           break
25687         fi
25688       done
25689       if test $apr_addto_duplicate = "0"; then
25690         echo "  adding \"$i\" to APRUTIL_INCLUDES"
25691         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
25692       fi
25693     done
25694   fi
25695
25696
25697   if test "x$APRUTIL_LDFLAGS" = "x"; then
25698     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
25699     APRUTIL_LDFLAGS="-L$found/lib"
25700   else
25701     apr_addto_bugger="-L$found/lib"
25702     for i in $apr_addto_bugger; do
25703       apr_addto_duplicate="0"
25704       for j in $APRUTIL_LDFLAGS; do
25705         if test "x$i" = "x$j"; then
25706           apr_addto_duplicate="1"
25707           break
25708         fi
25709       done
25710       if test $apr_addto_duplicate = "0"; then
25711         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
25712         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
25713       fi
25714     done
25715   fi
25716
25717     apu_db_header=$bdb_header
25718     apu_db_lib=$bdb_libname
25719     apu_have_db=1
25720     ;;
25721   esac
25722
25723   if test "$apu_have_db" = "1"; then
25724     apu_db_version=4
25725   fi
25726
25727     if test "$apu_db_version" != "4"; then
25728       { { $as_echo "$as_me:$LINENO: error: Berkeley db4 not found" >&5
25729 $as_echo "$as_me: error: Berkeley db4 not found" >&2;}
25730    { (exit 1); exit 1; }; }
25731     fi
25732     ;;
25733   default)
25734
25735   all_places="$check_places"
25736
25737
25738   places="$all_places"
25739   if test -z "$places"; then
25740     places="std /usr/local/BerkeleyDB.4.8 /boot/home/config"
25741   fi
25742
25743   bdb_version="4"
25744   if test ""8"" != "-1"; then
25745     bdb_version="$bdb_version."8""
25746     if test ""-1"" != "-1"; then
25747       bdb_version="$bdb_version."-1""
25748     fi
25749   fi
25750   bdb_places="$places"
25751   bdb_default_search_headers="db48/db.h db4/db.h db.h"
25752   bdb_default_search_lib_names="db-4.8 db4-4.8 db48 db4 db"
25753
25754
25755   apu_have_db=0
25756
25757   # Save the original values of the flags we tweak.
25758   apu_check_lib_save_libs="$LIBS"
25759   apu_check_lib_save_ldflags="$LDFLAGS"
25760   apu_check_lib_save_cppflags="$CPPFLAGS"
25761
25762   # The variable `found' is the prefix under which we've found
25763   # Berkeley DB, or `not' if we haven't found it anywhere yet.
25764   found=not
25765   for bdb_place in $bdb_places; do
25766
25767     LDFLAGS="$apu_check_lib_save_ldflags"
25768     CPPFLAGS="$apu_check_lib_save_cppflags"
25769     case "$bdb_place" in
25770       "std" )
25771         description="the standard places"
25772       ;;
25773       *":"* )
25774         header="`echo $bdb_place | sed -e 's/:.*$//'`"
25775         lib="`echo $bdb_place | sed -e 's/^.*://'`"
25776         CPPFLAGS="$CPPFLAGS -I$header"
25777         LDFLAGS="$LDFLAGS -L$lib"
25778         description="$header and $lib"
25779       ;;
25780       * )
25781         if test -d $bdb_place; then
25782           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
25783           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
25784         else
25785           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
25786 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
25787           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
25788 $as_echo "directory not found" >&6; }
25789           continue
25790         fi
25791         description="$bdb_place"
25792       ;;
25793     esac
25794
25795     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
25796     # trick to display a message instead.
25797     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
25798 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
25799     { $as_echo "$as_me:$LINENO: result: " >&5
25800 $as_echo "" >&6; }
25801
25802     for bdb_libname in $bdb_default_search_lib_names; do
25803       for bdb_header in $bdb_default_search_headers; do
25804         # Clear the header cache variable for each location
25805
25806         cache_id="`echo ac_cv_header_${bdb_header} \
25807                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
25808
25809         unset $cache_id
25810         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
25811 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
25812   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
25813 $as_echo_n "checking for $bdb_header... " >&6; }
25814 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
25815   $as_echo_n "(cached) " >&6
25816 fi
25817 ac_res=`eval 'as_val=${'$as_ac_Header'}
25818                  $as_echo "$as_val"'`
25819                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
25820 $as_echo "$ac_res" >&6; }
25821 else
25822   # Is the header compilable?
25823 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
25824 $as_echo_n "checking $bdb_header usability... " >&6; }
25825 cat >conftest.$ac_ext <<_ACEOF
25826 /* confdefs.h.  */
25827 _ACEOF
25828 cat confdefs.h >>conftest.$ac_ext
25829 cat >>conftest.$ac_ext <<_ACEOF
25830 /* end confdefs.h.  */
25831 $ac_includes_default
25832 #include <$bdb_header>
25833 _ACEOF
25834 rm -f conftest.$ac_objext
25835 if { (ac_try="$ac_compile"
25836 case "(($ac_try" in
25837   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25838   *) ac_try_echo=$ac_try;;
25839 esac
25840 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25841 $as_echo "$ac_try_echo") >&5
25842   (eval "$ac_compile") 2>conftest.er1
25843   ac_status=$?
25844   grep -v '^ *+' conftest.er1 >conftest.err
25845   rm -f conftest.er1
25846   cat conftest.err >&5
25847   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25848   (exit $ac_status); } && {
25849          test -z "$ac_c_werror_flag" ||
25850          test ! -s conftest.err
25851        } && test -s conftest.$ac_objext; then
25852   ac_header_compiler=yes
25853 else
25854   $as_echo "$as_me: failed program was:" >&5
25855 sed 's/^/| /' conftest.$ac_ext >&5
25856
25857         ac_header_compiler=no
25858 fi
25859
25860 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25861 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
25862 $as_echo "$ac_header_compiler" >&6; }
25863
25864 # Is the header present?
25865 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
25866 $as_echo_n "checking $bdb_header presence... " >&6; }
25867 cat >conftest.$ac_ext <<_ACEOF
25868 /* confdefs.h.  */
25869 _ACEOF
25870 cat confdefs.h >>conftest.$ac_ext
25871 cat >>conftest.$ac_ext <<_ACEOF
25872 /* end confdefs.h.  */
25873 #include <$bdb_header>
25874 _ACEOF
25875 if { (ac_try="$ac_cpp conftest.$ac_ext"
25876 case "(($ac_try" in
25877   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
25878   *) ac_try_echo=$ac_try;;
25879 esac
25880 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
25881 $as_echo "$ac_try_echo") >&5
25882   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
25883   ac_status=$?
25884   grep -v '^ *+' conftest.er1 >conftest.err
25885   rm -f conftest.er1
25886   cat conftest.err >&5
25887   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
25888   (exit $ac_status); } >/dev/null && {
25889          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
25890          test ! -s conftest.err
25891        }; then
25892   ac_header_preproc=yes
25893 else
25894   $as_echo "$as_me: failed program was:" >&5
25895 sed 's/^/| /' conftest.$ac_ext >&5
25896
25897   ac_header_preproc=no
25898 fi
25899
25900 rm -f conftest.err conftest.$ac_ext
25901 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
25902 $as_echo "$ac_header_preproc" >&6; }
25903
25904 # So?  What about this header?
25905 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
25906   yes:no: )
25907     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
25908 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
25909     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
25910 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
25911     ac_header_preproc=yes
25912     ;;
25913   no:yes:* )
25914     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
25915 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
25916     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
25917 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
25918     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
25919 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
25920     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
25921 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
25922     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
25923 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
25924     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
25925 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
25926
25927     ;;
25928 esac
25929 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
25930 $as_echo_n "checking for $bdb_header... " >&6; }
25931 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
25932   $as_echo_n "(cached) " >&6
25933 else
25934   eval "$as_ac_Header=\$ac_header_preproc"
25935 fi
25936 ac_res=`eval 'as_val=${'$as_ac_Header'}
25937                  $as_echo "$as_val"'`
25938                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
25939 $as_echo "$ac_res" >&6; }
25940
25941 fi
25942 as_val=`eval 'as_val=${'$as_ac_Header'}
25943                  $as_echo "$as_val"'`
25944    if test "x$as_val" = x""yes; then
25945
25946           if test ""4"" = "3" -o ""4"" = "4"; then
25947             # We generate a separate cache variable for each prefix and libname
25948             # we search under.  That way, we avoid caching information that
25949             # changes if the user runs `configure' with a different set of
25950             # switches.
25951
25952             cache_id="`echo apu_cv_check_berkeley_db_"4"_"8"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
25953                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
25954
25955
25956             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
25957 $as_echo_n "checking for -l$bdb_libname... " >&6; }
25958                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
25959   $as_echo_n "(cached) " >&6
25960 else
25961
25962
25963     apu_try_berkeley_db_save_libs="$LIBS"
25964
25965     apu_check_berkeley_db_major="4"
25966     apu_check_berkeley_db_minor="8"
25967     apu_check_berkeley_db_patch="-1"
25968     apu_try_berkeley_db_header=$bdb_header
25969     apu_try_berkeley_db_libname=$bdb_libname
25970
25971     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
25972     if test "$cross_compiling" = yes; then
25973   apu_try_berkeley_db=yes
25974
25975 else
25976   cat >conftest.$ac_ext <<_ACEOF
25977 /* confdefs.h.  */
25978 _ACEOF
25979 cat confdefs.h >>conftest.$ac_ext
25980 cat >>conftest.$ac_ext <<_ACEOF
25981 /* end confdefs.h.  */
25982
25983 #include <stdlib.h>
25984 #include <stdio.h>
25985 #include <$apu_try_berkeley_db_header>
25986 main ()
25987 {
25988   int major, minor, patch;
25989
25990   db_version(&major, &minor, &patch);
25991
25992   /* Sanity check: ensure that db.h constants actually match the db library */
25993   if (major != DB_VERSION_MAJOR
25994       || minor != DB_VERSION_MINOR
25995       || patch != DB_VERSION_PATCH)
25996     exit (1);
25997
25998   /* Run-time check:  ensure the library claims to be the correct version. */
25999
26000   if ($apu_check_berkeley_db_major != -1) {
26001     if (major < $apu_check_berkeley_db_major)
26002       exit (1);
26003     if (major > $apu_check_berkeley_db_major)
26004       exit (0);
26005   }
26006
26007   if ($apu_check_berkeley_db_minor != -1) {
26008     if (minor < $apu_check_berkeley_db_minor)
26009       exit (1);
26010     if (minor > $apu_check_berkeley_db_minor)
26011       exit (0);
26012   }
26013
26014   if ($apu_check_berkeley_db_patch == -1
26015       || patch >= $apu_check_berkeley_db_patch)
26016     exit (0);
26017   else
26018     exit (1);
26019 }
26020
26021 _ACEOF
26022 rm -f conftest$ac_exeext
26023 if { (ac_try="$ac_link"
26024 case "(($ac_try" in
26025   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26026   *) ac_try_echo=$ac_try;;
26027 esac
26028 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26029 $as_echo "$ac_try_echo") >&5
26030   (eval "$ac_link") 2>&5
26031   ac_status=$?
26032   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26033   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
26034   { (case "(($ac_try" in
26035   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26036   *) ac_try_echo=$ac_try;;
26037 esac
26038 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26039 $as_echo "$ac_try_echo") >&5
26040   (eval "$ac_try") 2>&5
26041   ac_status=$?
26042   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26043   (exit $ac_status); }; }; then
26044   apu_try_berkeley_db=yes
26045 else
26046   $as_echo "$as_me: program exited with status $ac_status" >&5
26047 $as_echo "$as_me: failed program was:" >&5
26048 sed 's/^/| /' conftest.$ac_ext >&5
26049
26050 ( exit $ac_status )
26051 apu_try_berkeley_db=no
26052 fi
26053 rm -rf conftest.dSYM
26054 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
26055 fi
26056
26057
26058
26059     LIBS="$apu_try_berkeley_db_save_libs"
26060
26061
26062                 eval "$cache_id=$apu_try_berkeley_db"
26063
26064 fi
26065
26066             result="`eval echo '$'$cache_id`"
26067             { $as_echo "$as_me:$LINENO: result: $result" >&5
26068 $as_echo "$result" >&6; }
26069           elif test ""4"" = "1"; then
26070             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
26071 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
26072 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
26073 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
26074   $as_echo_n "(cached) " >&6
26075 else
26076   ac_check_lib_save_LIBS=$LIBS
26077 LIBS="-l$bdb_libname  $LIBS"
26078 cat >conftest.$ac_ext <<_ACEOF
26079 /* confdefs.h.  */
26080 _ACEOF
26081 cat confdefs.h >>conftest.$ac_ext
26082 cat >>conftest.$ac_ext <<_ACEOF
26083 /* end confdefs.h.  */
26084
26085 /* Override any GCC internal prototype to avoid an error.
26086    Use char because int might match the return type of a GCC
26087    builtin and then its argument prototype would still apply.  */
26088 #ifdef __cplusplus
26089 extern "C"
26090 #endif
26091 char dbopen ();
26092 int
26093 main ()
26094 {
26095 return dbopen ();
26096   ;
26097   return 0;
26098 }
26099 _ACEOF
26100 rm -f conftest.$ac_objext conftest$ac_exeext
26101 if { (ac_try="$ac_link"
26102 case "(($ac_try" in
26103   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26104   *) ac_try_echo=$ac_try;;
26105 esac
26106 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26107 $as_echo "$ac_try_echo") >&5
26108   (eval "$ac_link") 2>conftest.er1
26109   ac_status=$?
26110   grep -v '^ *+' conftest.er1 >conftest.err
26111   rm -f conftest.er1
26112   cat conftest.err >&5
26113   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26114   (exit $ac_status); } && {
26115          test -z "$ac_c_werror_flag" ||
26116          test ! -s conftest.err
26117        } && test -s conftest$ac_exeext && {
26118          test "$cross_compiling" = yes ||
26119          $as_test_x conftest$ac_exeext
26120        }; then
26121   eval "$as_ac_Lib=yes"
26122 else
26123   $as_echo "$as_me: failed program was:" >&5
26124 sed 's/^/| /' conftest.$ac_ext >&5
26125
26126         eval "$as_ac_Lib=no"
26127 fi
26128
26129 rm -rf conftest.dSYM
26130 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
26131       conftest$ac_exeext conftest.$ac_ext
26132 LIBS=$ac_check_lib_save_LIBS
26133 fi
26134 ac_res=`eval 'as_val=${'$as_ac_Lib'}
26135                  $as_echo "$as_val"'`
26136                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
26137 $as_echo "$ac_res" >&6; }
26138 as_val=`eval 'as_val=${'$as_ac_Lib'}
26139                  $as_echo "$as_val"'`
26140    if test "x$as_val" = x""yes; then
26141   result=yes
26142 else
26143   result=no
26144
26145 fi
26146
26147           elif test ""4"" = "2"; then
26148             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
26149 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
26150 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
26151 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
26152   $as_echo_n "(cached) " >&6
26153 else
26154   ac_check_lib_save_LIBS=$LIBS
26155 LIBS="-l$bdb_libname  $LIBS"
26156 cat >conftest.$ac_ext <<_ACEOF
26157 /* confdefs.h.  */
26158 _ACEOF
26159 cat confdefs.h >>conftest.$ac_ext
26160 cat >>conftest.$ac_ext <<_ACEOF
26161 /* end confdefs.h.  */
26162
26163 /* Override any GCC internal prototype to avoid an error.
26164    Use char because int might match the return type of a GCC
26165    builtin and then its argument prototype would still apply.  */
26166 #ifdef __cplusplus
26167 extern "C"
26168 #endif
26169 char db_open ();
26170 int
26171 main ()
26172 {
26173 return db_open ();
26174   ;
26175   return 0;
26176 }
26177 _ACEOF
26178 rm -f conftest.$ac_objext conftest$ac_exeext
26179 if { (ac_try="$ac_link"
26180 case "(($ac_try" in
26181   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26182   *) ac_try_echo=$ac_try;;
26183 esac
26184 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26185 $as_echo "$ac_try_echo") >&5
26186   (eval "$ac_link") 2>conftest.er1
26187   ac_status=$?
26188   grep -v '^ *+' conftest.er1 >conftest.err
26189   rm -f conftest.er1
26190   cat conftest.err >&5
26191   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26192   (exit $ac_status); } && {
26193          test -z "$ac_c_werror_flag" ||
26194          test ! -s conftest.err
26195        } && test -s conftest$ac_exeext && {
26196          test "$cross_compiling" = yes ||
26197          $as_test_x conftest$ac_exeext
26198        }; then
26199   eval "$as_ac_Lib=yes"
26200 else
26201   $as_echo "$as_me: failed program was:" >&5
26202 sed 's/^/| /' conftest.$ac_ext >&5
26203
26204         eval "$as_ac_Lib=no"
26205 fi
26206
26207 rm -rf conftest.dSYM
26208 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
26209       conftest$ac_exeext conftest.$ac_ext
26210 LIBS=$ac_check_lib_save_LIBS
26211 fi
26212 ac_res=`eval 'as_val=${'$as_ac_Lib'}
26213                  $as_echo "$as_val"'`
26214                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
26215 $as_echo "$ac_res" >&6; }
26216 as_val=`eval 'as_val=${'$as_ac_Lib'}
26217                  $as_echo "$as_val"'`
26218    if test "x$as_val" = x""yes; then
26219   result=yes
26220 else
26221   result=no
26222
26223 fi
26224
26225           fi
26226
26227 else
26228   result="no"
26229 fi
26230
26231
26232
26233         # If we found it, no need to search any more.
26234         if test "$result" = "yes"; then
26235           found="$bdb_place"
26236           break
26237         fi
26238       done
26239       test "$found" != "not" && break
26240     done
26241     test "$found" != "not" && break
26242   done
26243
26244   # Restore the original values of the flags we tweak.
26245   LDFLAGS="$apu_check_lib_save_ldflags"
26246   CPPFLAGS="$apu_check_lib_save_cppflags"
26247
26248   case "$found" in
26249   "not")
26250     apu_have_db=0
26251     ;;
26252   "std")
26253     apu_db_header=$bdb_header
26254     apu_db_lib=$bdb_libname
26255     apu_have_db=1
26256     ;;
26257   *":"*)
26258     header="`echo $found | sed -e 's/:.*$//'`"
26259     lib="`echo $found | sed -e 's/^.*://'`"
26260
26261
26262   if test "x$APRUTIL_INCLUDES" = "x"; then
26263     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
26264     APRUTIL_INCLUDES="-I$header"
26265   else
26266     apr_addto_bugger="-I$header"
26267     for i in $apr_addto_bugger; do
26268       apr_addto_duplicate="0"
26269       for j in $APRUTIL_INCLUDES; do
26270         if test "x$i" = "x$j"; then
26271           apr_addto_duplicate="1"
26272           break
26273         fi
26274       done
26275       if test $apr_addto_duplicate = "0"; then
26276         echo "  adding \"$i\" to APRUTIL_INCLUDES"
26277         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
26278       fi
26279     done
26280   fi
26281
26282
26283   if test "x$APRUTIL_LDFLAGS" = "x"; then
26284     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
26285     APRUTIL_LDFLAGS="-L$lib"
26286   else
26287     apr_addto_bugger="-L$lib"
26288     for i in $apr_addto_bugger; do
26289       apr_addto_duplicate="0"
26290       for j in $APRUTIL_LDFLAGS; do
26291         if test "x$i" = "x$j"; then
26292           apr_addto_duplicate="1"
26293           break
26294         fi
26295       done
26296       if test $apr_addto_duplicate = "0"; then
26297         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
26298         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
26299       fi
26300     done
26301   fi
26302
26303     apu_db_header=$bdb_header
26304     apu_db_lib=$bdb_libname
26305     apu_have_db=1
26306     ;;
26307   *)
26308
26309   if test "x$APRUTIL_INCLUDES" = "x"; then
26310     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
26311     APRUTIL_INCLUDES="-I$found/include"
26312   else
26313     apr_addto_bugger="-I$found/include"
26314     for i in $apr_addto_bugger; do
26315       apr_addto_duplicate="0"
26316       for j in $APRUTIL_INCLUDES; do
26317         if test "x$i" = "x$j"; then
26318           apr_addto_duplicate="1"
26319           break
26320         fi
26321       done
26322       if test $apr_addto_duplicate = "0"; then
26323         echo "  adding \"$i\" to APRUTIL_INCLUDES"
26324         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
26325       fi
26326     done
26327   fi
26328
26329
26330   if test "x$APRUTIL_LDFLAGS" = "x"; then
26331     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
26332     APRUTIL_LDFLAGS="-L$found/lib"
26333   else
26334     apr_addto_bugger="-L$found/lib"
26335     for i in $apr_addto_bugger; do
26336       apr_addto_duplicate="0"
26337       for j in $APRUTIL_LDFLAGS; do
26338         if test "x$i" = "x$j"; then
26339           apr_addto_duplicate="1"
26340           break
26341         fi
26342       done
26343       if test $apr_addto_duplicate = "0"; then
26344         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
26345         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
26346       fi
26347     done
26348   fi
26349
26350     apu_db_header=$bdb_header
26351     apu_db_lib=$bdb_libname
26352     apu_have_db=1
26353     ;;
26354   esac
26355
26356   if test "$apu_have_db" = "1"; then
26357     apu_db_version=4
26358   fi
26359
26360   if test "$apu_db_version" != "4"; then
26361
26362   places="$all_places"
26363   if test -z "$places"; then
26364     places="std /usr/local/BerkeleyDB.4.7 /boot/home/config"
26365   fi
26366
26367   bdb_version="4"
26368   if test ""7"" != "-1"; then
26369     bdb_version="$bdb_version."7""
26370     if test ""-1"" != "-1"; then
26371       bdb_version="$bdb_version."-1""
26372     fi
26373   fi
26374   bdb_places="$places"
26375   bdb_default_search_headers="db47/db.h db4/db.h db.h"
26376   bdb_default_search_lib_names="db-4.7 db4-4.7 db47 db4 db"
26377
26378
26379   apu_have_db=0
26380
26381   # Save the original values of the flags we tweak.
26382   apu_check_lib_save_libs="$LIBS"
26383   apu_check_lib_save_ldflags="$LDFLAGS"
26384   apu_check_lib_save_cppflags="$CPPFLAGS"
26385
26386   # The variable `found' is the prefix under which we've found
26387   # Berkeley DB, or `not' if we haven't found it anywhere yet.
26388   found=not
26389   for bdb_place in $bdb_places; do
26390
26391     LDFLAGS="$apu_check_lib_save_ldflags"
26392     CPPFLAGS="$apu_check_lib_save_cppflags"
26393     case "$bdb_place" in
26394       "std" )
26395         description="the standard places"
26396       ;;
26397       *":"* )
26398         header="`echo $bdb_place | sed -e 's/:.*$//'`"
26399         lib="`echo $bdb_place | sed -e 's/^.*://'`"
26400         CPPFLAGS="$CPPFLAGS -I$header"
26401         LDFLAGS="$LDFLAGS -L$lib"
26402         description="$header and $lib"
26403       ;;
26404       * )
26405         if test -d $bdb_place; then
26406           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
26407           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
26408         else
26409           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
26410 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
26411           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
26412 $as_echo "directory not found" >&6; }
26413           continue
26414         fi
26415         description="$bdb_place"
26416       ;;
26417     esac
26418
26419     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
26420     # trick to display a message instead.
26421     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
26422 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
26423     { $as_echo "$as_me:$LINENO: result: " >&5
26424 $as_echo "" >&6; }
26425
26426     for bdb_libname in $bdb_default_search_lib_names; do
26427       for bdb_header in $bdb_default_search_headers; do
26428         # Clear the header cache variable for each location
26429
26430         cache_id="`echo ac_cv_header_${bdb_header} \
26431                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
26432
26433         unset $cache_id
26434         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
26435 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
26436   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
26437 $as_echo_n "checking for $bdb_header... " >&6; }
26438 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
26439   $as_echo_n "(cached) " >&6
26440 fi
26441 ac_res=`eval 'as_val=${'$as_ac_Header'}
26442                  $as_echo "$as_val"'`
26443                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
26444 $as_echo "$ac_res" >&6; }
26445 else
26446   # Is the header compilable?
26447 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
26448 $as_echo_n "checking $bdb_header usability... " >&6; }
26449 cat >conftest.$ac_ext <<_ACEOF
26450 /* confdefs.h.  */
26451 _ACEOF
26452 cat confdefs.h >>conftest.$ac_ext
26453 cat >>conftest.$ac_ext <<_ACEOF
26454 /* end confdefs.h.  */
26455 $ac_includes_default
26456 #include <$bdb_header>
26457 _ACEOF
26458 rm -f conftest.$ac_objext
26459 if { (ac_try="$ac_compile"
26460 case "(($ac_try" in
26461   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26462   *) ac_try_echo=$ac_try;;
26463 esac
26464 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26465 $as_echo "$ac_try_echo") >&5
26466   (eval "$ac_compile") 2>conftest.er1
26467   ac_status=$?
26468   grep -v '^ *+' conftest.er1 >conftest.err
26469   rm -f conftest.er1
26470   cat conftest.err >&5
26471   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26472   (exit $ac_status); } && {
26473          test -z "$ac_c_werror_flag" ||
26474          test ! -s conftest.err
26475        } && test -s conftest.$ac_objext; then
26476   ac_header_compiler=yes
26477 else
26478   $as_echo "$as_me: failed program was:" >&5
26479 sed 's/^/| /' conftest.$ac_ext >&5
26480
26481         ac_header_compiler=no
26482 fi
26483
26484 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26485 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
26486 $as_echo "$ac_header_compiler" >&6; }
26487
26488 # Is the header present?
26489 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
26490 $as_echo_n "checking $bdb_header presence... " >&6; }
26491 cat >conftest.$ac_ext <<_ACEOF
26492 /* confdefs.h.  */
26493 _ACEOF
26494 cat confdefs.h >>conftest.$ac_ext
26495 cat >>conftest.$ac_ext <<_ACEOF
26496 /* end confdefs.h.  */
26497 #include <$bdb_header>
26498 _ACEOF
26499 if { (ac_try="$ac_cpp conftest.$ac_ext"
26500 case "(($ac_try" in
26501   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26502   *) ac_try_echo=$ac_try;;
26503 esac
26504 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26505 $as_echo "$ac_try_echo") >&5
26506   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
26507   ac_status=$?
26508   grep -v '^ *+' conftest.er1 >conftest.err
26509   rm -f conftest.er1
26510   cat conftest.err >&5
26511   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26512   (exit $ac_status); } >/dev/null && {
26513          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
26514          test ! -s conftest.err
26515        }; then
26516   ac_header_preproc=yes
26517 else
26518   $as_echo "$as_me: failed program was:" >&5
26519 sed 's/^/| /' conftest.$ac_ext >&5
26520
26521   ac_header_preproc=no
26522 fi
26523
26524 rm -f conftest.err conftest.$ac_ext
26525 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
26526 $as_echo "$ac_header_preproc" >&6; }
26527
26528 # So?  What about this header?
26529 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
26530   yes:no: )
26531     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
26532 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
26533     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
26534 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
26535     ac_header_preproc=yes
26536     ;;
26537   no:yes:* )
26538     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
26539 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
26540     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
26541 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
26542     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
26543 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
26544     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
26545 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
26546     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
26547 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
26548     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
26549 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
26550
26551     ;;
26552 esac
26553 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
26554 $as_echo_n "checking for $bdb_header... " >&6; }
26555 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
26556   $as_echo_n "(cached) " >&6
26557 else
26558   eval "$as_ac_Header=\$ac_header_preproc"
26559 fi
26560 ac_res=`eval 'as_val=${'$as_ac_Header'}
26561                  $as_echo "$as_val"'`
26562                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
26563 $as_echo "$ac_res" >&6; }
26564
26565 fi
26566 as_val=`eval 'as_val=${'$as_ac_Header'}
26567                  $as_echo "$as_val"'`
26568    if test "x$as_val" = x""yes; then
26569
26570           if test ""4"" = "3" -o ""4"" = "4"; then
26571             # We generate a separate cache variable for each prefix and libname
26572             # we search under.  That way, we avoid caching information that
26573             # changes if the user runs `configure' with a different set of
26574             # switches.
26575
26576             cache_id="`echo apu_cv_check_berkeley_db_"4"_"7"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
26577                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
26578
26579
26580             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
26581 $as_echo_n "checking for -l$bdb_libname... " >&6; }
26582                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
26583   $as_echo_n "(cached) " >&6
26584 else
26585
26586
26587     apu_try_berkeley_db_save_libs="$LIBS"
26588
26589     apu_check_berkeley_db_major="4"
26590     apu_check_berkeley_db_minor="7"
26591     apu_check_berkeley_db_patch="-1"
26592     apu_try_berkeley_db_header=$bdb_header
26593     apu_try_berkeley_db_libname=$bdb_libname
26594
26595     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
26596     if test "$cross_compiling" = yes; then
26597   apu_try_berkeley_db=yes
26598
26599 else
26600   cat >conftest.$ac_ext <<_ACEOF
26601 /* confdefs.h.  */
26602 _ACEOF
26603 cat confdefs.h >>conftest.$ac_ext
26604 cat >>conftest.$ac_ext <<_ACEOF
26605 /* end confdefs.h.  */
26606
26607 #include <stdlib.h>
26608 #include <stdio.h>
26609 #include <$apu_try_berkeley_db_header>
26610 main ()
26611 {
26612   int major, minor, patch;
26613
26614   db_version(&major, &minor, &patch);
26615
26616   /* Sanity check: ensure that db.h constants actually match the db library */
26617   if (major != DB_VERSION_MAJOR
26618       || minor != DB_VERSION_MINOR
26619       || patch != DB_VERSION_PATCH)
26620     exit (1);
26621
26622   /* Run-time check:  ensure the library claims to be the correct version. */
26623
26624   if ($apu_check_berkeley_db_major != -1) {
26625     if (major < $apu_check_berkeley_db_major)
26626       exit (1);
26627     if (major > $apu_check_berkeley_db_major)
26628       exit (0);
26629   }
26630
26631   if ($apu_check_berkeley_db_minor != -1) {
26632     if (minor < $apu_check_berkeley_db_minor)
26633       exit (1);
26634     if (minor > $apu_check_berkeley_db_minor)
26635       exit (0);
26636   }
26637
26638   if ($apu_check_berkeley_db_patch == -1
26639       || patch >= $apu_check_berkeley_db_patch)
26640     exit (0);
26641   else
26642     exit (1);
26643 }
26644
26645 _ACEOF
26646 rm -f conftest$ac_exeext
26647 if { (ac_try="$ac_link"
26648 case "(($ac_try" in
26649   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26650   *) ac_try_echo=$ac_try;;
26651 esac
26652 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26653 $as_echo "$ac_try_echo") >&5
26654   (eval "$ac_link") 2>&5
26655   ac_status=$?
26656   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26657   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
26658   { (case "(($ac_try" in
26659   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26660   *) ac_try_echo=$ac_try;;
26661 esac
26662 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26663 $as_echo "$ac_try_echo") >&5
26664   (eval "$ac_try") 2>&5
26665   ac_status=$?
26666   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26667   (exit $ac_status); }; }; then
26668   apu_try_berkeley_db=yes
26669 else
26670   $as_echo "$as_me: program exited with status $ac_status" >&5
26671 $as_echo "$as_me: failed program was:" >&5
26672 sed 's/^/| /' conftest.$ac_ext >&5
26673
26674 ( exit $ac_status )
26675 apu_try_berkeley_db=no
26676 fi
26677 rm -rf conftest.dSYM
26678 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
26679 fi
26680
26681
26682
26683     LIBS="$apu_try_berkeley_db_save_libs"
26684
26685
26686                 eval "$cache_id=$apu_try_berkeley_db"
26687
26688 fi
26689
26690             result="`eval echo '$'$cache_id`"
26691             { $as_echo "$as_me:$LINENO: result: $result" >&5
26692 $as_echo "$result" >&6; }
26693           elif test ""4"" = "1"; then
26694             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
26695 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
26696 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
26697 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
26698   $as_echo_n "(cached) " >&6
26699 else
26700   ac_check_lib_save_LIBS=$LIBS
26701 LIBS="-l$bdb_libname  $LIBS"
26702 cat >conftest.$ac_ext <<_ACEOF
26703 /* confdefs.h.  */
26704 _ACEOF
26705 cat confdefs.h >>conftest.$ac_ext
26706 cat >>conftest.$ac_ext <<_ACEOF
26707 /* end confdefs.h.  */
26708
26709 /* Override any GCC internal prototype to avoid an error.
26710    Use char because int might match the return type of a GCC
26711    builtin and then its argument prototype would still apply.  */
26712 #ifdef __cplusplus
26713 extern "C"
26714 #endif
26715 char dbopen ();
26716 int
26717 main ()
26718 {
26719 return dbopen ();
26720   ;
26721   return 0;
26722 }
26723 _ACEOF
26724 rm -f conftest.$ac_objext conftest$ac_exeext
26725 if { (ac_try="$ac_link"
26726 case "(($ac_try" in
26727   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26728   *) ac_try_echo=$ac_try;;
26729 esac
26730 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26731 $as_echo "$ac_try_echo") >&5
26732   (eval "$ac_link") 2>conftest.er1
26733   ac_status=$?
26734   grep -v '^ *+' conftest.er1 >conftest.err
26735   rm -f conftest.er1
26736   cat conftest.err >&5
26737   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26738   (exit $ac_status); } && {
26739          test -z "$ac_c_werror_flag" ||
26740          test ! -s conftest.err
26741        } && test -s conftest$ac_exeext && {
26742          test "$cross_compiling" = yes ||
26743          $as_test_x conftest$ac_exeext
26744        }; then
26745   eval "$as_ac_Lib=yes"
26746 else
26747   $as_echo "$as_me: failed program was:" >&5
26748 sed 's/^/| /' conftest.$ac_ext >&5
26749
26750         eval "$as_ac_Lib=no"
26751 fi
26752
26753 rm -rf conftest.dSYM
26754 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
26755       conftest$ac_exeext conftest.$ac_ext
26756 LIBS=$ac_check_lib_save_LIBS
26757 fi
26758 ac_res=`eval 'as_val=${'$as_ac_Lib'}
26759                  $as_echo "$as_val"'`
26760                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
26761 $as_echo "$ac_res" >&6; }
26762 as_val=`eval 'as_val=${'$as_ac_Lib'}
26763                  $as_echo "$as_val"'`
26764    if test "x$as_val" = x""yes; then
26765   result=yes
26766 else
26767   result=no
26768
26769 fi
26770
26771           elif test ""4"" = "2"; then
26772             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
26773 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
26774 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
26775 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
26776   $as_echo_n "(cached) " >&6
26777 else
26778   ac_check_lib_save_LIBS=$LIBS
26779 LIBS="-l$bdb_libname  $LIBS"
26780 cat >conftest.$ac_ext <<_ACEOF
26781 /* confdefs.h.  */
26782 _ACEOF
26783 cat confdefs.h >>conftest.$ac_ext
26784 cat >>conftest.$ac_ext <<_ACEOF
26785 /* end confdefs.h.  */
26786
26787 /* Override any GCC internal prototype to avoid an error.
26788    Use char because int might match the return type of a GCC
26789    builtin and then its argument prototype would still apply.  */
26790 #ifdef __cplusplus
26791 extern "C"
26792 #endif
26793 char db_open ();
26794 int
26795 main ()
26796 {
26797 return db_open ();
26798   ;
26799   return 0;
26800 }
26801 _ACEOF
26802 rm -f conftest.$ac_objext conftest$ac_exeext
26803 if { (ac_try="$ac_link"
26804 case "(($ac_try" in
26805   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
26806   *) ac_try_echo=$ac_try;;
26807 esac
26808 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
26809 $as_echo "$ac_try_echo") >&5
26810   (eval "$ac_link") 2>conftest.er1
26811   ac_status=$?
26812   grep -v '^ *+' conftest.er1 >conftest.err
26813   rm -f conftest.er1
26814   cat conftest.err >&5
26815   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
26816   (exit $ac_status); } && {
26817          test -z "$ac_c_werror_flag" ||
26818          test ! -s conftest.err
26819        } && test -s conftest$ac_exeext && {
26820          test "$cross_compiling" = yes ||
26821          $as_test_x conftest$ac_exeext
26822        }; then
26823   eval "$as_ac_Lib=yes"
26824 else
26825   $as_echo "$as_me: failed program was:" >&5
26826 sed 's/^/| /' conftest.$ac_ext >&5
26827
26828         eval "$as_ac_Lib=no"
26829 fi
26830
26831 rm -rf conftest.dSYM
26832 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
26833       conftest$ac_exeext conftest.$ac_ext
26834 LIBS=$ac_check_lib_save_LIBS
26835 fi
26836 ac_res=`eval 'as_val=${'$as_ac_Lib'}
26837                  $as_echo "$as_val"'`
26838                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
26839 $as_echo "$ac_res" >&6; }
26840 as_val=`eval 'as_val=${'$as_ac_Lib'}
26841                  $as_echo "$as_val"'`
26842    if test "x$as_val" = x""yes; then
26843   result=yes
26844 else
26845   result=no
26846
26847 fi
26848
26849           fi
26850
26851 else
26852   result="no"
26853 fi
26854
26855
26856
26857         # If we found it, no need to search any more.
26858         if test "$result" = "yes"; then
26859           found="$bdb_place"
26860           break
26861         fi
26862       done
26863       test "$found" != "not" && break
26864     done
26865     test "$found" != "not" && break
26866   done
26867
26868   # Restore the original values of the flags we tweak.
26869   LDFLAGS="$apu_check_lib_save_ldflags"
26870   CPPFLAGS="$apu_check_lib_save_cppflags"
26871
26872   case "$found" in
26873   "not")
26874     apu_have_db=0
26875     ;;
26876   "std")
26877     apu_db_header=$bdb_header
26878     apu_db_lib=$bdb_libname
26879     apu_have_db=1
26880     ;;
26881   *":"*)
26882     header="`echo $found | sed -e 's/:.*$//'`"
26883     lib="`echo $found | sed -e 's/^.*://'`"
26884
26885
26886   if test "x$APRUTIL_INCLUDES" = "x"; then
26887     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
26888     APRUTIL_INCLUDES="-I$header"
26889   else
26890     apr_addto_bugger="-I$header"
26891     for i in $apr_addto_bugger; do
26892       apr_addto_duplicate="0"
26893       for j in $APRUTIL_INCLUDES; do
26894         if test "x$i" = "x$j"; then
26895           apr_addto_duplicate="1"
26896           break
26897         fi
26898       done
26899       if test $apr_addto_duplicate = "0"; then
26900         echo "  adding \"$i\" to APRUTIL_INCLUDES"
26901         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
26902       fi
26903     done
26904   fi
26905
26906
26907   if test "x$APRUTIL_LDFLAGS" = "x"; then
26908     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
26909     APRUTIL_LDFLAGS="-L$lib"
26910   else
26911     apr_addto_bugger="-L$lib"
26912     for i in $apr_addto_bugger; do
26913       apr_addto_duplicate="0"
26914       for j in $APRUTIL_LDFLAGS; do
26915         if test "x$i" = "x$j"; then
26916           apr_addto_duplicate="1"
26917           break
26918         fi
26919       done
26920       if test $apr_addto_duplicate = "0"; then
26921         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
26922         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
26923       fi
26924     done
26925   fi
26926
26927     apu_db_header=$bdb_header
26928     apu_db_lib=$bdb_libname
26929     apu_have_db=1
26930     ;;
26931   *)
26932
26933   if test "x$APRUTIL_INCLUDES" = "x"; then
26934     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
26935     APRUTIL_INCLUDES="-I$found/include"
26936   else
26937     apr_addto_bugger="-I$found/include"
26938     for i in $apr_addto_bugger; do
26939       apr_addto_duplicate="0"
26940       for j in $APRUTIL_INCLUDES; do
26941         if test "x$i" = "x$j"; then
26942           apr_addto_duplicate="1"
26943           break
26944         fi
26945       done
26946       if test $apr_addto_duplicate = "0"; then
26947         echo "  adding \"$i\" to APRUTIL_INCLUDES"
26948         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
26949       fi
26950     done
26951   fi
26952
26953
26954   if test "x$APRUTIL_LDFLAGS" = "x"; then
26955     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
26956     APRUTIL_LDFLAGS="-L$found/lib"
26957   else
26958     apr_addto_bugger="-L$found/lib"
26959     for i in $apr_addto_bugger; do
26960       apr_addto_duplicate="0"
26961       for j in $APRUTIL_LDFLAGS; do
26962         if test "x$i" = "x$j"; then
26963           apr_addto_duplicate="1"
26964           break
26965         fi
26966       done
26967       if test $apr_addto_duplicate = "0"; then
26968         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
26969         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
26970       fi
26971     done
26972   fi
26973
26974     apu_db_header=$bdb_header
26975     apu_db_lib=$bdb_libname
26976     apu_have_db=1
26977     ;;
26978   esac
26979
26980   if test "$apu_have_db" = "1"; then
26981     apu_db_version=4
26982   fi
26983
26984     if test "$apu_db_version" != "4"; then
26985
26986   places="$all_places"
26987   if test -z "$places"; then
26988     places="std /usr/local/BerkeleyDB.4.6 /boot/home/config"
26989   fi
26990
26991   bdb_version="4"
26992   if test ""6"" != "-1"; then
26993     bdb_version="$bdb_version."6""
26994     if test ""-1"" != "-1"; then
26995       bdb_version="$bdb_version."-1""
26996     fi
26997   fi
26998   bdb_places="$places"
26999   bdb_default_search_headers="db46/db.h db4/db.h db.h"
27000   bdb_default_search_lib_names="db-4.6 db4-4.6 db46 db4 db"
27001
27002
27003   apu_have_db=0
27004
27005   # Save the original values of the flags we tweak.
27006   apu_check_lib_save_libs="$LIBS"
27007   apu_check_lib_save_ldflags="$LDFLAGS"
27008   apu_check_lib_save_cppflags="$CPPFLAGS"
27009
27010   # The variable `found' is the prefix under which we've found
27011   # Berkeley DB, or `not' if we haven't found it anywhere yet.
27012   found=not
27013   for bdb_place in $bdb_places; do
27014
27015     LDFLAGS="$apu_check_lib_save_ldflags"
27016     CPPFLAGS="$apu_check_lib_save_cppflags"
27017     case "$bdb_place" in
27018       "std" )
27019         description="the standard places"
27020       ;;
27021       *":"* )
27022         header="`echo $bdb_place | sed -e 's/:.*$//'`"
27023         lib="`echo $bdb_place | sed -e 's/^.*://'`"
27024         CPPFLAGS="$CPPFLAGS -I$header"
27025         LDFLAGS="$LDFLAGS -L$lib"
27026         description="$header and $lib"
27027       ;;
27028       * )
27029         if test -d $bdb_place; then
27030           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
27031           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
27032         else
27033           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
27034 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
27035           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
27036 $as_echo "directory not found" >&6; }
27037           continue
27038         fi
27039         description="$bdb_place"
27040       ;;
27041     esac
27042
27043     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
27044     # trick to display a message instead.
27045     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
27046 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
27047     { $as_echo "$as_me:$LINENO: result: " >&5
27048 $as_echo "" >&6; }
27049
27050     for bdb_libname in $bdb_default_search_lib_names; do
27051       for bdb_header in $bdb_default_search_headers; do
27052         # Clear the header cache variable for each location
27053
27054         cache_id="`echo ac_cv_header_${bdb_header} \
27055                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
27056
27057         unset $cache_id
27058         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
27059 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
27060   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
27061 $as_echo_n "checking for $bdb_header... " >&6; }
27062 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
27063   $as_echo_n "(cached) " >&6
27064 fi
27065 ac_res=`eval 'as_val=${'$as_ac_Header'}
27066                  $as_echo "$as_val"'`
27067                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
27068 $as_echo "$ac_res" >&6; }
27069 else
27070   # Is the header compilable?
27071 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
27072 $as_echo_n "checking $bdb_header usability... " >&6; }
27073 cat >conftest.$ac_ext <<_ACEOF
27074 /* confdefs.h.  */
27075 _ACEOF
27076 cat confdefs.h >>conftest.$ac_ext
27077 cat >>conftest.$ac_ext <<_ACEOF
27078 /* end confdefs.h.  */
27079 $ac_includes_default
27080 #include <$bdb_header>
27081 _ACEOF
27082 rm -f conftest.$ac_objext
27083 if { (ac_try="$ac_compile"
27084 case "(($ac_try" in
27085   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27086   *) ac_try_echo=$ac_try;;
27087 esac
27088 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27089 $as_echo "$ac_try_echo") >&5
27090   (eval "$ac_compile") 2>conftest.er1
27091   ac_status=$?
27092   grep -v '^ *+' conftest.er1 >conftest.err
27093   rm -f conftest.er1
27094   cat conftest.err >&5
27095   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27096   (exit $ac_status); } && {
27097          test -z "$ac_c_werror_flag" ||
27098          test ! -s conftest.err
27099        } && test -s conftest.$ac_objext; then
27100   ac_header_compiler=yes
27101 else
27102   $as_echo "$as_me: failed program was:" >&5
27103 sed 's/^/| /' conftest.$ac_ext >&5
27104
27105         ac_header_compiler=no
27106 fi
27107
27108 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27109 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
27110 $as_echo "$ac_header_compiler" >&6; }
27111
27112 # Is the header present?
27113 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
27114 $as_echo_n "checking $bdb_header presence... " >&6; }
27115 cat >conftest.$ac_ext <<_ACEOF
27116 /* confdefs.h.  */
27117 _ACEOF
27118 cat confdefs.h >>conftest.$ac_ext
27119 cat >>conftest.$ac_ext <<_ACEOF
27120 /* end confdefs.h.  */
27121 #include <$bdb_header>
27122 _ACEOF
27123 if { (ac_try="$ac_cpp conftest.$ac_ext"
27124 case "(($ac_try" in
27125   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27126   *) ac_try_echo=$ac_try;;
27127 esac
27128 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27129 $as_echo "$ac_try_echo") >&5
27130   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
27131   ac_status=$?
27132   grep -v '^ *+' conftest.er1 >conftest.err
27133   rm -f conftest.er1
27134   cat conftest.err >&5
27135   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27136   (exit $ac_status); } >/dev/null && {
27137          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
27138          test ! -s conftest.err
27139        }; then
27140   ac_header_preproc=yes
27141 else
27142   $as_echo "$as_me: failed program was:" >&5
27143 sed 's/^/| /' conftest.$ac_ext >&5
27144
27145   ac_header_preproc=no
27146 fi
27147
27148 rm -f conftest.err conftest.$ac_ext
27149 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
27150 $as_echo "$ac_header_preproc" >&6; }
27151
27152 # So?  What about this header?
27153 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
27154   yes:no: )
27155     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
27156 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
27157     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
27158 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
27159     ac_header_preproc=yes
27160     ;;
27161   no:yes:* )
27162     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
27163 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
27164     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
27165 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
27166     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
27167 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
27168     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
27169 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
27170     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
27171 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
27172     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
27173 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
27174
27175     ;;
27176 esac
27177 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
27178 $as_echo_n "checking for $bdb_header... " >&6; }
27179 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
27180   $as_echo_n "(cached) " >&6
27181 else
27182   eval "$as_ac_Header=\$ac_header_preproc"
27183 fi
27184 ac_res=`eval 'as_val=${'$as_ac_Header'}
27185                  $as_echo "$as_val"'`
27186                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
27187 $as_echo "$ac_res" >&6; }
27188
27189 fi
27190 as_val=`eval 'as_val=${'$as_ac_Header'}
27191                  $as_echo "$as_val"'`
27192    if test "x$as_val" = x""yes; then
27193
27194           if test ""4"" = "3" -o ""4"" = "4"; then
27195             # We generate a separate cache variable for each prefix and libname
27196             # we search under.  That way, we avoid caching information that
27197             # changes if the user runs `configure' with a different set of
27198             # switches.
27199
27200             cache_id="`echo apu_cv_check_berkeley_db_"4"_"6"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
27201                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
27202
27203
27204             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
27205 $as_echo_n "checking for -l$bdb_libname... " >&6; }
27206                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
27207   $as_echo_n "(cached) " >&6
27208 else
27209
27210
27211     apu_try_berkeley_db_save_libs="$LIBS"
27212
27213     apu_check_berkeley_db_major="4"
27214     apu_check_berkeley_db_minor="6"
27215     apu_check_berkeley_db_patch="-1"
27216     apu_try_berkeley_db_header=$bdb_header
27217     apu_try_berkeley_db_libname=$bdb_libname
27218
27219     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
27220     if test "$cross_compiling" = yes; then
27221   apu_try_berkeley_db=yes
27222
27223 else
27224   cat >conftest.$ac_ext <<_ACEOF
27225 /* confdefs.h.  */
27226 _ACEOF
27227 cat confdefs.h >>conftest.$ac_ext
27228 cat >>conftest.$ac_ext <<_ACEOF
27229 /* end confdefs.h.  */
27230
27231 #include <stdlib.h>
27232 #include <stdio.h>
27233 #include <$apu_try_berkeley_db_header>
27234 main ()
27235 {
27236   int major, minor, patch;
27237
27238   db_version(&major, &minor, &patch);
27239
27240   /* Sanity check: ensure that db.h constants actually match the db library */
27241   if (major != DB_VERSION_MAJOR
27242       || minor != DB_VERSION_MINOR
27243       || patch != DB_VERSION_PATCH)
27244     exit (1);
27245
27246   /* Run-time check:  ensure the library claims to be the correct version. */
27247
27248   if ($apu_check_berkeley_db_major != -1) {
27249     if (major < $apu_check_berkeley_db_major)
27250       exit (1);
27251     if (major > $apu_check_berkeley_db_major)
27252       exit (0);
27253   }
27254
27255   if ($apu_check_berkeley_db_minor != -1) {
27256     if (minor < $apu_check_berkeley_db_minor)
27257       exit (1);
27258     if (minor > $apu_check_berkeley_db_minor)
27259       exit (0);
27260   }
27261
27262   if ($apu_check_berkeley_db_patch == -1
27263       || patch >= $apu_check_berkeley_db_patch)
27264     exit (0);
27265   else
27266     exit (1);
27267 }
27268
27269 _ACEOF
27270 rm -f conftest$ac_exeext
27271 if { (ac_try="$ac_link"
27272 case "(($ac_try" in
27273   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27274   *) ac_try_echo=$ac_try;;
27275 esac
27276 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27277 $as_echo "$ac_try_echo") >&5
27278   (eval "$ac_link") 2>&5
27279   ac_status=$?
27280   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27281   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
27282   { (case "(($ac_try" in
27283   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27284   *) ac_try_echo=$ac_try;;
27285 esac
27286 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27287 $as_echo "$ac_try_echo") >&5
27288   (eval "$ac_try") 2>&5
27289   ac_status=$?
27290   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27291   (exit $ac_status); }; }; then
27292   apu_try_berkeley_db=yes
27293 else
27294   $as_echo "$as_me: program exited with status $ac_status" >&5
27295 $as_echo "$as_me: failed program was:" >&5
27296 sed 's/^/| /' conftest.$ac_ext >&5
27297
27298 ( exit $ac_status )
27299 apu_try_berkeley_db=no
27300 fi
27301 rm -rf conftest.dSYM
27302 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
27303 fi
27304
27305
27306
27307     LIBS="$apu_try_berkeley_db_save_libs"
27308
27309
27310                 eval "$cache_id=$apu_try_berkeley_db"
27311
27312 fi
27313
27314             result="`eval echo '$'$cache_id`"
27315             { $as_echo "$as_me:$LINENO: result: $result" >&5
27316 $as_echo "$result" >&6; }
27317           elif test ""4"" = "1"; then
27318             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
27319 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
27320 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
27321 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
27322   $as_echo_n "(cached) " >&6
27323 else
27324   ac_check_lib_save_LIBS=$LIBS
27325 LIBS="-l$bdb_libname  $LIBS"
27326 cat >conftest.$ac_ext <<_ACEOF
27327 /* confdefs.h.  */
27328 _ACEOF
27329 cat confdefs.h >>conftest.$ac_ext
27330 cat >>conftest.$ac_ext <<_ACEOF
27331 /* end confdefs.h.  */
27332
27333 /* Override any GCC internal prototype to avoid an error.
27334    Use char because int might match the return type of a GCC
27335    builtin and then its argument prototype would still apply.  */
27336 #ifdef __cplusplus
27337 extern "C"
27338 #endif
27339 char dbopen ();
27340 int
27341 main ()
27342 {
27343 return dbopen ();
27344   ;
27345   return 0;
27346 }
27347 _ACEOF
27348 rm -f conftest.$ac_objext conftest$ac_exeext
27349 if { (ac_try="$ac_link"
27350 case "(($ac_try" in
27351   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27352   *) ac_try_echo=$ac_try;;
27353 esac
27354 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27355 $as_echo "$ac_try_echo") >&5
27356   (eval "$ac_link") 2>conftest.er1
27357   ac_status=$?
27358   grep -v '^ *+' conftest.er1 >conftest.err
27359   rm -f conftest.er1
27360   cat conftest.err >&5
27361   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27362   (exit $ac_status); } && {
27363          test -z "$ac_c_werror_flag" ||
27364          test ! -s conftest.err
27365        } && test -s conftest$ac_exeext && {
27366          test "$cross_compiling" = yes ||
27367          $as_test_x conftest$ac_exeext
27368        }; then
27369   eval "$as_ac_Lib=yes"
27370 else
27371   $as_echo "$as_me: failed program was:" >&5
27372 sed 's/^/| /' conftest.$ac_ext >&5
27373
27374         eval "$as_ac_Lib=no"
27375 fi
27376
27377 rm -rf conftest.dSYM
27378 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
27379       conftest$ac_exeext conftest.$ac_ext
27380 LIBS=$ac_check_lib_save_LIBS
27381 fi
27382 ac_res=`eval 'as_val=${'$as_ac_Lib'}
27383                  $as_echo "$as_val"'`
27384                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
27385 $as_echo "$ac_res" >&6; }
27386 as_val=`eval 'as_val=${'$as_ac_Lib'}
27387                  $as_echo "$as_val"'`
27388    if test "x$as_val" = x""yes; then
27389   result=yes
27390 else
27391   result=no
27392
27393 fi
27394
27395           elif test ""4"" = "2"; then
27396             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
27397 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
27398 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
27399 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
27400   $as_echo_n "(cached) " >&6
27401 else
27402   ac_check_lib_save_LIBS=$LIBS
27403 LIBS="-l$bdb_libname  $LIBS"
27404 cat >conftest.$ac_ext <<_ACEOF
27405 /* confdefs.h.  */
27406 _ACEOF
27407 cat confdefs.h >>conftest.$ac_ext
27408 cat >>conftest.$ac_ext <<_ACEOF
27409 /* end confdefs.h.  */
27410
27411 /* Override any GCC internal prototype to avoid an error.
27412    Use char because int might match the return type of a GCC
27413    builtin and then its argument prototype would still apply.  */
27414 #ifdef __cplusplus
27415 extern "C"
27416 #endif
27417 char db_open ();
27418 int
27419 main ()
27420 {
27421 return db_open ();
27422   ;
27423   return 0;
27424 }
27425 _ACEOF
27426 rm -f conftest.$ac_objext conftest$ac_exeext
27427 if { (ac_try="$ac_link"
27428 case "(($ac_try" in
27429   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27430   *) ac_try_echo=$ac_try;;
27431 esac
27432 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27433 $as_echo "$ac_try_echo") >&5
27434   (eval "$ac_link") 2>conftest.er1
27435   ac_status=$?
27436   grep -v '^ *+' conftest.er1 >conftest.err
27437   rm -f conftest.er1
27438   cat conftest.err >&5
27439   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27440   (exit $ac_status); } && {
27441          test -z "$ac_c_werror_flag" ||
27442          test ! -s conftest.err
27443        } && test -s conftest$ac_exeext && {
27444          test "$cross_compiling" = yes ||
27445          $as_test_x conftest$ac_exeext
27446        }; then
27447   eval "$as_ac_Lib=yes"
27448 else
27449   $as_echo "$as_me: failed program was:" >&5
27450 sed 's/^/| /' conftest.$ac_ext >&5
27451
27452         eval "$as_ac_Lib=no"
27453 fi
27454
27455 rm -rf conftest.dSYM
27456 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
27457       conftest$ac_exeext conftest.$ac_ext
27458 LIBS=$ac_check_lib_save_LIBS
27459 fi
27460 ac_res=`eval 'as_val=${'$as_ac_Lib'}
27461                  $as_echo "$as_val"'`
27462                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
27463 $as_echo "$ac_res" >&6; }
27464 as_val=`eval 'as_val=${'$as_ac_Lib'}
27465                  $as_echo "$as_val"'`
27466    if test "x$as_val" = x""yes; then
27467   result=yes
27468 else
27469   result=no
27470
27471 fi
27472
27473           fi
27474
27475 else
27476   result="no"
27477 fi
27478
27479
27480
27481         # If we found it, no need to search any more.
27482         if test "$result" = "yes"; then
27483           found="$bdb_place"
27484           break
27485         fi
27486       done
27487       test "$found" != "not" && break
27488     done
27489     test "$found" != "not" && break
27490   done
27491
27492   # Restore the original values of the flags we tweak.
27493   LDFLAGS="$apu_check_lib_save_ldflags"
27494   CPPFLAGS="$apu_check_lib_save_cppflags"
27495
27496   case "$found" in
27497   "not")
27498     apu_have_db=0
27499     ;;
27500   "std")
27501     apu_db_header=$bdb_header
27502     apu_db_lib=$bdb_libname
27503     apu_have_db=1
27504     ;;
27505   *":"*)
27506     header="`echo $found | sed -e 's/:.*$//'`"
27507     lib="`echo $found | sed -e 's/^.*://'`"
27508
27509
27510   if test "x$APRUTIL_INCLUDES" = "x"; then
27511     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
27512     APRUTIL_INCLUDES="-I$header"
27513   else
27514     apr_addto_bugger="-I$header"
27515     for i in $apr_addto_bugger; do
27516       apr_addto_duplicate="0"
27517       for j in $APRUTIL_INCLUDES; do
27518         if test "x$i" = "x$j"; then
27519           apr_addto_duplicate="1"
27520           break
27521         fi
27522       done
27523       if test $apr_addto_duplicate = "0"; then
27524         echo "  adding \"$i\" to APRUTIL_INCLUDES"
27525         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
27526       fi
27527     done
27528   fi
27529
27530
27531   if test "x$APRUTIL_LDFLAGS" = "x"; then
27532     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
27533     APRUTIL_LDFLAGS="-L$lib"
27534   else
27535     apr_addto_bugger="-L$lib"
27536     for i in $apr_addto_bugger; do
27537       apr_addto_duplicate="0"
27538       for j in $APRUTIL_LDFLAGS; do
27539         if test "x$i" = "x$j"; then
27540           apr_addto_duplicate="1"
27541           break
27542         fi
27543       done
27544       if test $apr_addto_duplicate = "0"; then
27545         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
27546         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
27547       fi
27548     done
27549   fi
27550
27551     apu_db_header=$bdb_header
27552     apu_db_lib=$bdb_libname
27553     apu_have_db=1
27554     ;;
27555   *)
27556
27557   if test "x$APRUTIL_INCLUDES" = "x"; then
27558     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
27559     APRUTIL_INCLUDES="-I$found/include"
27560   else
27561     apr_addto_bugger="-I$found/include"
27562     for i in $apr_addto_bugger; do
27563       apr_addto_duplicate="0"
27564       for j in $APRUTIL_INCLUDES; do
27565         if test "x$i" = "x$j"; then
27566           apr_addto_duplicate="1"
27567           break
27568         fi
27569       done
27570       if test $apr_addto_duplicate = "0"; then
27571         echo "  adding \"$i\" to APRUTIL_INCLUDES"
27572         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
27573       fi
27574     done
27575   fi
27576
27577
27578   if test "x$APRUTIL_LDFLAGS" = "x"; then
27579     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
27580     APRUTIL_LDFLAGS="-L$found/lib"
27581   else
27582     apr_addto_bugger="-L$found/lib"
27583     for i in $apr_addto_bugger; do
27584       apr_addto_duplicate="0"
27585       for j in $APRUTIL_LDFLAGS; do
27586         if test "x$i" = "x$j"; then
27587           apr_addto_duplicate="1"
27588           break
27589         fi
27590       done
27591       if test $apr_addto_duplicate = "0"; then
27592         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
27593         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
27594       fi
27595     done
27596   fi
27597
27598     apu_db_header=$bdb_header
27599     apu_db_lib=$bdb_libname
27600     apu_have_db=1
27601     ;;
27602   esac
27603
27604   if test "$apu_have_db" = "1"; then
27605     apu_db_version=4
27606   fi
27607
27608       if test "$apu_db_version" != "4"; then
27609
27610   places="$all_places"
27611   if test -z "$places"; then
27612     places="std /usr/local/BerkeleyDB.4.5 /boot/home/config"
27613   fi
27614
27615   bdb_version="4"
27616   if test ""5"" != "-1"; then
27617     bdb_version="$bdb_version."5""
27618     if test ""-1"" != "-1"; then
27619       bdb_version="$bdb_version."-1""
27620     fi
27621   fi
27622   bdb_places="$places"
27623   bdb_default_search_headers="db45/db.h db4/db.h db.h"
27624   bdb_default_search_lib_names="db-4.5 db4-4.5 db45 db4 db"
27625
27626
27627   apu_have_db=0
27628
27629   # Save the original values of the flags we tweak.
27630   apu_check_lib_save_libs="$LIBS"
27631   apu_check_lib_save_ldflags="$LDFLAGS"
27632   apu_check_lib_save_cppflags="$CPPFLAGS"
27633
27634   # The variable `found' is the prefix under which we've found
27635   # Berkeley DB, or `not' if we haven't found it anywhere yet.
27636   found=not
27637   for bdb_place in $bdb_places; do
27638
27639     LDFLAGS="$apu_check_lib_save_ldflags"
27640     CPPFLAGS="$apu_check_lib_save_cppflags"
27641     case "$bdb_place" in
27642       "std" )
27643         description="the standard places"
27644       ;;
27645       *":"* )
27646         header="`echo $bdb_place | sed -e 's/:.*$//'`"
27647         lib="`echo $bdb_place | sed -e 's/^.*://'`"
27648         CPPFLAGS="$CPPFLAGS -I$header"
27649         LDFLAGS="$LDFLAGS -L$lib"
27650         description="$header and $lib"
27651       ;;
27652       * )
27653         if test -d $bdb_place; then
27654           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
27655           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
27656         else
27657           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
27658 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
27659           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
27660 $as_echo "directory not found" >&6; }
27661           continue
27662         fi
27663         description="$bdb_place"
27664       ;;
27665     esac
27666
27667     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
27668     # trick to display a message instead.
27669     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
27670 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
27671     { $as_echo "$as_me:$LINENO: result: " >&5
27672 $as_echo "" >&6; }
27673
27674     for bdb_libname in $bdb_default_search_lib_names; do
27675       for bdb_header in $bdb_default_search_headers; do
27676         # Clear the header cache variable for each location
27677
27678         cache_id="`echo ac_cv_header_${bdb_header} \
27679                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
27680
27681         unset $cache_id
27682         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
27683 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
27684   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
27685 $as_echo_n "checking for $bdb_header... " >&6; }
27686 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
27687   $as_echo_n "(cached) " >&6
27688 fi
27689 ac_res=`eval 'as_val=${'$as_ac_Header'}
27690                  $as_echo "$as_val"'`
27691                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
27692 $as_echo "$ac_res" >&6; }
27693 else
27694   # Is the header compilable?
27695 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
27696 $as_echo_n "checking $bdb_header usability... " >&6; }
27697 cat >conftest.$ac_ext <<_ACEOF
27698 /* confdefs.h.  */
27699 _ACEOF
27700 cat confdefs.h >>conftest.$ac_ext
27701 cat >>conftest.$ac_ext <<_ACEOF
27702 /* end confdefs.h.  */
27703 $ac_includes_default
27704 #include <$bdb_header>
27705 _ACEOF
27706 rm -f conftest.$ac_objext
27707 if { (ac_try="$ac_compile"
27708 case "(($ac_try" in
27709   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27710   *) ac_try_echo=$ac_try;;
27711 esac
27712 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27713 $as_echo "$ac_try_echo") >&5
27714   (eval "$ac_compile") 2>conftest.er1
27715   ac_status=$?
27716   grep -v '^ *+' conftest.er1 >conftest.err
27717   rm -f conftest.er1
27718   cat conftest.err >&5
27719   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27720   (exit $ac_status); } && {
27721          test -z "$ac_c_werror_flag" ||
27722          test ! -s conftest.err
27723        } && test -s conftest.$ac_objext; then
27724   ac_header_compiler=yes
27725 else
27726   $as_echo "$as_me: failed program was:" >&5
27727 sed 's/^/| /' conftest.$ac_ext >&5
27728
27729         ac_header_compiler=no
27730 fi
27731
27732 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27733 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
27734 $as_echo "$ac_header_compiler" >&6; }
27735
27736 # Is the header present?
27737 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
27738 $as_echo_n "checking $bdb_header presence... " >&6; }
27739 cat >conftest.$ac_ext <<_ACEOF
27740 /* confdefs.h.  */
27741 _ACEOF
27742 cat confdefs.h >>conftest.$ac_ext
27743 cat >>conftest.$ac_ext <<_ACEOF
27744 /* end confdefs.h.  */
27745 #include <$bdb_header>
27746 _ACEOF
27747 if { (ac_try="$ac_cpp conftest.$ac_ext"
27748 case "(($ac_try" in
27749   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27750   *) ac_try_echo=$ac_try;;
27751 esac
27752 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27753 $as_echo "$ac_try_echo") >&5
27754   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
27755   ac_status=$?
27756   grep -v '^ *+' conftest.er1 >conftest.err
27757   rm -f conftest.er1
27758   cat conftest.err >&5
27759   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27760   (exit $ac_status); } >/dev/null && {
27761          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
27762          test ! -s conftest.err
27763        }; then
27764   ac_header_preproc=yes
27765 else
27766   $as_echo "$as_me: failed program was:" >&5
27767 sed 's/^/| /' conftest.$ac_ext >&5
27768
27769   ac_header_preproc=no
27770 fi
27771
27772 rm -f conftest.err conftest.$ac_ext
27773 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
27774 $as_echo "$ac_header_preproc" >&6; }
27775
27776 # So?  What about this header?
27777 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
27778   yes:no: )
27779     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
27780 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
27781     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
27782 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
27783     ac_header_preproc=yes
27784     ;;
27785   no:yes:* )
27786     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
27787 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
27788     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
27789 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
27790     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
27791 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
27792     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
27793 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
27794     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
27795 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
27796     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
27797 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
27798
27799     ;;
27800 esac
27801 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
27802 $as_echo_n "checking for $bdb_header... " >&6; }
27803 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
27804   $as_echo_n "(cached) " >&6
27805 else
27806   eval "$as_ac_Header=\$ac_header_preproc"
27807 fi
27808 ac_res=`eval 'as_val=${'$as_ac_Header'}
27809                  $as_echo "$as_val"'`
27810                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
27811 $as_echo "$ac_res" >&6; }
27812
27813 fi
27814 as_val=`eval 'as_val=${'$as_ac_Header'}
27815                  $as_echo "$as_val"'`
27816    if test "x$as_val" = x""yes; then
27817
27818           if test ""4"" = "3" -o ""4"" = "4"; then
27819             # We generate a separate cache variable for each prefix and libname
27820             # we search under.  That way, we avoid caching information that
27821             # changes if the user runs `configure' with a different set of
27822             # switches.
27823
27824             cache_id="`echo apu_cv_check_berkeley_db_"4"_"5"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
27825                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
27826
27827
27828             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
27829 $as_echo_n "checking for -l$bdb_libname... " >&6; }
27830                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
27831   $as_echo_n "(cached) " >&6
27832 else
27833
27834
27835     apu_try_berkeley_db_save_libs="$LIBS"
27836
27837     apu_check_berkeley_db_major="4"
27838     apu_check_berkeley_db_minor="5"
27839     apu_check_berkeley_db_patch="-1"
27840     apu_try_berkeley_db_header=$bdb_header
27841     apu_try_berkeley_db_libname=$bdb_libname
27842
27843     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
27844     if test "$cross_compiling" = yes; then
27845   apu_try_berkeley_db=yes
27846
27847 else
27848   cat >conftest.$ac_ext <<_ACEOF
27849 /* confdefs.h.  */
27850 _ACEOF
27851 cat confdefs.h >>conftest.$ac_ext
27852 cat >>conftest.$ac_ext <<_ACEOF
27853 /* end confdefs.h.  */
27854
27855 #include <stdlib.h>
27856 #include <stdio.h>
27857 #include <$apu_try_berkeley_db_header>
27858 main ()
27859 {
27860   int major, minor, patch;
27861
27862   db_version(&major, &minor, &patch);
27863
27864   /* Sanity check: ensure that db.h constants actually match the db library */
27865   if (major != DB_VERSION_MAJOR
27866       || minor != DB_VERSION_MINOR
27867       || patch != DB_VERSION_PATCH)
27868     exit (1);
27869
27870   /* Run-time check:  ensure the library claims to be the correct version. */
27871
27872   if ($apu_check_berkeley_db_major != -1) {
27873     if (major < $apu_check_berkeley_db_major)
27874       exit (1);
27875     if (major > $apu_check_berkeley_db_major)
27876       exit (0);
27877   }
27878
27879   if ($apu_check_berkeley_db_minor != -1) {
27880     if (minor < $apu_check_berkeley_db_minor)
27881       exit (1);
27882     if (minor > $apu_check_berkeley_db_minor)
27883       exit (0);
27884   }
27885
27886   if ($apu_check_berkeley_db_patch == -1
27887       || patch >= $apu_check_berkeley_db_patch)
27888     exit (0);
27889   else
27890     exit (1);
27891 }
27892
27893 _ACEOF
27894 rm -f conftest$ac_exeext
27895 if { (ac_try="$ac_link"
27896 case "(($ac_try" in
27897   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27898   *) ac_try_echo=$ac_try;;
27899 esac
27900 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27901 $as_echo "$ac_try_echo") >&5
27902   (eval "$ac_link") 2>&5
27903   ac_status=$?
27904   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27905   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
27906   { (case "(($ac_try" in
27907   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27908   *) ac_try_echo=$ac_try;;
27909 esac
27910 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27911 $as_echo "$ac_try_echo") >&5
27912   (eval "$ac_try") 2>&5
27913   ac_status=$?
27914   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27915   (exit $ac_status); }; }; then
27916   apu_try_berkeley_db=yes
27917 else
27918   $as_echo "$as_me: program exited with status $ac_status" >&5
27919 $as_echo "$as_me: failed program was:" >&5
27920 sed 's/^/| /' conftest.$ac_ext >&5
27921
27922 ( exit $ac_status )
27923 apu_try_berkeley_db=no
27924 fi
27925 rm -rf conftest.dSYM
27926 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
27927 fi
27928
27929
27930
27931     LIBS="$apu_try_berkeley_db_save_libs"
27932
27933
27934                 eval "$cache_id=$apu_try_berkeley_db"
27935
27936 fi
27937
27938             result="`eval echo '$'$cache_id`"
27939             { $as_echo "$as_me:$LINENO: result: $result" >&5
27940 $as_echo "$result" >&6; }
27941           elif test ""4"" = "1"; then
27942             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
27943 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
27944 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
27945 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
27946   $as_echo_n "(cached) " >&6
27947 else
27948   ac_check_lib_save_LIBS=$LIBS
27949 LIBS="-l$bdb_libname  $LIBS"
27950 cat >conftest.$ac_ext <<_ACEOF
27951 /* confdefs.h.  */
27952 _ACEOF
27953 cat confdefs.h >>conftest.$ac_ext
27954 cat >>conftest.$ac_ext <<_ACEOF
27955 /* end confdefs.h.  */
27956
27957 /* Override any GCC internal prototype to avoid an error.
27958    Use char because int might match the return type of a GCC
27959    builtin and then its argument prototype would still apply.  */
27960 #ifdef __cplusplus
27961 extern "C"
27962 #endif
27963 char dbopen ();
27964 int
27965 main ()
27966 {
27967 return dbopen ();
27968   ;
27969   return 0;
27970 }
27971 _ACEOF
27972 rm -f conftest.$ac_objext conftest$ac_exeext
27973 if { (ac_try="$ac_link"
27974 case "(($ac_try" in
27975   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27976   *) ac_try_echo=$ac_try;;
27977 esac
27978 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
27979 $as_echo "$ac_try_echo") >&5
27980   (eval "$ac_link") 2>conftest.er1
27981   ac_status=$?
27982   grep -v '^ *+' conftest.er1 >conftest.err
27983   rm -f conftest.er1
27984   cat conftest.err >&5
27985   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
27986   (exit $ac_status); } && {
27987          test -z "$ac_c_werror_flag" ||
27988          test ! -s conftest.err
27989        } && test -s conftest$ac_exeext && {
27990          test "$cross_compiling" = yes ||
27991          $as_test_x conftest$ac_exeext
27992        }; then
27993   eval "$as_ac_Lib=yes"
27994 else
27995   $as_echo "$as_me: failed program was:" >&5
27996 sed 's/^/| /' conftest.$ac_ext >&5
27997
27998         eval "$as_ac_Lib=no"
27999 fi
28000
28001 rm -rf conftest.dSYM
28002 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
28003       conftest$ac_exeext conftest.$ac_ext
28004 LIBS=$ac_check_lib_save_LIBS
28005 fi
28006 ac_res=`eval 'as_val=${'$as_ac_Lib'}
28007                  $as_echo "$as_val"'`
28008                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
28009 $as_echo "$ac_res" >&6; }
28010 as_val=`eval 'as_val=${'$as_ac_Lib'}
28011                  $as_echo "$as_val"'`
28012    if test "x$as_val" = x""yes; then
28013   result=yes
28014 else
28015   result=no
28016
28017 fi
28018
28019           elif test ""4"" = "2"; then
28020             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
28021 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
28022 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
28023 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
28024   $as_echo_n "(cached) " >&6
28025 else
28026   ac_check_lib_save_LIBS=$LIBS
28027 LIBS="-l$bdb_libname  $LIBS"
28028 cat >conftest.$ac_ext <<_ACEOF
28029 /* confdefs.h.  */
28030 _ACEOF
28031 cat confdefs.h >>conftest.$ac_ext
28032 cat >>conftest.$ac_ext <<_ACEOF
28033 /* end confdefs.h.  */
28034
28035 /* Override any GCC internal prototype to avoid an error.
28036    Use char because int might match the return type of a GCC
28037    builtin and then its argument prototype would still apply.  */
28038 #ifdef __cplusplus
28039 extern "C"
28040 #endif
28041 char db_open ();
28042 int
28043 main ()
28044 {
28045 return db_open ();
28046   ;
28047   return 0;
28048 }
28049 _ACEOF
28050 rm -f conftest.$ac_objext conftest$ac_exeext
28051 if { (ac_try="$ac_link"
28052 case "(($ac_try" in
28053   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28054   *) ac_try_echo=$ac_try;;
28055 esac
28056 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
28057 $as_echo "$ac_try_echo") >&5
28058   (eval "$ac_link") 2>conftest.er1
28059   ac_status=$?
28060   grep -v '^ *+' conftest.er1 >conftest.err
28061   rm -f conftest.er1
28062   cat conftest.err >&5
28063   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
28064   (exit $ac_status); } && {
28065          test -z "$ac_c_werror_flag" ||
28066          test ! -s conftest.err
28067        } && test -s conftest$ac_exeext && {
28068          test "$cross_compiling" = yes ||
28069          $as_test_x conftest$ac_exeext
28070        }; then
28071   eval "$as_ac_Lib=yes"
28072 else
28073   $as_echo "$as_me: failed program was:" >&5
28074 sed 's/^/| /' conftest.$ac_ext >&5
28075
28076         eval "$as_ac_Lib=no"
28077 fi
28078
28079 rm -rf conftest.dSYM
28080 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
28081       conftest$ac_exeext conftest.$ac_ext
28082 LIBS=$ac_check_lib_save_LIBS
28083 fi
28084 ac_res=`eval 'as_val=${'$as_ac_Lib'}
28085                  $as_echo "$as_val"'`
28086                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
28087 $as_echo "$ac_res" >&6; }
28088 as_val=`eval 'as_val=${'$as_ac_Lib'}
28089                  $as_echo "$as_val"'`
28090    if test "x$as_val" = x""yes; then
28091   result=yes
28092 else
28093   result=no
28094
28095 fi
28096
28097           fi
28098
28099 else
28100   result="no"
28101 fi
28102
28103
28104
28105         # If we found it, no need to search any more.
28106         if test "$result" = "yes"; then
28107           found="$bdb_place"
28108           break
28109         fi
28110       done
28111       test "$found" != "not" && break
28112     done
28113     test "$found" != "not" && break
28114   done
28115
28116   # Restore the original values of the flags we tweak.
28117   LDFLAGS="$apu_check_lib_save_ldflags"
28118   CPPFLAGS="$apu_check_lib_save_cppflags"
28119
28120   case "$found" in
28121   "not")
28122     apu_have_db=0
28123     ;;
28124   "std")
28125     apu_db_header=$bdb_header
28126     apu_db_lib=$bdb_libname
28127     apu_have_db=1
28128     ;;
28129   *":"*)
28130     header="`echo $found | sed -e 's/:.*$//'`"
28131     lib="`echo $found | sed -e 's/^.*://'`"
28132
28133
28134   if test "x$APRUTIL_INCLUDES" = "x"; then
28135     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
28136     APRUTIL_INCLUDES="-I$header"
28137   else
28138     apr_addto_bugger="-I$header"
28139     for i in $apr_addto_bugger; do
28140       apr_addto_duplicate="0"
28141       for j in $APRUTIL_INCLUDES; do
28142         if test "x$i" = "x$j"; then
28143           apr_addto_duplicate="1"
28144           break
28145         fi
28146       done
28147       if test $apr_addto_duplicate = "0"; then
28148         echo "  adding \"$i\" to APRUTIL_INCLUDES"
28149         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
28150       fi
28151     done
28152   fi
28153
28154
28155   if test "x$APRUTIL_LDFLAGS" = "x"; then
28156     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
28157     APRUTIL_LDFLAGS="-L$lib"
28158   else
28159     apr_addto_bugger="-L$lib"
28160     for i in $apr_addto_bugger; do
28161       apr_addto_duplicate="0"
28162       for j in $APRUTIL_LDFLAGS; do
28163         if test "x$i" = "x$j"; then
28164           apr_addto_duplicate="1"
28165           break
28166         fi
28167       done
28168       if test $apr_addto_duplicate = "0"; then
28169         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
28170         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
28171       fi
28172     done
28173   fi
28174
28175     apu_db_header=$bdb_header
28176     apu_db_lib=$bdb_libname
28177     apu_have_db=1
28178     ;;
28179   *)
28180
28181   if test "x$APRUTIL_INCLUDES" = "x"; then
28182     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
28183     APRUTIL_INCLUDES="-I$found/include"
28184   else
28185     apr_addto_bugger="-I$found/include"
28186     for i in $apr_addto_bugger; do
28187       apr_addto_duplicate="0"
28188       for j in $APRUTIL_INCLUDES; do
28189         if test "x$i" = "x$j"; then
28190           apr_addto_duplicate="1"
28191           break
28192         fi
28193       done
28194       if test $apr_addto_duplicate = "0"; then
28195         echo "  adding \"$i\" to APRUTIL_INCLUDES"
28196         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
28197       fi
28198     done
28199   fi
28200
28201
28202   if test "x$APRUTIL_LDFLAGS" = "x"; then
28203     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
28204     APRUTIL_LDFLAGS="-L$found/lib"
28205   else
28206     apr_addto_bugger="-L$found/lib"
28207     for i in $apr_addto_bugger; do
28208       apr_addto_duplicate="0"
28209       for j in $APRUTIL_LDFLAGS; do
28210         if test "x$i" = "x$j"; then
28211           apr_addto_duplicate="1"
28212           break
28213         fi
28214       done
28215       if test $apr_addto_duplicate = "0"; then
28216         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
28217         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
28218       fi
28219     done
28220   fi
28221
28222     apu_db_header=$bdb_header
28223     apu_db_lib=$bdb_libname
28224     apu_have_db=1
28225     ;;
28226   esac
28227
28228   if test "$apu_have_db" = "1"; then
28229     apu_db_version=4
28230   fi
28231
28232         if test "$apu_db_version" != "4"; then
28233
28234   places="$all_places"
28235   if test -z "$places"; then
28236     places="std /usr/local/BerkeleyDB.4.4 /boot/home/config"
28237   fi
28238
28239   bdb_version="4"
28240   if test ""4"" != "-1"; then
28241     bdb_version="$bdb_version."4""
28242     if test ""-1"" != "-1"; then
28243       bdb_version="$bdb_version."-1""
28244     fi
28245   fi
28246   bdb_places="$places"
28247   bdb_default_search_headers="db44/db.h db4/db.h db.h"
28248   bdb_default_search_lib_names="db-4.4 db4-4.4 db44 db4 db"
28249
28250
28251   apu_have_db=0
28252
28253   # Save the original values of the flags we tweak.
28254   apu_check_lib_save_libs="$LIBS"
28255   apu_check_lib_save_ldflags="$LDFLAGS"
28256   apu_check_lib_save_cppflags="$CPPFLAGS"
28257
28258   # The variable `found' is the prefix under which we've found
28259   # Berkeley DB, or `not' if we haven't found it anywhere yet.
28260   found=not
28261   for bdb_place in $bdb_places; do
28262
28263     LDFLAGS="$apu_check_lib_save_ldflags"
28264     CPPFLAGS="$apu_check_lib_save_cppflags"
28265     case "$bdb_place" in
28266       "std" )
28267         description="the standard places"
28268       ;;
28269       *":"* )
28270         header="`echo $bdb_place | sed -e 's/:.*$//'`"
28271         lib="`echo $bdb_place | sed -e 's/^.*://'`"
28272         CPPFLAGS="$CPPFLAGS -I$header"
28273         LDFLAGS="$LDFLAGS -L$lib"
28274         description="$header and $lib"
28275       ;;
28276       * )
28277         if test -d $bdb_place; then
28278           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
28279           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
28280         else
28281           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
28282 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
28283           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
28284 $as_echo "directory not found" >&6; }
28285           continue
28286         fi
28287         description="$bdb_place"
28288       ;;
28289     esac
28290
28291     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
28292     # trick to display a message instead.
28293     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
28294 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
28295     { $as_echo "$as_me:$LINENO: result: " >&5
28296 $as_echo "" >&6; }
28297
28298     for bdb_libname in $bdb_default_search_lib_names; do
28299       for bdb_header in $bdb_default_search_headers; do
28300         # Clear the header cache variable for each location
28301
28302         cache_id="`echo ac_cv_header_${bdb_header} \
28303                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
28304
28305         unset $cache_id
28306         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
28307 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
28308   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
28309 $as_echo_n "checking for $bdb_header... " >&6; }
28310 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
28311   $as_echo_n "(cached) " >&6
28312 fi
28313 ac_res=`eval 'as_val=${'$as_ac_Header'}
28314                  $as_echo "$as_val"'`
28315                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
28316 $as_echo "$ac_res" >&6; }
28317 else
28318   # Is the header compilable?
28319 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
28320 $as_echo_n "checking $bdb_header usability... " >&6; }
28321 cat >conftest.$ac_ext <<_ACEOF
28322 /* confdefs.h.  */
28323 _ACEOF
28324 cat confdefs.h >>conftest.$ac_ext
28325 cat >>conftest.$ac_ext <<_ACEOF
28326 /* end confdefs.h.  */
28327 $ac_includes_default
28328 #include <$bdb_header>
28329 _ACEOF
28330 rm -f conftest.$ac_objext
28331 if { (ac_try="$ac_compile"
28332 case "(($ac_try" in
28333   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28334   *) ac_try_echo=$ac_try;;
28335 esac
28336 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
28337 $as_echo "$ac_try_echo") >&5
28338   (eval "$ac_compile") 2>conftest.er1
28339   ac_status=$?
28340   grep -v '^ *+' conftest.er1 >conftest.err
28341   rm -f conftest.er1
28342   cat conftest.err >&5
28343   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
28344   (exit $ac_status); } && {
28345          test -z "$ac_c_werror_flag" ||
28346          test ! -s conftest.err
28347        } && test -s conftest.$ac_objext; then
28348   ac_header_compiler=yes
28349 else
28350   $as_echo "$as_me: failed program was:" >&5
28351 sed 's/^/| /' conftest.$ac_ext >&5
28352
28353         ac_header_compiler=no
28354 fi
28355
28356 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28357 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
28358 $as_echo "$ac_header_compiler" >&6; }
28359
28360 # Is the header present?
28361 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
28362 $as_echo_n "checking $bdb_header presence... " >&6; }
28363 cat >conftest.$ac_ext <<_ACEOF
28364 /* confdefs.h.  */
28365 _ACEOF
28366 cat confdefs.h >>conftest.$ac_ext
28367 cat >>conftest.$ac_ext <<_ACEOF
28368 /* end confdefs.h.  */
28369 #include <$bdb_header>
28370 _ACEOF
28371 if { (ac_try="$ac_cpp conftest.$ac_ext"
28372 case "(($ac_try" in
28373   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28374   *) ac_try_echo=$ac_try;;
28375 esac
28376 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
28377 $as_echo "$ac_try_echo") >&5
28378   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
28379   ac_status=$?
28380   grep -v '^ *+' conftest.er1 >conftest.err
28381   rm -f conftest.er1
28382   cat conftest.err >&5
28383   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
28384   (exit $ac_status); } >/dev/null && {
28385          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
28386          test ! -s conftest.err
28387        }; then
28388   ac_header_preproc=yes
28389 else
28390   $as_echo "$as_me: failed program was:" >&5
28391 sed 's/^/| /' conftest.$ac_ext >&5
28392
28393   ac_header_preproc=no
28394 fi
28395
28396 rm -f conftest.err conftest.$ac_ext
28397 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
28398 $as_echo "$ac_header_preproc" >&6; }
28399
28400 # So?  What about this header?
28401 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
28402   yes:no: )
28403     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
28404 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
28405     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
28406 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
28407     ac_header_preproc=yes
28408     ;;
28409   no:yes:* )
28410     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
28411 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
28412     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
28413 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
28414     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
28415 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
28416     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
28417 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
28418     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
28419 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
28420     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
28421 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
28422
28423     ;;
28424 esac
28425 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
28426 $as_echo_n "checking for $bdb_header... " >&6; }
28427 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
28428   $as_echo_n "(cached) " >&6
28429 else
28430   eval "$as_ac_Header=\$ac_header_preproc"
28431 fi
28432 ac_res=`eval 'as_val=${'$as_ac_Header'}
28433                  $as_echo "$as_val"'`
28434                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
28435 $as_echo "$ac_res" >&6; }
28436
28437 fi
28438 as_val=`eval 'as_val=${'$as_ac_Header'}
28439                  $as_echo "$as_val"'`
28440    if test "x$as_val" = x""yes; then
28441
28442           if test ""4"" = "3" -o ""4"" = "4"; then
28443             # We generate a separate cache variable for each prefix and libname
28444             # we search under.  That way, we avoid caching information that
28445             # changes if the user runs `configure' with a different set of
28446             # switches.
28447
28448             cache_id="`echo apu_cv_check_berkeley_db_"4"_"4"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
28449                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
28450
28451
28452             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
28453 $as_echo_n "checking for -l$bdb_libname... " >&6; }
28454                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
28455   $as_echo_n "(cached) " >&6
28456 else
28457
28458
28459     apu_try_berkeley_db_save_libs="$LIBS"
28460
28461     apu_check_berkeley_db_major="4"
28462     apu_check_berkeley_db_minor="4"
28463     apu_check_berkeley_db_patch="-1"
28464     apu_try_berkeley_db_header=$bdb_header
28465     apu_try_berkeley_db_libname=$bdb_libname
28466
28467     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
28468     if test "$cross_compiling" = yes; then
28469   apu_try_berkeley_db=yes
28470
28471 else
28472   cat >conftest.$ac_ext <<_ACEOF
28473 /* confdefs.h.  */
28474 _ACEOF
28475 cat confdefs.h >>conftest.$ac_ext
28476 cat >>conftest.$ac_ext <<_ACEOF
28477 /* end confdefs.h.  */
28478
28479 #include <stdlib.h>
28480 #include <stdio.h>
28481 #include <$apu_try_berkeley_db_header>
28482 main ()
28483 {
28484   int major, minor, patch;
28485
28486   db_version(&major, &minor, &patch);
28487
28488   /* Sanity check: ensure that db.h constants actually match the db library */
28489   if (major != DB_VERSION_MAJOR
28490       || minor != DB_VERSION_MINOR
28491       || patch != DB_VERSION_PATCH)
28492     exit (1);
28493
28494   /* Run-time check:  ensure the library claims to be the correct version. */
28495
28496   if ($apu_check_berkeley_db_major != -1) {
28497     if (major < $apu_check_berkeley_db_major)
28498       exit (1);
28499     if (major > $apu_check_berkeley_db_major)
28500       exit (0);
28501   }
28502
28503   if ($apu_check_berkeley_db_minor != -1) {
28504     if (minor < $apu_check_berkeley_db_minor)
28505       exit (1);
28506     if (minor > $apu_check_berkeley_db_minor)
28507       exit (0);
28508   }
28509
28510   if ($apu_check_berkeley_db_patch == -1
28511       || patch >= $apu_check_berkeley_db_patch)
28512     exit (0);
28513   else
28514     exit (1);
28515 }
28516
28517 _ACEOF
28518 rm -f conftest$ac_exeext
28519 if { (ac_try="$ac_link"
28520 case "(($ac_try" in
28521   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28522   *) ac_try_echo=$ac_try;;
28523 esac
28524 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
28525 $as_echo "$ac_try_echo") >&5
28526   (eval "$ac_link") 2>&5
28527   ac_status=$?
28528   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
28529   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
28530   { (case "(($ac_try" in
28531   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28532   *) ac_try_echo=$ac_try;;
28533 esac
28534 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
28535 $as_echo "$ac_try_echo") >&5
28536   (eval "$ac_try") 2>&5
28537   ac_status=$?
28538   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
28539   (exit $ac_status); }; }; then
28540   apu_try_berkeley_db=yes
28541 else
28542   $as_echo "$as_me: program exited with status $ac_status" >&5
28543 $as_echo "$as_me: failed program was:" >&5
28544 sed 's/^/| /' conftest.$ac_ext >&5
28545
28546 ( exit $ac_status )
28547 apu_try_berkeley_db=no
28548 fi
28549 rm -rf conftest.dSYM
28550 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
28551 fi
28552
28553
28554
28555     LIBS="$apu_try_berkeley_db_save_libs"
28556
28557
28558                 eval "$cache_id=$apu_try_berkeley_db"
28559
28560 fi
28561
28562             result="`eval echo '$'$cache_id`"
28563             { $as_echo "$as_me:$LINENO: result: $result" >&5
28564 $as_echo "$result" >&6; }
28565           elif test ""4"" = "1"; then
28566             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
28567 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
28568 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
28569 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
28570   $as_echo_n "(cached) " >&6
28571 else
28572   ac_check_lib_save_LIBS=$LIBS
28573 LIBS="-l$bdb_libname  $LIBS"
28574 cat >conftest.$ac_ext <<_ACEOF
28575 /* confdefs.h.  */
28576 _ACEOF
28577 cat confdefs.h >>conftest.$ac_ext
28578 cat >>conftest.$ac_ext <<_ACEOF
28579 /* end confdefs.h.  */
28580
28581 /* Override any GCC internal prototype to avoid an error.
28582    Use char because int might match the return type of a GCC
28583    builtin and then its argument prototype would still apply.  */
28584 #ifdef __cplusplus
28585 extern "C"
28586 #endif
28587 char dbopen ();
28588 int
28589 main ()
28590 {
28591 return dbopen ();
28592   ;
28593   return 0;
28594 }
28595 _ACEOF
28596 rm -f conftest.$ac_objext conftest$ac_exeext
28597 if { (ac_try="$ac_link"
28598 case "(($ac_try" in
28599   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28600   *) ac_try_echo=$ac_try;;
28601 esac
28602 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
28603 $as_echo "$ac_try_echo") >&5
28604   (eval "$ac_link") 2>conftest.er1
28605   ac_status=$?
28606   grep -v '^ *+' conftest.er1 >conftest.err
28607   rm -f conftest.er1
28608   cat conftest.err >&5
28609   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
28610   (exit $ac_status); } && {
28611          test -z "$ac_c_werror_flag" ||
28612          test ! -s conftest.err
28613        } && test -s conftest$ac_exeext && {
28614          test "$cross_compiling" = yes ||
28615          $as_test_x conftest$ac_exeext
28616        }; then
28617   eval "$as_ac_Lib=yes"
28618 else
28619   $as_echo "$as_me: failed program was:" >&5
28620 sed 's/^/| /' conftest.$ac_ext >&5
28621
28622         eval "$as_ac_Lib=no"
28623 fi
28624
28625 rm -rf conftest.dSYM
28626 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
28627       conftest$ac_exeext conftest.$ac_ext
28628 LIBS=$ac_check_lib_save_LIBS
28629 fi
28630 ac_res=`eval 'as_val=${'$as_ac_Lib'}
28631                  $as_echo "$as_val"'`
28632                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
28633 $as_echo "$ac_res" >&6; }
28634 as_val=`eval 'as_val=${'$as_ac_Lib'}
28635                  $as_echo "$as_val"'`
28636    if test "x$as_val" = x""yes; then
28637   result=yes
28638 else
28639   result=no
28640
28641 fi
28642
28643           elif test ""4"" = "2"; then
28644             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
28645 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
28646 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
28647 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
28648   $as_echo_n "(cached) " >&6
28649 else
28650   ac_check_lib_save_LIBS=$LIBS
28651 LIBS="-l$bdb_libname  $LIBS"
28652 cat >conftest.$ac_ext <<_ACEOF
28653 /* confdefs.h.  */
28654 _ACEOF
28655 cat confdefs.h >>conftest.$ac_ext
28656 cat >>conftest.$ac_ext <<_ACEOF
28657 /* end confdefs.h.  */
28658
28659 /* Override any GCC internal prototype to avoid an error.
28660    Use char because int might match the return type of a GCC
28661    builtin and then its argument prototype would still apply.  */
28662 #ifdef __cplusplus
28663 extern "C"
28664 #endif
28665 char db_open ();
28666 int
28667 main ()
28668 {
28669 return db_open ();
28670   ;
28671   return 0;
28672 }
28673 _ACEOF
28674 rm -f conftest.$ac_objext conftest$ac_exeext
28675 if { (ac_try="$ac_link"
28676 case "(($ac_try" in
28677   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28678   *) ac_try_echo=$ac_try;;
28679 esac
28680 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
28681 $as_echo "$ac_try_echo") >&5
28682   (eval "$ac_link") 2>conftest.er1
28683   ac_status=$?
28684   grep -v '^ *+' conftest.er1 >conftest.err
28685   rm -f conftest.er1
28686   cat conftest.err >&5
28687   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
28688   (exit $ac_status); } && {
28689          test -z "$ac_c_werror_flag" ||
28690          test ! -s conftest.err
28691        } && test -s conftest$ac_exeext && {
28692          test "$cross_compiling" = yes ||
28693          $as_test_x conftest$ac_exeext
28694        }; then
28695   eval "$as_ac_Lib=yes"
28696 else
28697   $as_echo "$as_me: failed program was:" >&5
28698 sed 's/^/| /' conftest.$ac_ext >&5
28699
28700         eval "$as_ac_Lib=no"
28701 fi
28702
28703 rm -rf conftest.dSYM
28704 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
28705       conftest$ac_exeext conftest.$ac_ext
28706 LIBS=$ac_check_lib_save_LIBS
28707 fi
28708 ac_res=`eval 'as_val=${'$as_ac_Lib'}
28709                  $as_echo "$as_val"'`
28710                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
28711 $as_echo "$ac_res" >&6; }
28712 as_val=`eval 'as_val=${'$as_ac_Lib'}
28713                  $as_echo "$as_val"'`
28714    if test "x$as_val" = x""yes; then
28715   result=yes
28716 else
28717   result=no
28718
28719 fi
28720
28721           fi
28722
28723 else
28724   result="no"
28725 fi
28726
28727
28728
28729         # If we found it, no need to search any more.
28730         if test "$result" = "yes"; then
28731           found="$bdb_place"
28732           break
28733         fi
28734       done
28735       test "$found" != "not" && break
28736     done
28737     test "$found" != "not" && break
28738   done
28739
28740   # Restore the original values of the flags we tweak.
28741   LDFLAGS="$apu_check_lib_save_ldflags"
28742   CPPFLAGS="$apu_check_lib_save_cppflags"
28743
28744   case "$found" in
28745   "not")
28746     apu_have_db=0
28747     ;;
28748   "std")
28749     apu_db_header=$bdb_header
28750     apu_db_lib=$bdb_libname
28751     apu_have_db=1
28752     ;;
28753   *":"*)
28754     header="`echo $found | sed -e 's/:.*$//'`"
28755     lib="`echo $found | sed -e 's/^.*://'`"
28756
28757
28758   if test "x$APRUTIL_INCLUDES" = "x"; then
28759     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
28760     APRUTIL_INCLUDES="-I$header"
28761   else
28762     apr_addto_bugger="-I$header"
28763     for i in $apr_addto_bugger; do
28764       apr_addto_duplicate="0"
28765       for j in $APRUTIL_INCLUDES; do
28766         if test "x$i" = "x$j"; then
28767           apr_addto_duplicate="1"
28768           break
28769         fi
28770       done
28771       if test $apr_addto_duplicate = "0"; then
28772         echo "  adding \"$i\" to APRUTIL_INCLUDES"
28773         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
28774       fi
28775     done
28776   fi
28777
28778
28779   if test "x$APRUTIL_LDFLAGS" = "x"; then
28780     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
28781     APRUTIL_LDFLAGS="-L$lib"
28782   else
28783     apr_addto_bugger="-L$lib"
28784     for i in $apr_addto_bugger; do
28785       apr_addto_duplicate="0"
28786       for j in $APRUTIL_LDFLAGS; do
28787         if test "x$i" = "x$j"; then
28788           apr_addto_duplicate="1"
28789           break
28790         fi
28791       done
28792       if test $apr_addto_duplicate = "0"; then
28793         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
28794         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
28795       fi
28796     done
28797   fi
28798
28799     apu_db_header=$bdb_header
28800     apu_db_lib=$bdb_libname
28801     apu_have_db=1
28802     ;;
28803   *)
28804
28805   if test "x$APRUTIL_INCLUDES" = "x"; then
28806     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
28807     APRUTIL_INCLUDES="-I$found/include"
28808   else
28809     apr_addto_bugger="-I$found/include"
28810     for i in $apr_addto_bugger; do
28811       apr_addto_duplicate="0"
28812       for j in $APRUTIL_INCLUDES; do
28813         if test "x$i" = "x$j"; then
28814           apr_addto_duplicate="1"
28815           break
28816         fi
28817       done
28818       if test $apr_addto_duplicate = "0"; then
28819         echo "  adding \"$i\" to APRUTIL_INCLUDES"
28820         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
28821       fi
28822     done
28823   fi
28824
28825
28826   if test "x$APRUTIL_LDFLAGS" = "x"; then
28827     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
28828     APRUTIL_LDFLAGS="-L$found/lib"
28829   else
28830     apr_addto_bugger="-L$found/lib"
28831     for i in $apr_addto_bugger; do
28832       apr_addto_duplicate="0"
28833       for j in $APRUTIL_LDFLAGS; do
28834         if test "x$i" = "x$j"; then
28835           apr_addto_duplicate="1"
28836           break
28837         fi
28838       done
28839       if test $apr_addto_duplicate = "0"; then
28840         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
28841         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
28842       fi
28843     done
28844   fi
28845
28846     apu_db_header=$bdb_header
28847     apu_db_lib=$bdb_libname
28848     apu_have_db=1
28849     ;;
28850   esac
28851
28852   if test "$apu_have_db" = "1"; then
28853     apu_db_version=4
28854   fi
28855
28856           if test "$apu_db_version" != "4"; then
28857
28858   places="$all_places"
28859   if test -z "$places"; then
28860     places="std /usr/local/BerkeleyDB.4.3 /boot/home/config"
28861   fi
28862
28863   bdb_version="4"
28864   if test ""3"" != "-1"; then
28865     bdb_version="$bdb_version."3""
28866     if test ""-1"" != "-1"; then
28867       bdb_version="$bdb_version."-1""
28868     fi
28869   fi
28870   bdb_places="$places"
28871   bdb_default_search_headers="db43/db.h db4/db.h db.h"
28872   bdb_default_search_lib_names="db-4.3 db4-4.3 db43 db4 db"
28873
28874
28875   apu_have_db=0
28876
28877   # Save the original values of the flags we tweak.
28878   apu_check_lib_save_libs="$LIBS"
28879   apu_check_lib_save_ldflags="$LDFLAGS"
28880   apu_check_lib_save_cppflags="$CPPFLAGS"
28881
28882   # The variable `found' is the prefix under which we've found
28883   # Berkeley DB, or `not' if we haven't found it anywhere yet.
28884   found=not
28885   for bdb_place in $bdb_places; do
28886
28887     LDFLAGS="$apu_check_lib_save_ldflags"
28888     CPPFLAGS="$apu_check_lib_save_cppflags"
28889     case "$bdb_place" in
28890       "std" )
28891         description="the standard places"
28892       ;;
28893       *":"* )
28894         header="`echo $bdb_place | sed -e 's/:.*$//'`"
28895         lib="`echo $bdb_place | sed -e 's/^.*://'`"
28896         CPPFLAGS="$CPPFLAGS -I$header"
28897         LDFLAGS="$LDFLAGS -L$lib"
28898         description="$header and $lib"
28899       ;;
28900       * )
28901         if test -d $bdb_place; then
28902           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
28903           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
28904         else
28905           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
28906 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
28907           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
28908 $as_echo "directory not found" >&6; }
28909           continue
28910         fi
28911         description="$bdb_place"
28912       ;;
28913     esac
28914
28915     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
28916     # trick to display a message instead.
28917     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
28918 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
28919     { $as_echo "$as_me:$LINENO: result: " >&5
28920 $as_echo "" >&6; }
28921
28922     for bdb_libname in $bdb_default_search_lib_names; do
28923       for bdb_header in $bdb_default_search_headers; do
28924         # Clear the header cache variable for each location
28925
28926         cache_id="`echo ac_cv_header_${bdb_header} \
28927                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
28928
28929         unset $cache_id
28930         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
28931 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
28932   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
28933 $as_echo_n "checking for $bdb_header... " >&6; }
28934 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
28935   $as_echo_n "(cached) " >&6
28936 fi
28937 ac_res=`eval 'as_val=${'$as_ac_Header'}
28938                  $as_echo "$as_val"'`
28939                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
28940 $as_echo "$ac_res" >&6; }
28941 else
28942   # Is the header compilable?
28943 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
28944 $as_echo_n "checking $bdb_header usability... " >&6; }
28945 cat >conftest.$ac_ext <<_ACEOF
28946 /* confdefs.h.  */
28947 _ACEOF
28948 cat confdefs.h >>conftest.$ac_ext
28949 cat >>conftest.$ac_ext <<_ACEOF
28950 /* end confdefs.h.  */
28951 $ac_includes_default
28952 #include <$bdb_header>
28953 _ACEOF
28954 rm -f conftest.$ac_objext
28955 if { (ac_try="$ac_compile"
28956 case "(($ac_try" in
28957   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28958   *) ac_try_echo=$ac_try;;
28959 esac
28960 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
28961 $as_echo "$ac_try_echo") >&5
28962   (eval "$ac_compile") 2>conftest.er1
28963   ac_status=$?
28964   grep -v '^ *+' conftest.er1 >conftest.err
28965   rm -f conftest.er1
28966   cat conftest.err >&5
28967   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
28968   (exit $ac_status); } && {
28969          test -z "$ac_c_werror_flag" ||
28970          test ! -s conftest.err
28971        } && test -s conftest.$ac_objext; then
28972   ac_header_compiler=yes
28973 else
28974   $as_echo "$as_me: failed program was:" >&5
28975 sed 's/^/| /' conftest.$ac_ext >&5
28976
28977         ac_header_compiler=no
28978 fi
28979
28980 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28981 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
28982 $as_echo "$ac_header_compiler" >&6; }
28983
28984 # Is the header present?
28985 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
28986 $as_echo_n "checking $bdb_header presence... " >&6; }
28987 cat >conftest.$ac_ext <<_ACEOF
28988 /* confdefs.h.  */
28989 _ACEOF
28990 cat confdefs.h >>conftest.$ac_ext
28991 cat >>conftest.$ac_ext <<_ACEOF
28992 /* end confdefs.h.  */
28993 #include <$bdb_header>
28994 _ACEOF
28995 if { (ac_try="$ac_cpp conftest.$ac_ext"
28996 case "(($ac_try" in
28997   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28998   *) ac_try_echo=$ac_try;;
28999 esac
29000 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29001 $as_echo "$ac_try_echo") >&5
29002   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
29003   ac_status=$?
29004   grep -v '^ *+' conftest.er1 >conftest.err
29005   rm -f conftest.er1
29006   cat conftest.err >&5
29007   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29008   (exit $ac_status); } >/dev/null && {
29009          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
29010          test ! -s conftest.err
29011        }; then
29012   ac_header_preproc=yes
29013 else
29014   $as_echo "$as_me: failed program was:" >&5
29015 sed 's/^/| /' conftest.$ac_ext >&5
29016
29017   ac_header_preproc=no
29018 fi
29019
29020 rm -f conftest.err conftest.$ac_ext
29021 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
29022 $as_echo "$ac_header_preproc" >&6; }
29023
29024 # So?  What about this header?
29025 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
29026   yes:no: )
29027     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
29028 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
29029     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
29030 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
29031     ac_header_preproc=yes
29032     ;;
29033   no:yes:* )
29034     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
29035 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
29036     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
29037 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
29038     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
29039 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
29040     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
29041 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
29042     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
29043 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
29044     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
29045 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
29046
29047     ;;
29048 esac
29049 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
29050 $as_echo_n "checking for $bdb_header... " >&6; }
29051 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
29052   $as_echo_n "(cached) " >&6
29053 else
29054   eval "$as_ac_Header=\$ac_header_preproc"
29055 fi
29056 ac_res=`eval 'as_val=${'$as_ac_Header'}
29057                  $as_echo "$as_val"'`
29058                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
29059 $as_echo "$ac_res" >&6; }
29060
29061 fi
29062 as_val=`eval 'as_val=${'$as_ac_Header'}
29063                  $as_echo "$as_val"'`
29064    if test "x$as_val" = x""yes; then
29065
29066           if test ""4"" = "3" -o ""4"" = "4"; then
29067             # We generate a separate cache variable for each prefix and libname
29068             # we search under.  That way, we avoid caching information that
29069             # changes if the user runs `configure' with a different set of
29070             # switches.
29071
29072             cache_id="`echo apu_cv_check_berkeley_db_"4"_"3"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
29073                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
29074
29075
29076             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
29077 $as_echo_n "checking for -l$bdb_libname... " >&6; }
29078                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
29079   $as_echo_n "(cached) " >&6
29080 else
29081
29082
29083     apu_try_berkeley_db_save_libs="$LIBS"
29084
29085     apu_check_berkeley_db_major="4"
29086     apu_check_berkeley_db_minor="3"
29087     apu_check_berkeley_db_patch="-1"
29088     apu_try_berkeley_db_header=$bdb_header
29089     apu_try_berkeley_db_libname=$bdb_libname
29090
29091     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
29092     if test "$cross_compiling" = yes; then
29093   apu_try_berkeley_db=yes
29094
29095 else
29096   cat >conftest.$ac_ext <<_ACEOF
29097 /* confdefs.h.  */
29098 _ACEOF
29099 cat confdefs.h >>conftest.$ac_ext
29100 cat >>conftest.$ac_ext <<_ACEOF
29101 /* end confdefs.h.  */
29102
29103 #include <stdlib.h>
29104 #include <stdio.h>
29105 #include <$apu_try_berkeley_db_header>
29106 main ()
29107 {
29108   int major, minor, patch;
29109
29110   db_version(&major, &minor, &patch);
29111
29112   /* Sanity check: ensure that db.h constants actually match the db library */
29113   if (major != DB_VERSION_MAJOR
29114       || minor != DB_VERSION_MINOR
29115       || patch != DB_VERSION_PATCH)
29116     exit (1);
29117
29118   /* Run-time check:  ensure the library claims to be the correct version. */
29119
29120   if ($apu_check_berkeley_db_major != -1) {
29121     if (major < $apu_check_berkeley_db_major)
29122       exit (1);
29123     if (major > $apu_check_berkeley_db_major)
29124       exit (0);
29125   }
29126
29127   if ($apu_check_berkeley_db_minor != -1) {
29128     if (minor < $apu_check_berkeley_db_minor)
29129       exit (1);
29130     if (minor > $apu_check_berkeley_db_minor)
29131       exit (0);
29132   }
29133
29134   if ($apu_check_berkeley_db_patch == -1
29135       || patch >= $apu_check_berkeley_db_patch)
29136     exit (0);
29137   else
29138     exit (1);
29139 }
29140
29141 _ACEOF
29142 rm -f conftest$ac_exeext
29143 if { (ac_try="$ac_link"
29144 case "(($ac_try" in
29145   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29146   *) ac_try_echo=$ac_try;;
29147 esac
29148 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29149 $as_echo "$ac_try_echo") >&5
29150   (eval "$ac_link") 2>&5
29151   ac_status=$?
29152   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29153   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
29154   { (case "(($ac_try" in
29155   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29156   *) ac_try_echo=$ac_try;;
29157 esac
29158 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29159 $as_echo "$ac_try_echo") >&5
29160   (eval "$ac_try") 2>&5
29161   ac_status=$?
29162   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29163   (exit $ac_status); }; }; then
29164   apu_try_berkeley_db=yes
29165 else
29166   $as_echo "$as_me: program exited with status $ac_status" >&5
29167 $as_echo "$as_me: failed program was:" >&5
29168 sed 's/^/| /' conftest.$ac_ext >&5
29169
29170 ( exit $ac_status )
29171 apu_try_berkeley_db=no
29172 fi
29173 rm -rf conftest.dSYM
29174 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
29175 fi
29176
29177
29178
29179     LIBS="$apu_try_berkeley_db_save_libs"
29180
29181
29182                 eval "$cache_id=$apu_try_berkeley_db"
29183
29184 fi
29185
29186             result="`eval echo '$'$cache_id`"
29187             { $as_echo "$as_me:$LINENO: result: $result" >&5
29188 $as_echo "$result" >&6; }
29189           elif test ""4"" = "1"; then
29190             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
29191 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
29192 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
29193 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
29194   $as_echo_n "(cached) " >&6
29195 else
29196   ac_check_lib_save_LIBS=$LIBS
29197 LIBS="-l$bdb_libname  $LIBS"
29198 cat >conftest.$ac_ext <<_ACEOF
29199 /* confdefs.h.  */
29200 _ACEOF
29201 cat confdefs.h >>conftest.$ac_ext
29202 cat >>conftest.$ac_ext <<_ACEOF
29203 /* end confdefs.h.  */
29204
29205 /* Override any GCC internal prototype to avoid an error.
29206    Use char because int might match the return type of a GCC
29207    builtin and then its argument prototype would still apply.  */
29208 #ifdef __cplusplus
29209 extern "C"
29210 #endif
29211 char dbopen ();
29212 int
29213 main ()
29214 {
29215 return dbopen ();
29216   ;
29217   return 0;
29218 }
29219 _ACEOF
29220 rm -f conftest.$ac_objext conftest$ac_exeext
29221 if { (ac_try="$ac_link"
29222 case "(($ac_try" in
29223   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29224   *) ac_try_echo=$ac_try;;
29225 esac
29226 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29227 $as_echo "$ac_try_echo") >&5
29228   (eval "$ac_link") 2>conftest.er1
29229   ac_status=$?
29230   grep -v '^ *+' conftest.er1 >conftest.err
29231   rm -f conftest.er1
29232   cat conftest.err >&5
29233   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29234   (exit $ac_status); } && {
29235          test -z "$ac_c_werror_flag" ||
29236          test ! -s conftest.err
29237        } && test -s conftest$ac_exeext && {
29238          test "$cross_compiling" = yes ||
29239          $as_test_x conftest$ac_exeext
29240        }; then
29241   eval "$as_ac_Lib=yes"
29242 else
29243   $as_echo "$as_me: failed program was:" >&5
29244 sed 's/^/| /' conftest.$ac_ext >&5
29245
29246         eval "$as_ac_Lib=no"
29247 fi
29248
29249 rm -rf conftest.dSYM
29250 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
29251       conftest$ac_exeext conftest.$ac_ext
29252 LIBS=$ac_check_lib_save_LIBS
29253 fi
29254 ac_res=`eval 'as_val=${'$as_ac_Lib'}
29255                  $as_echo "$as_val"'`
29256                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
29257 $as_echo "$ac_res" >&6; }
29258 as_val=`eval 'as_val=${'$as_ac_Lib'}
29259                  $as_echo "$as_val"'`
29260    if test "x$as_val" = x""yes; then
29261   result=yes
29262 else
29263   result=no
29264
29265 fi
29266
29267           elif test ""4"" = "2"; then
29268             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
29269 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
29270 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
29271 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
29272   $as_echo_n "(cached) " >&6
29273 else
29274   ac_check_lib_save_LIBS=$LIBS
29275 LIBS="-l$bdb_libname  $LIBS"
29276 cat >conftest.$ac_ext <<_ACEOF
29277 /* confdefs.h.  */
29278 _ACEOF
29279 cat confdefs.h >>conftest.$ac_ext
29280 cat >>conftest.$ac_ext <<_ACEOF
29281 /* end confdefs.h.  */
29282
29283 /* Override any GCC internal prototype to avoid an error.
29284    Use char because int might match the return type of a GCC
29285    builtin and then its argument prototype would still apply.  */
29286 #ifdef __cplusplus
29287 extern "C"
29288 #endif
29289 char db_open ();
29290 int
29291 main ()
29292 {
29293 return db_open ();
29294   ;
29295   return 0;
29296 }
29297 _ACEOF
29298 rm -f conftest.$ac_objext conftest$ac_exeext
29299 if { (ac_try="$ac_link"
29300 case "(($ac_try" in
29301   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29302   *) ac_try_echo=$ac_try;;
29303 esac
29304 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29305 $as_echo "$ac_try_echo") >&5
29306   (eval "$ac_link") 2>conftest.er1
29307   ac_status=$?
29308   grep -v '^ *+' conftest.er1 >conftest.err
29309   rm -f conftest.er1
29310   cat conftest.err >&5
29311   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29312   (exit $ac_status); } && {
29313          test -z "$ac_c_werror_flag" ||
29314          test ! -s conftest.err
29315        } && test -s conftest$ac_exeext && {
29316          test "$cross_compiling" = yes ||
29317          $as_test_x conftest$ac_exeext
29318        }; then
29319   eval "$as_ac_Lib=yes"
29320 else
29321   $as_echo "$as_me: failed program was:" >&5
29322 sed 's/^/| /' conftest.$ac_ext >&5
29323
29324         eval "$as_ac_Lib=no"
29325 fi
29326
29327 rm -rf conftest.dSYM
29328 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
29329       conftest$ac_exeext conftest.$ac_ext
29330 LIBS=$ac_check_lib_save_LIBS
29331 fi
29332 ac_res=`eval 'as_val=${'$as_ac_Lib'}
29333                  $as_echo "$as_val"'`
29334                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
29335 $as_echo "$ac_res" >&6; }
29336 as_val=`eval 'as_val=${'$as_ac_Lib'}
29337                  $as_echo "$as_val"'`
29338    if test "x$as_val" = x""yes; then
29339   result=yes
29340 else
29341   result=no
29342
29343 fi
29344
29345           fi
29346
29347 else
29348   result="no"
29349 fi
29350
29351
29352
29353         # If we found it, no need to search any more.
29354         if test "$result" = "yes"; then
29355           found="$bdb_place"
29356           break
29357         fi
29358       done
29359       test "$found" != "not" && break
29360     done
29361     test "$found" != "not" && break
29362   done
29363
29364   # Restore the original values of the flags we tweak.
29365   LDFLAGS="$apu_check_lib_save_ldflags"
29366   CPPFLAGS="$apu_check_lib_save_cppflags"
29367
29368   case "$found" in
29369   "not")
29370     apu_have_db=0
29371     ;;
29372   "std")
29373     apu_db_header=$bdb_header
29374     apu_db_lib=$bdb_libname
29375     apu_have_db=1
29376     ;;
29377   *":"*)
29378     header="`echo $found | sed -e 's/:.*$//'`"
29379     lib="`echo $found | sed -e 's/^.*://'`"
29380
29381
29382   if test "x$APRUTIL_INCLUDES" = "x"; then
29383     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
29384     APRUTIL_INCLUDES="-I$header"
29385   else
29386     apr_addto_bugger="-I$header"
29387     for i in $apr_addto_bugger; do
29388       apr_addto_duplicate="0"
29389       for j in $APRUTIL_INCLUDES; do
29390         if test "x$i" = "x$j"; then
29391           apr_addto_duplicate="1"
29392           break
29393         fi
29394       done
29395       if test $apr_addto_duplicate = "0"; then
29396         echo "  adding \"$i\" to APRUTIL_INCLUDES"
29397         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
29398       fi
29399     done
29400   fi
29401
29402
29403   if test "x$APRUTIL_LDFLAGS" = "x"; then
29404     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
29405     APRUTIL_LDFLAGS="-L$lib"
29406   else
29407     apr_addto_bugger="-L$lib"
29408     for i in $apr_addto_bugger; do
29409       apr_addto_duplicate="0"
29410       for j in $APRUTIL_LDFLAGS; do
29411         if test "x$i" = "x$j"; then
29412           apr_addto_duplicate="1"
29413           break
29414         fi
29415       done
29416       if test $apr_addto_duplicate = "0"; then
29417         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
29418         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
29419       fi
29420     done
29421   fi
29422
29423     apu_db_header=$bdb_header
29424     apu_db_lib=$bdb_libname
29425     apu_have_db=1
29426     ;;
29427   *)
29428
29429   if test "x$APRUTIL_INCLUDES" = "x"; then
29430     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
29431     APRUTIL_INCLUDES="-I$found/include"
29432   else
29433     apr_addto_bugger="-I$found/include"
29434     for i in $apr_addto_bugger; do
29435       apr_addto_duplicate="0"
29436       for j in $APRUTIL_INCLUDES; do
29437         if test "x$i" = "x$j"; then
29438           apr_addto_duplicate="1"
29439           break
29440         fi
29441       done
29442       if test $apr_addto_duplicate = "0"; then
29443         echo "  adding \"$i\" to APRUTIL_INCLUDES"
29444         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
29445       fi
29446     done
29447   fi
29448
29449
29450   if test "x$APRUTIL_LDFLAGS" = "x"; then
29451     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
29452     APRUTIL_LDFLAGS="-L$found/lib"
29453   else
29454     apr_addto_bugger="-L$found/lib"
29455     for i in $apr_addto_bugger; do
29456       apr_addto_duplicate="0"
29457       for j in $APRUTIL_LDFLAGS; do
29458         if test "x$i" = "x$j"; then
29459           apr_addto_duplicate="1"
29460           break
29461         fi
29462       done
29463       if test $apr_addto_duplicate = "0"; then
29464         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
29465         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
29466       fi
29467     done
29468   fi
29469
29470     apu_db_header=$bdb_header
29471     apu_db_lib=$bdb_libname
29472     apu_have_db=1
29473     ;;
29474   esac
29475
29476   if test "$apu_have_db" = "1"; then
29477     apu_db_version=4
29478   fi
29479
29480             if test "$apu_db_version" != "4"; then
29481
29482   places="$all_places"
29483   if test -z "$places"; then
29484     places="std /usr/local /usr/local/BerkeleyDB.4.2 /boot/home/config"
29485   fi
29486
29487   bdb_version="4"
29488   if test ""2"" != "-1"; then
29489     bdb_version="$bdb_version."2""
29490     if test ""-1"" != "-1"; then
29491       bdb_version="$bdb_version."-1""
29492     fi
29493   fi
29494   bdb_places="$places"
29495   bdb_default_search_headers="db42/db.h db4/db.h db.h"
29496   bdb_default_search_lib_names="db-4.2 db42 db4 db"
29497
29498
29499   apu_have_db=0
29500
29501   # Save the original values of the flags we tweak.
29502   apu_check_lib_save_libs="$LIBS"
29503   apu_check_lib_save_ldflags="$LDFLAGS"
29504   apu_check_lib_save_cppflags="$CPPFLAGS"
29505
29506   # The variable `found' is the prefix under which we've found
29507   # Berkeley DB, or `not' if we haven't found it anywhere yet.
29508   found=not
29509   for bdb_place in $bdb_places; do
29510
29511     LDFLAGS="$apu_check_lib_save_ldflags"
29512     CPPFLAGS="$apu_check_lib_save_cppflags"
29513     case "$bdb_place" in
29514       "std" )
29515         description="the standard places"
29516       ;;
29517       *":"* )
29518         header="`echo $bdb_place | sed -e 's/:.*$//'`"
29519         lib="`echo $bdb_place | sed -e 's/^.*://'`"
29520         CPPFLAGS="$CPPFLAGS -I$header"
29521         LDFLAGS="$LDFLAGS -L$lib"
29522         description="$header and $lib"
29523       ;;
29524       * )
29525         if test -d $bdb_place; then
29526           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
29527           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
29528         else
29529           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
29530 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
29531           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
29532 $as_echo "directory not found" >&6; }
29533           continue
29534         fi
29535         description="$bdb_place"
29536       ;;
29537     esac
29538
29539     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
29540     # trick to display a message instead.
29541     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
29542 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
29543     { $as_echo "$as_me:$LINENO: result: " >&5
29544 $as_echo "" >&6; }
29545
29546     for bdb_libname in $bdb_default_search_lib_names; do
29547       for bdb_header in $bdb_default_search_headers; do
29548         # Clear the header cache variable for each location
29549
29550         cache_id="`echo ac_cv_header_${bdb_header} \
29551                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
29552
29553         unset $cache_id
29554         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
29555 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
29556   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
29557 $as_echo_n "checking for $bdb_header... " >&6; }
29558 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
29559   $as_echo_n "(cached) " >&6
29560 fi
29561 ac_res=`eval 'as_val=${'$as_ac_Header'}
29562                  $as_echo "$as_val"'`
29563                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
29564 $as_echo "$ac_res" >&6; }
29565 else
29566   # Is the header compilable?
29567 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
29568 $as_echo_n "checking $bdb_header usability... " >&6; }
29569 cat >conftest.$ac_ext <<_ACEOF
29570 /* confdefs.h.  */
29571 _ACEOF
29572 cat confdefs.h >>conftest.$ac_ext
29573 cat >>conftest.$ac_ext <<_ACEOF
29574 /* end confdefs.h.  */
29575 $ac_includes_default
29576 #include <$bdb_header>
29577 _ACEOF
29578 rm -f conftest.$ac_objext
29579 if { (ac_try="$ac_compile"
29580 case "(($ac_try" in
29581   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29582   *) ac_try_echo=$ac_try;;
29583 esac
29584 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29585 $as_echo "$ac_try_echo") >&5
29586   (eval "$ac_compile") 2>conftest.er1
29587   ac_status=$?
29588   grep -v '^ *+' conftest.er1 >conftest.err
29589   rm -f conftest.er1
29590   cat conftest.err >&5
29591   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29592   (exit $ac_status); } && {
29593          test -z "$ac_c_werror_flag" ||
29594          test ! -s conftest.err
29595        } && test -s conftest.$ac_objext; then
29596   ac_header_compiler=yes
29597 else
29598   $as_echo "$as_me: failed program was:" >&5
29599 sed 's/^/| /' conftest.$ac_ext >&5
29600
29601         ac_header_compiler=no
29602 fi
29603
29604 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
29605 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
29606 $as_echo "$ac_header_compiler" >&6; }
29607
29608 # Is the header present?
29609 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
29610 $as_echo_n "checking $bdb_header presence... " >&6; }
29611 cat >conftest.$ac_ext <<_ACEOF
29612 /* confdefs.h.  */
29613 _ACEOF
29614 cat confdefs.h >>conftest.$ac_ext
29615 cat >>conftest.$ac_ext <<_ACEOF
29616 /* end confdefs.h.  */
29617 #include <$bdb_header>
29618 _ACEOF
29619 if { (ac_try="$ac_cpp conftest.$ac_ext"
29620 case "(($ac_try" in
29621   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29622   *) ac_try_echo=$ac_try;;
29623 esac
29624 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29625 $as_echo "$ac_try_echo") >&5
29626   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
29627   ac_status=$?
29628   grep -v '^ *+' conftest.er1 >conftest.err
29629   rm -f conftest.er1
29630   cat conftest.err >&5
29631   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29632   (exit $ac_status); } >/dev/null && {
29633          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
29634          test ! -s conftest.err
29635        }; then
29636   ac_header_preproc=yes
29637 else
29638   $as_echo "$as_me: failed program was:" >&5
29639 sed 's/^/| /' conftest.$ac_ext >&5
29640
29641   ac_header_preproc=no
29642 fi
29643
29644 rm -f conftest.err conftest.$ac_ext
29645 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
29646 $as_echo "$ac_header_preproc" >&6; }
29647
29648 # So?  What about this header?
29649 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
29650   yes:no: )
29651     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
29652 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
29653     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
29654 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
29655     ac_header_preproc=yes
29656     ;;
29657   no:yes:* )
29658     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
29659 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
29660     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
29661 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
29662     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
29663 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
29664     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
29665 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
29666     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
29667 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
29668     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
29669 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
29670
29671     ;;
29672 esac
29673 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
29674 $as_echo_n "checking for $bdb_header... " >&6; }
29675 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
29676   $as_echo_n "(cached) " >&6
29677 else
29678   eval "$as_ac_Header=\$ac_header_preproc"
29679 fi
29680 ac_res=`eval 'as_val=${'$as_ac_Header'}
29681                  $as_echo "$as_val"'`
29682                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
29683 $as_echo "$ac_res" >&6; }
29684
29685 fi
29686 as_val=`eval 'as_val=${'$as_ac_Header'}
29687                  $as_echo "$as_val"'`
29688    if test "x$as_val" = x""yes; then
29689
29690           if test ""4"" = "3" -o ""4"" = "4"; then
29691             # We generate a separate cache variable for each prefix and libname
29692             # we search under.  That way, we avoid caching information that
29693             # changes if the user runs `configure' with a different set of
29694             # switches.
29695
29696             cache_id="`echo apu_cv_check_berkeley_db_"4"_"2"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
29697                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
29698
29699
29700             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
29701 $as_echo_n "checking for -l$bdb_libname... " >&6; }
29702                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
29703   $as_echo_n "(cached) " >&6
29704 else
29705
29706
29707     apu_try_berkeley_db_save_libs="$LIBS"
29708
29709     apu_check_berkeley_db_major="4"
29710     apu_check_berkeley_db_minor="2"
29711     apu_check_berkeley_db_patch="-1"
29712     apu_try_berkeley_db_header=$bdb_header
29713     apu_try_berkeley_db_libname=$bdb_libname
29714
29715     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
29716     if test "$cross_compiling" = yes; then
29717   apu_try_berkeley_db=yes
29718
29719 else
29720   cat >conftest.$ac_ext <<_ACEOF
29721 /* confdefs.h.  */
29722 _ACEOF
29723 cat confdefs.h >>conftest.$ac_ext
29724 cat >>conftest.$ac_ext <<_ACEOF
29725 /* end confdefs.h.  */
29726
29727 #include <stdlib.h>
29728 #include <stdio.h>
29729 #include <$apu_try_berkeley_db_header>
29730 main ()
29731 {
29732   int major, minor, patch;
29733
29734   db_version(&major, &minor, &patch);
29735
29736   /* Sanity check: ensure that db.h constants actually match the db library */
29737   if (major != DB_VERSION_MAJOR
29738       || minor != DB_VERSION_MINOR
29739       || patch != DB_VERSION_PATCH)
29740     exit (1);
29741
29742   /* Run-time check:  ensure the library claims to be the correct version. */
29743
29744   if ($apu_check_berkeley_db_major != -1) {
29745     if (major < $apu_check_berkeley_db_major)
29746       exit (1);
29747     if (major > $apu_check_berkeley_db_major)
29748       exit (0);
29749   }
29750
29751   if ($apu_check_berkeley_db_minor != -1) {
29752     if (minor < $apu_check_berkeley_db_minor)
29753       exit (1);
29754     if (minor > $apu_check_berkeley_db_minor)
29755       exit (0);
29756   }
29757
29758   if ($apu_check_berkeley_db_patch == -1
29759       || patch >= $apu_check_berkeley_db_patch)
29760     exit (0);
29761   else
29762     exit (1);
29763 }
29764
29765 _ACEOF
29766 rm -f conftest$ac_exeext
29767 if { (ac_try="$ac_link"
29768 case "(($ac_try" in
29769   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29770   *) ac_try_echo=$ac_try;;
29771 esac
29772 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29773 $as_echo "$ac_try_echo") >&5
29774   (eval "$ac_link") 2>&5
29775   ac_status=$?
29776   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29777   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
29778   { (case "(($ac_try" in
29779   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29780   *) ac_try_echo=$ac_try;;
29781 esac
29782 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29783 $as_echo "$ac_try_echo") >&5
29784   (eval "$ac_try") 2>&5
29785   ac_status=$?
29786   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29787   (exit $ac_status); }; }; then
29788   apu_try_berkeley_db=yes
29789 else
29790   $as_echo "$as_me: program exited with status $ac_status" >&5
29791 $as_echo "$as_me: failed program was:" >&5
29792 sed 's/^/| /' conftest.$ac_ext >&5
29793
29794 ( exit $ac_status )
29795 apu_try_berkeley_db=no
29796 fi
29797 rm -rf conftest.dSYM
29798 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
29799 fi
29800
29801
29802
29803     LIBS="$apu_try_berkeley_db_save_libs"
29804
29805
29806                 eval "$cache_id=$apu_try_berkeley_db"
29807
29808 fi
29809
29810             result="`eval echo '$'$cache_id`"
29811             { $as_echo "$as_me:$LINENO: result: $result" >&5
29812 $as_echo "$result" >&6; }
29813           elif test ""4"" = "1"; then
29814             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
29815 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
29816 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
29817 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
29818   $as_echo_n "(cached) " >&6
29819 else
29820   ac_check_lib_save_LIBS=$LIBS
29821 LIBS="-l$bdb_libname  $LIBS"
29822 cat >conftest.$ac_ext <<_ACEOF
29823 /* confdefs.h.  */
29824 _ACEOF
29825 cat confdefs.h >>conftest.$ac_ext
29826 cat >>conftest.$ac_ext <<_ACEOF
29827 /* end confdefs.h.  */
29828
29829 /* Override any GCC internal prototype to avoid an error.
29830    Use char because int might match the return type of a GCC
29831    builtin and then its argument prototype would still apply.  */
29832 #ifdef __cplusplus
29833 extern "C"
29834 #endif
29835 char dbopen ();
29836 int
29837 main ()
29838 {
29839 return dbopen ();
29840   ;
29841   return 0;
29842 }
29843 _ACEOF
29844 rm -f conftest.$ac_objext conftest$ac_exeext
29845 if { (ac_try="$ac_link"
29846 case "(($ac_try" in
29847   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29848   *) ac_try_echo=$ac_try;;
29849 esac
29850 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29851 $as_echo "$ac_try_echo") >&5
29852   (eval "$ac_link") 2>conftest.er1
29853   ac_status=$?
29854   grep -v '^ *+' conftest.er1 >conftest.err
29855   rm -f conftest.er1
29856   cat conftest.err >&5
29857   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29858   (exit $ac_status); } && {
29859          test -z "$ac_c_werror_flag" ||
29860          test ! -s conftest.err
29861        } && test -s conftest$ac_exeext && {
29862          test "$cross_compiling" = yes ||
29863          $as_test_x conftest$ac_exeext
29864        }; then
29865   eval "$as_ac_Lib=yes"
29866 else
29867   $as_echo "$as_me: failed program was:" >&5
29868 sed 's/^/| /' conftest.$ac_ext >&5
29869
29870         eval "$as_ac_Lib=no"
29871 fi
29872
29873 rm -rf conftest.dSYM
29874 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
29875       conftest$ac_exeext conftest.$ac_ext
29876 LIBS=$ac_check_lib_save_LIBS
29877 fi
29878 ac_res=`eval 'as_val=${'$as_ac_Lib'}
29879                  $as_echo "$as_val"'`
29880                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
29881 $as_echo "$ac_res" >&6; }
29882 as_val=`eval 'as_val=${'$as_ac_Lib'}
29883                  $as_echo "$as_val"'`
29884    if test "x$as_val" = x""yes; then
29885   result=yes
29886 else
29887   result=no
29888
29889 fi
29890
29891           elif test ""4"" = "2"; then
29892             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
29893 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
29894 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
29895 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
29896   $as_echo_n "(cached) " >&6
29897 else
29898   ac_check_lib_save_LIBS=$LIBS
29899 LIBS="-l$bdb_libname  $LIBS"
29900 cat >conftest.$ac_ext <<_ACEOF
29901 /* confdefs.h.  */
29902 _ACEOF
29903 cat confdefs.h >>conftest.$ac_ext
29904 cat >>conftest.$ac_ext <<_ACEOF
29905 /* end confdefs.h.  */
29906
29907 /* Override any GCC internal prototype to avoid an error.
29908    Use char because int might match the return type of a GCC
29909    builtin and then its argument prototype would still apply.  */
29910 #ifdef __cplusplus
29911 extern "C"
29912 #endif
29913 char db_open ();
29914 int
29915 main ()
29916 {
29917 return db_open ();
29918   ;
29919   return 0;
29920 }
29921 _ACEOF
29922 rm -f conftest.$ac_objext conftest$ac_exeext
29923 if { (ac_try="$ac_link"
29924 case "(($ac_try" in
29925   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
29926   *) ac_try_echo=$ac_try;;
29927 esac
29928 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
29929 $as_echo "$ac_try_echo") >&5
29930   (eval "$ac_link") 2>conftest.er1
29931   ac_status=$?
29932   grep -v '^ *+' conftest.er1 >conftest.err
29933   rm -f conftest.er1
29934   cat conftest.err >&5
29935   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
29936   (exit $ac_status); } && {
29937          test -z "$ac_c_werror_flag" ||
29938          test ! -s conftest.err
29939        } && test -s conftest$ac_exeext && {
29940          test "$cross_compiling" = yes ||
29941          $as_test_x conftest$ac_exeext
29942        }; then
29943   eval "$as_ac_Lib=yes"
29944 else
29945   $as_echo "$as_me: failed program was:" >&5
29946 sed 's/^/| /' conftest.$ac_ext >&5
29947
29948         eval "$as_ac_Lib=no"
29949 fi
29950
29951 rm -rf conftest.dSYM
29952 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
29953       conftest$ac_exeext conftest.$ac_ext
29954 LIBS=$ac_check_lib_save_LIBS
29955 fi
29956 ac_res=`eval 'as_val=${'$as_ac_Lib'}
29957                  $as_echo "$as_val"'`
29958                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
29959 $as_echo "$ac_res" >&6; }
29960 as_val=`eval 'as_val=${'$as_ac_Lib'}
29961                  $as_echo "$as_val"'`
29962    if test "x$as_val" = x""yes; then
29963   result=yes
29964 else
29965   result=no
29966
29967 fi
29968
29969           fi
29970
29971 else
29972   result="no"
29973 fi
29974
29975
29976
29977         # If we found it, no need to search any more.
29978         if test "$result" = "yes"; then
29979           found="$bdb_place"
29980           break
29981         fi
29982       done
29983       test "$found" != "not" && break
29984     done
29985     test "$found" != "not" && break
29986   done
29987
29988   # Restore the original values of the flags we tweak.
29989   LDFLAGS="$apu_check_lib_save_ldflags"
29990   CPPFLAGS="$apu_check_lib_save_cppflags"
29991
29992   case "$found" in
29993   "not")
29994     apu_have_db=0
29995     ;;
29996   "std")
29997     apu_db_header=$bdb_header
29998     apu_db_lib=$bdb_libname
29999     apu_have_db=1
30000     ;;
30001   *":"*)
30002     header="`echo $found | sed -e 's/:.*$//'`"
30003     lib="`echo $found | sed -e 's/^.*://'`"
30004
30005
30006   if test "x$APRUTIL_INCLUDES" = "x"; then
30007     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
30008     APRUTIL_INCLUDES="-I$header"
30009   else
30010     apr_addto_bugger="-I$header"
30011     for i in $apr_addto_bugger; do
30012       apr_addto_duplicate="0"
30013       for j in $APRUTIL_INCLUDES; do
30014         if test "x$i" = "x$j"; then
30015           apr_addto_duplicate="1"
30016           break
30017         fi
30018       done
30019       if test $apr_addto_duplicate = "0"; then
30020         echo "  adding \"$i\" to APRUTIL_INCLUDES"
30021         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
30022       fi
30023     done
30024   fi
30025
30026
30027   if test "x$APRUTIL_LDFLAGS" = "x"; then
30028     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
30029     APRUTIL_LDFLAGS="-L$lib"
30030   else
30031     apr_addto_bugger="-L$lib"
30032     for i in $apr_addto_bugger; do
30033       apr_addto_duplicate="0"
30034       for j in $APRUTIL_LDFLAGS; do
30035         if test "x$i" = "x$j"; then
30036           apr_addto_duplicate="1"
30037           break
30038         fi
30039       done
30040       if test $apr_addto_duplicate = "0"; then
30041         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
30042         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
30043       fi
30044     done
30045   fi
30046
30047     apu_db_header=$bdb_header
30048     apu_db_lib=$bdb_libname
30049     apu_have_db=1
30050     ;;
30051   *)
30052
30053   if test "x$APRUTIL_INCLUDES" = "x"; then
30054     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
30055     APRUTIL_INCLUDES="-I$found/include"
30056   else
30057     apr_addto_bugger="-I$found/include"
30058     for i in $apr_addto_bugger; do
30059       apr_addto_duplicate="0"
30060       for j in $APRUTIL_INCLUDES; do
30061         if test "x$i" = "x$j"; then
30062           apr_addto_duplicate="1"
30063           break
30064         fi
30065       done
30066       if test $apr_addto_duplicate = "0"; then
30067         echo "  adding \"$i\" to APRUTIL_INCLUDES"
30068         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
30069       fi
30070     done
30071   fi
30072
30073
30074   if test "x$APRUTIL_LDFLAGS" = "x"; then
30075     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
30076     APRUTIL_LDFLAGS="-L$found/lib"
30077   else
30078     apr_addto_bugger="-L$found/lib"
30079     for i in $apr_addto_bugger; do
30080       apr_addto_duplicate="0"
30081       for j in $APRUTIL_LDFLAGS; do
30082         if test "x$i" = "x$j"; then
30083           apr_addto_duplicate="1"
30084           break
30085         fi
30086       done
30087       if test $apr_addto_duplicate = "0"; then
30088         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
30089         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
30090       fi
30091     done
30092   fi
30093
30094     apu_db_header=$bdb_header
30095     apu_db_lib=$bdb_libname
30096     apu_have_db=1
30097     ;;
30098   esac
30099
30100   if test "$apu_have_db" = "1"; then
30101     apu_db_version=4
30102   fi
30103
30104               if test "$apu_db_version" != "4"; then
30105
30106   places="$all_places"
30107   if test -z "$places"; then
30108     places="std /usr/local /usr/local/BerkeleyDB.4.1 /boot/home/config"
30109   fi
30110
30111   bdb_version="4"
30112   if test ""1"" != "-1"; then
30113     bdb_version="$bdb_version."1""
30114     if test ""-1"" != "-1"; then
30115       bdb_version="$bdb_version."-1""
30116     fi
30117   fi
30118   bdb_places="$places"
30119   bdb_default_search_headers="db41/db.h db4/db.h db.h"
30120   bdb_default_search_lib_names="db-4.1 db41 db4 db"
30121
30122
30123   apu_have_db=0
30124
30125   # Save the original values of the flags we tweak.
30126   apu_check_lib_save_libs="$LIBS"
30127   apu_check_lib_save_ldflags="$LDFLAGS"
30128   apu_check_lib_save_cppflags="$CPPFLAGS"
30129
30130   # The variable `found' is the prefix under which we've found
30131   # Berkeley DB, or `not' if we haven't found it anywhere yet.
30132   found=not
30133   for bdb_place in $bdb_places; do
30134
30135     LDFLAGS="$apu_check_lib_save_ldflags"
30136     CPPFLAGS="$apu_check_lib_save_cppflags"
30137     case "$bdb_place" in
30138       "std" )
30139         description="the standard places"
30140       ;;
30141       *":"* )
30142         header="`echo $bdb_place | sed -e 's/:.*$//'`"
30143         lib="`echo $bdb_place | sed -e 's/^.*://'`"
30144         CPPFLAGS="$CPPFLAGS -I$header"
30145         LDFLAGS="$LDFLAGS -L$lib"
30146         description="$header and $lib"
30147       ;;
30148       * )
30149         if test -d $bdb_place; then
30150           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
30151           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
30152         else
30153           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
30154 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
30155           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
30156 $as_echo "directory not found" >&6; }
30157           continue
30158         fi
30159         description="$bdb_place"
30160       ;;
30161     esac
30162
30163     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
30164     # trick to display a message instead.
30165     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
30166 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
30167     { $as_echo "$as_me:$LINENO: result: " >&5
30168 $as_echo "" >&6; }
30169
30170     for bdb_libname in $bdb_default_search_lib_names; do
30171       for bdb_header in $bdb_default_search_headers; do
30172         # Clear the header cache variable for each location
30173
30174         cache_id="`echo ac_cv_header_${bdb_header} \
30175                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
30176
30177         unset $cache_id
30178         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
30179 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
30180   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
30181 $as_echo_n "checking for $bdb_header... " >&6; }
30182 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
30183   $as_echo_n "(cached) " >&6
30184 fi
30185 ac_res=`eval 'as_val=${'$as_ac_Header'}
30186                  $as_echo "$as_val"'`
30187                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
30188 $as_echo "$ac_res" >&6; }
30189 else
30190   # Is the header compilable?
30191 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
30192 $as_echo_n "checking $bdb_header usability... " >&6; }
30193 cat >conftest.$ac_ext <<_ACEOF
30194 /* confdefs.h.  */
30195 _ACEOF
30196 cat confdefs.h >>conftest.$ac_ext
30197 cat >>conftest.$ac_ext <<_ACEOF
30198 /* end confdefs.h.  */
30199 $ac_includes_default
30200 #include <$bdb_header>
30201 _ACEOF
30202 rm -f conftest.$ac_objext
30203 if { (ac_try="$ac_compile"
30204 case "(($ac_try" in
30205   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
30206   *) ac_try_echo=$ac_try;;
30207 esac
30208 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
30209 $as_echo "$ac_try_echo") >&5
30210   (eval "$ac_compile") 2>conftest.er1
30211   ac_status=$?
30212   grep -v '^ *+' conftest.er1 >conftest.err
30213   rm -f conftest.er1
30214   cat conftest.err >&5
30215   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
30216   (exit $ac_status); } && {
30217          test -z "$ac_c_werror_flag" ||
30218          test ! -s conftest.err
30219        } && test -s conftest.$ac_objext; then
30220   ac_header_compiler=yes
30221 else
30222   $as_echo "$as_me: failed program was:" >&5
30223 sed 's/^/| /' conftest.$ac_ext >&5
30224
30225         ac_header_compiler=no
30226 fi
30227
30228 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
30229 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
30230 $as_echo "$ac_header_compiler" >&6; }
30231
30232 # Is the header present?
30233 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
30234 $as_echo_n "checking $bdb_header presence... " >&6; }
30235 cat >conftest.$ac_ext <<_ACEOF
30236 /* confdefs.h.  */
30237 _ACEOF
30238 cat confdefs.h >>conftest.$ac_ext
30239 cat >>conftest.$ac_ext <<_ACEOF
30240 /* end confdefs.h.  */
30241 #include <$bdb_header>
30242 _ACEOF
30243 if { (ac_try="$ac_cpp conftest.$ac_ext"
30244 case "(($ac_try" in
30245   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
30246   *) ac_try_echo=$ac_try;;
30247 esac
30248 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
30249 $as_echo "$ac_try_echo") >&5
30250   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
30251   ac_status=$?
30252   grep -v '^ *+' conftest.er1 >conftest.err
30253   rm -f conftest.er1
30254   cat conftest.err >&5
30255   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
30256   (exit $ac_status); } >/dev/null && {
30257          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
30258          test ! -s conftest.err
30259        }; then
30260   ac_header_preproc=yes
30261 else
30262   $as_echo "$as_me: failed program was:" >&5
30263 sed 's/^/| /' conftest.$ac_ext >&5
30264
30265   ac_header_preproc=no
30266 fi
30267
30268 rm -f conftest.err conftest.$ac_ext
30269 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
30270 $as_echo "$ac_header_preproc" >&6; }
30271
30272 # So?  What about this header?
30273 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
30274   yes:no: )
30275     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
30276 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
30277     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
30278 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
30279     ac_header_preproc=yes
30280     ;;
30281   no:yes:* )
30282     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
30283 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
30284     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
30285 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
30286     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
30287 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
30288     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
30289 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
30290     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
30291 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
30292     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
30293 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
30294
30295     ;;
30296 esac
30297 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
30298 $as_echo_n "checking for $bdb_header... " >&6; }
30299 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
30300   $as_echo_n "(cached) " >&6
30301 else
30302   eval "$as_ac_Header=\$ac_header_preproc"
30303 fi
30304 ac_res=`eval 'as_val=${'$as_ac_Header'}
30305                  $as_echo "$as_val"'`
30306                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
30307 $as_echo "$ac_res" >&6; }
30308
30309 fi
30310 as_val=`eval 'as_val=${'$as_ac_Header'}
30311                  $as_echo "$as_val"'`
30312    if test "x$as_val" = x""yes; then
30313
30314           if test ""4"" = "3" -o ""4"" = "4"; then
30315             # We generate a separate cache variable for each prefix and libname
30316             # we search under.  That way, we avoid caching information that
30317             # changes if the user runs `configure' with a different set of
30318             # switches.
30319
30320             cache_id="`echo apu_cv_check_berkeley_db_"4"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
30321                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
30322
30323
30324             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
30325 $as_echo_n "checking for -l$bdb_libname... " >&6; }
30326                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
30327   $as_echo_n "(cached) " >&6
30328 else
30329
30330
30331     apu_try_berkeley_db_save_libs="$LIBS"
30332
30333     apu_check_berkeley_db_major="4"
30334     apu_check_berkeley_db_minor="1"
30335     apu_check_berkeley_db_patch="-1"
30336     apu_try_berkeley_db_header=$bdb_header
30337     apu_try_berkeley_db_libname=$bdb_libname
30338
30339     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
30340     if test "$cross_compiling" = yes; then
30341   apu_try_berkeley_db=yes
30342
30343 else
30344   cat >conftest.$ac_ext <<_ACEOF
30345 /* confdefs.h.  */
30346 _ACEOF
30347 cat confdefs.h >>conftest.$ac_ext
30348 cat >>conftest.$ac_ext <<_ACEOF
30349 /* end confdefs.h.  */
30350
30351 #include <stdlib.h>
30352 #include <stdio.h>
30353 #include <$apu_try_berkeley_db_header>
30354 main ()
30355 {
30356   int major, minor, patch;
30357
30358   db_version(&major, &minor, &patch);
30359
30360   /* Sanity check: ensure that db.h constants actually match the db library */
30361   if (major != DB_VERSION_MAJOR
30362       || minor != DB_VERSION_MINOR
30363       || patch != DB_VERSION_PATCH)
30364     exit (1);
30365
30366   /* Run-time check:  ensure the library claims to be the correct version. */
30367
30368   if ($apu_check_berkeley_db_major != -1) {
30369     if (major < $apu_check_berkeley_db_major)
30370       exit (1);
30371     if (major > $apu_check_berkeley_db_major)
30372       exit (0);
30373   }
30374
30375   if ($apu_check_berkeley_db_minor != -1) {
30376     if (minor < $apu_check_berkeley_db_minor)
30377       exit (1);
30378     if (minor > $apu_check_berkeley_db_minor)
30379       exit (0);
30380   }
30381
30382   if ($apu_check_berkeley_db_patch == -1
30383       || patch >= $apu_check_berkeley_db_patch)
30384     exit (0);
30385   else
30386     exit (1);
30387 }
30388
30389 _ACEOF
30390 rm -f conftest$ac_exeext
30391 if { (ac_try="$ac_link"
30392 case "(($ac_try" in
30393   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
30394   *) ac_try_echo=$ac_try;;
30395 esac
30396 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
30397 $as_echo "$ac_try_echo") >&5
30398   (eval "$ac_link") 2>&5
30399   ac_status=$?
30400   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
30401   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
30402   { (case "(($ac_try" in
30403   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
30404   *) ac_try_echo=$ac_try;;
30405 esac
30406 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
30407 $as_echo "$ac_try_echo") >&5
30408   (eval "$ac_try") 2>&5
30409   ac_status=$?
30410   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
30411   (exit $ac_status); }; }; then
30412   apu_try_berkeley_db=yes
30413 else
30414   $as_echo "$as_me: program exited with status $ac_status" >&5
30415 $as_echo "$as_me: failed program was:" >&5
30416 sed 's/^/| /' conftest.$ac_ext >&5
30417
30418 ( exit $ac_status )
30419 apu_try_berkeley_db=no
30420 fi
30421 rm -rf conftest.dSYM
30422 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
30423 fi
30424
30425
30426
30427     LIBS="$apu_try_berkeley_db_save_libs"
30428
30429
30430                 eval "$cache_id=$apu_try_berkeley_db"
30431
30432 fi
30433
30434             result="`eval echo '$'$cache_id`"
30435             { $as_echo "$as_me:$LINENO: result: $result" >&5
30436 $as_echo "$result" >&6; }
30437           elif test ""4"" = "1"; then
30438             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
30439 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
30440 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
30441 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
30442   $as_echo_n "(cached) " >&6
30443 else
30444   ac_check_lib_save_LIBS=$LIBS
30445 LIBS="-l$bdb_libname  $LIBS"
30446 cat >conftest.$ac_ext <<_ACEOF
30447 /* confdefs.h.  */
30448 _ACEOF
30449 cat confdefs.h >>conftest.$ac_ext
30450 cat >>conftest.$ac_ext <<_ACEOF
30451 /* end confdefs.h.  */
30452
30453 /* Override any GCC internal prototype to avoid an error.
30454    Use char because int might match the return type of a GCC
30455    builtin and then its argument prototype would still apply.  */
30456 #ifdef __cplusplus
30457 extern "C"
30458 #endif
30459 char dbopen ();
30460 int
30461 main ()
30462 {
30463 return dbopen ();
30464   ;
30465   return 0;
30466 }
30467 _ACEOF
30468 rm -f conftest.$ac_objext conftest$ac_exeext
30469 if { (ac_try="$ac_link"
30470 case "(($ac_try" in
30471   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
30472   *) ac_try_echo=$ac_try;;
30473 esac
30474 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
30475 $as_echo "$ac_try_echo") >&5
30476   (eval "$ac_link") 2>conftest.er1
30477   ac_status=$?
30478   grep -v '^ *+' conftest.er1 >conftest.err
30479   rm -f conftest.er1
30480   cat conftest.err >&5
30481   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
30482   (exit $ac_status); } && {
30483          test -z "$ac_c_werror_flag" ||
30484          test ! -s conftest.err
30485        } && test -s conftest$ac_exeext && {
30486          test "$cross_compiling" = yes ||
30487          $as_test_x conftest$ac_exeext
30488        }; then
30489   eval "$as_ac_Lib=yes"
30490 else
30491   $as_echo "$as_me: failed program was:" >&5
30492 sed 's/^/| /' conftest.$ac_ext >&5
30493
30494         eval "$as_ac_Lib=no"
30495 fi
30496
30497 rm -rf conftest.dSYM
30498 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
30499       conftest$ac_exeext conftest.$ac_ext
30500 LIBS=$ac_check_lib_save_LIBS
30501 fi
30502 ac_res=`eval 'as_val=${'$as_ac_Lib'}
30503                  $as_echo "$as_val"'`
30504                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
30505 $as_echo "$ac_res" >&6; }
30506 as_val=`eval 'as_val=${'$as_ac_Lib'}
30507                  $as_echo "$as_val"'`
30508    if test "x$as_val" = x""yes; then
30509   result=yes
30510 else
30511   result=no
30512
30513 fi
30514
30515           elif test ""4"" = "2"; then
30516             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
30517 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
30518 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
30519 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
30520   $as_echo_n "(cached) " >&6
30521 else
30522   ac_check_lib_save_LIBS=$LIBS
30523 LIBS="-l$bdb_libname  $LIBS"
30524 cat >conftest.$ac_ext <<_ACEOF
30525 /* confdefs.h.  */
30526 _ACEOF
30527 cat confdefs.h >>conftest.$ac_ext
30528 cat >>conftest.$ac_ext <<_ACEOF
30529 /* end confdefs.h.  */
30530
30531 /* Override any GCC internal prototype to avoid an error.
30532    Use char because int might match the return type of a GCC
30533    builtin and then its argument prototype would still apply.  */
30534 #ifdef __cplusplus
30535 extern "C"
30536 #endif
30537 char db_open ();
30538 int
30539 main ()
30540 {
30541 return db_open ();
30542   ;
30543   return 0;
30544 }
30545 _ACEOF
30546 rm -f conftest.$ac_objext conftest$ac_exeext
30547 if { (ac_try="$ac_link"
30548 case "(($ac_try" in
30549   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
30550   *) ac_try_echo=$ac_try;;
30551 esac
30552 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
30553 $as_echo "$ac_try_echo") >&5
30554   (eval "$ac_link") 2>conftest.er1
30555   ac_status=$?
30556   grep -v '^ *+' conftest.er1 >conftest.err
30557   rm -f conftest.er1
30558   cat conftest.err >&5
30559   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
30560   (exit $ac_status); } && {
30561          test -z "$ac_c_werror_flag" ||
30562          test ! -s conftest.err
30563        } && test -s conftest$ac_exeext && {
30564          test "$cross_compiling" = yes ||
30565          $as_test_x conftest$ac_exeext
30566        }; then
30567   eval "$as_ac_Lib=yes"
30568 else
30569   $as_echo "$as_me: failed program was:" >&5
30570 sed 's/^/| /' conftest.$ac_ext >&5
30571
30572         eval "$as_ac_Lib=no"
30573 fi
30574
30575 rm -rf conftest.dSYM
30576 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
30577       conftest$ac_exeext conftest.$ac_ext
30578 LIBS=$ac_check_lib_save_LIBS
30579 fi
30580 ac_res=`eval 'as_val=${'$as_ac_Lib'}
30581                  $as_echo "$as_val"'`
30582                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
30583 $as_echo "$ac_res" >&6; }
30584 as_val=`eval 'as_val=${'$as_ac_Lib'}
30585                  $as_echo "$as_val"'`
30586    if test "x$as_val" = x""yes; then
30587   result=yes
30588 else
30589   result=no
30590
30591 fi
30592
30593           fi
30594
30595 else
30596   result="no"
30597 fi
30598
30599
30600
30601         # If we found it, no need to search any more.
30602         if test "$result" = "yes"; then
30603           found="$bdb_place"
30604           break
30605         fi
30606       done
30607       test "$found" != "not" && break
30608     done
30609     test "$found" != "not" && break
30610   done
30611
30612   # Restore the original values of the flags we tweak.
30613   LDFLAGS="$apu_check_lib_save_ldflags"
30614   CPPFLAGS="$apu_check_lib_save_cppflags"
30615
30616   case "$found" in
30617   "not")
30618     apu_have_db=0
30619     ;;
30620   "std")
30621     apu_db_header=$bdb_header
30622     apu_db_lib=$bdb_libname
30623     apu_have_db=1
30624     ;;
30625   *":"*)
30626     header="`echo $found | sed -e 's/:.*$//'`"
30627     lib="`echo $found | sed -e 's/^.*://'`"
30628
30629
30630   if test "x$APRUTIL_INCLUDES" = "x"; then
30631     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
30632     APRUTIL_INCLUDES="-I$header"
30633   else
30634     apr_addto_bugger="-I$header"
30635     for i in $apr_addto_bugger; do
30636       apr_addto_duplicate="0"
30637       for j in $APRUTIL_INCLUDES; do
30638         if test "x$i" = "x$j"; then
30639           apr_addto_duplicate="1"
30640           break
30641         fi
30642       done
30643       if test $apr_addto_duplicate = "0"; then
30644         echo "  adding \"$i\" to APRUTIL_INCLUDES"
30645         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
30646       fi
30647     done
30648   fi
30649
30650
30651   if test "x$APRUTIL_LDFLAGS" = "x"; then
30652     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
30653     APRUTIL_LDFLAGS="-L$lib"
30654   else
30655     apr_addto_bugger="-L$lib"
30656     for i in $apr_addto_bugger; do
30657       apr_addto_duplicate="0"
30658       for j in $APRUTIL_LDFLAGS; do
30659         if test "x$i" = "x$j"; then
30660           apr_addto_duplicate="1"
30661           break
30662         fi
30663       done
30664       if test $apr_addto_duplicate = "0"; then
30665         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
30666         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
30667       fi
30668     done
30669   fi
30670
30671     apu_db_header=$bdb_header
30672     apu_db_lib=$bdb_libname
30673     apu_have_db=1
30674     ;;
30675   *)
30676
30677   if test "x$APRUTIL_INCLUDES" = "x"; then
30678     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
30679     APRUTIL_INCLUDES="-I$found/include"
30680   else
30681     apr_addto_bugger="-I$found/include"
30682     for i in $apr_addto_bugger; do
30683       apr_addto_duplicate="0"
30684       for j in $APRUTIL_INCLUDES; do
30685         if test "x$i" = "x$j"; then
30686           apr_addto_duplicate="1"
30687           break
30688         fi
30689       done
30690       if test $apr_addto_duplicate = "0"; then
30691         echo "  adding \"$i\" to APRUTIL_INCLUDES"
30692         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
30693       fi
30694     done
30695   fi
30696
30697
30698   if test "x$APRUTIL_LDFLAGS" = "x"; then
30699     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
30700     APRUTIL_LDFLAGS="-L$found/lib"
30701   else
30702     apr_addto_bugger="-L$found/lib"
30703     for i in $apr_addto_bugger; do
30704       apr_addto_duplicate="0"
30705       for j in $APRUTIL_LDFLAGS; do
30706         if test "x$i" = "x$j"; then
30707           apr_addto_duplicate="1"
30708           break
30709         fi
30710       done
30711       if test $apr_addto_duplicate = "0"; then
30712         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
30713         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
30714       fi
30715     done
30716   fi
30717
30718     apu_db_header=$bdb_header
30719     apu_db_lib=$bdb_libname
30720     apu_have_db=1
30721     ;;
30722   esac
30723
30724   if test "$apu_have_db" = "1"; then
30725     apu_db_version=4
30726   fi
30727
30728                 if test "$apu_db_version" != "4"; then
30729
30730   places="$all_places"
30731   if test -z "$places"; then
30732     places="std /usr/local /usr/local/BerkeleyDB.4.0 /boot/home/config"
30733   fi
30734
30735   bdb_version="4"
30736   if test ""0"" != "-1"; then
30737     bdb_version="$bdb_version."0""
30738     if test ""-1"" != "-1"; then
30739       bdb_version="$bdb_version."-1""
30740     fi
30741   fi
30742   bdb_places="$places"
30743   bdb_default_search_headers="db4/db.h db.h"
30744   bdb_default_search_lib_names="db-4.0 db4 db"
30745
30746
30747   apu_have_db=0
30748
30749   # Save the original values of the flags we tweak.
30750   apu_check_lib_save_libs="$LIBS"
30751   apu_check_lib_save_ldflags="$LDFLAGS"
30752   apu_check_lib_save_cppflags="$CPPFLAGS"
30753
30754   # The variable `found' is the prefix under which we've found
30755   # Berkeley DB, or `not' if we haven't found it anywhere yet.
30756   found=not
30757   for bdb_place in $bdb_places; do
30758
30759     LDFLAGS="$apu_check_lib_save_ldflags"
30760     CPPFLAGS="$apu_check_lib_save_cppflags"
30761     case "$bdb_place" in
30762       "std" )
30763         description="the standard places"
30764       ;;
30765       *":"* )
30766         header="`echo $bdb_place | sed -e 's/:.*$//'`"
30767         lib="`echo $bdb_place | sed -e 's/^.*://'`"
30768         CPPFLAGS="$CPPFLAGS -I$header"
30769         LDFLAGS="$LDFLAGS -L$lib"
30770         description="$header and $lib"
30771       ;;
30772       * )
30773         if test -d $bdb_place; then
30774           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
30775           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
30776         else
30777           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
30778 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
30779           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
30780 $as_echo "directory not found" >&6; }
30781           continue
30782         fi
30783         description="$bdb_place"
30784       ;;
30785     esac
30786
30787     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
30788     # trick to display a message instead.
30789     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
30790 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
30791     { $as_echo "$as_me:$LINENO: result: " >&5
30792 $as_echo "" >&6; }
30793
30794     for bdb_libname in $bdb_default_search_lib_names; do
30795       for bdb_header in $bdb_default_search_headers; do
30796         # Clear the header cache variable for each location
30797
30798         cache_id="`echo ac_cv_header_${bdb_header} \
30799                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
30800
30801         unset $cache_id
30802         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
30803 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
30804   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
30805 $as_echo_n "checking for $bdb_header... " >&6; }
30806 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
30807   $as_echo_n "(cached) " >&6
30808 fi
30809 ac_res=`eval 'as_val=${'$as_ac_Header'}
30810                  $as_echo "$as_val"'`
30811                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
30812 $as_echo "$ac_res" >&6; }
30813 else
30814   # Is the header compilable?
30815 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
30816 $as_echo_n "checking $bdb_header usability... " >&6; }
30817 cat >conftest.$ac_ext <<_ACEOF
30818 /* confdefs.h.  */
30819 _ACEOF
30820 cat confdefs.h >>conftest.$ac_ext
30821 cat >>conftest.$ac_ext <<_ACEOF
30822 /* end confdefs.h.  */
30823 $ac_includes_default
30824 #include <$bdb_header>
30825 _ACEOF
30826 rm -f conftest.$ac_objext
30827 if { (ac_try="$ac_compile"
30828 case "(($ac_try" in
30829   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
30830   *) ac_try_echo=$ac_try;;
30831 esac
30832 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
30833 $as_echo "$ac_try_echo") >&5
30834   (eval "$ac_compile") 2>conftest.er1
30835   ac_status=$?
30836   grep -v '^ *+' conftest.er1 >conftest.err
30837   rm -f conftest.er1
30838   cat conftest.err >&5
30839   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
30840   (exit $ac_status); } && {
30841          test -z "$ac_c_werror_flag" ||
30842          test ! -s conftest.err
30843        } && test -s conftest.$ac_objext; then
30844   ac_header_compiler=yes
30845 else
30846   $as_echo "$as_me: failed program was:" >&5
30847 sed 's/^/| /' conftest.$ac_ext >&5
30848
30849         ac_header_compiler=no
30850 fi
30851
30852 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
30853 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
30854 $as_echo "$ac_header_compiler" >&6; }
30855
30856 # Is the header present?
30857 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
30858 $as_echo_n "checking $bdb_header presence... " >&6; }
30859 cat >conftest.$ac_ext <<_ACEOF
30860 /* confdefs.h.  */
30861 _ACEOF
30862 cat confdefs.h >>conftest.$ac_ext
30863 cat >>conftest.$ac_ext <<_ACEOF
30864 /* end confdefs.h.  */
30865 #include <$bdb_header>
30866 _ACEOF
30867 if { (ac_try="$ac_cpp conftest.$ac_ext"
30868 case "(($ac_try" in
30869   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
30870   *) ac_try_echo=$ac_try;;
30871 esac
30872 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
30873 $as_echo "$ac_try_echo") >&5
30874   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
30875   ac_status=$?
30876   grep -v '^ *+' conftest.er1 >conftest.err
30877   rm -f conftest.er1
30878   cat conftest.err >&5
30879   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
30880   (exit $ac_status); } >/dev/null && {
30881          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
30882          test ! -s conftest.err
30883        }; then
30884   ac_header_preproc=yes
30885 else
30886   $as_echo "$as_me: failed program was:" >&5
30887 sed 's/^/| /' conftest.$ac_ext >&5
30888
30889   ac_header_preproc=no
30890 fi
30891
30892 rm -f conftest.err conftest.$ac_ext
30893 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
30894 $as_echo "$ac_header_preproc" >&6; }
30895
30896 # So?  What about this header?
30897 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
30898   yes:no: )
30899     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
30900 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
30901     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
30902 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
30903     ac_header_preproc=yes
30904     ;;
30905   no:yes:* )
30906     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
30907 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
30908     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
30909 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
30910     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
30911 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
30912     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
30913 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
30914     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
30915 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
30916     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
30917 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
30918
30919     ;;
30920 esac
30921 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
30922 $as_echo_n "checking for $bdb_header... " >&6; }
30923 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
30924   $as_echo_n "(cached) " >&6
30925 else
30926   eval "$as_ac_Header=\$ac_header_preproc"
30927 fi
30928 ac_res=`eval 'as_val=${'$as_ac_Header'}
30929                  $as_echo "$as_val"'`
30930                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
30931 $as_echo "$ac_res" >&6; }
30932
30933 fi
30934 as_val=`eval 'as_val=${'$as_ac_Header'}
30935                  $as_echo "$as_val"'`
30936    if test "x$as_val" = x""yes; then
30937
30938           if test ""4"" = "3" -o ""4"" = "4"; then
30939             # We generate a separate cache variable for each prefix and libname
30940             # we search under.  That way, we avoid caching information that
30941             # changes if the user runs `configure' with a different set of
30942             # switches.
30943
30944             cache_id="`echo apu_cv_check_berkeley_db_"4"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \
30945                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
30946
30947
30948             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
30949 $as_echo_n "checking for -l$bdb_libname... " >&6; }
30950                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
30951   $as_echo_n "(cached) " >&6
30952 else
30953
30954
30955     apu_try_berkeley_db_save_libs="$LIBS"
30956
30957     apu_check_berkeley_db_major="4"
30958     apu_check_berkeley_db_minor="0"
30959     apu_check_berkeley_db_patch="-1"
30960     apu_try_berkeley_db_header=$bdb_header
30961     apu_try_berkeley_db_libname=$bdb_libname
30962
30963     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
30964     if test "$cross_compiling" = yes; then
30965   apu_try_berkeley_db=yes
30966
30967 else
30968   cat >conftest.$ac_ext <<_ACEOF
30969 /* confdefs.h.  */
30970 _ACEOF
30971 cat confdefs.h >>conftest.$ac_ext
30972 cat >>conftest.$ac_ext <<_ACEOF
30973 /* end confdefs.h.  */
30974
30975 #include <stdlib.h>
30976 #include <stdio.h>
30977 #include <$apu_try_berkeley_db_header>
30978 main ()
30979 {
30980   int major, minor, patch;
30981
30982   db_version(&major, &minor, &patch);
30983
30984   /* Sanity check: ensure that db.h constants actually match the db library */
30985   if (major != DB_VERSION_MAJOR
30986       || minor != DB_VERSION_MINOR
30987       || patch != DB_VERSION_PATCH)
30988     exit (1);
30989
30990   /* Run-time check:  ensure the library claims to be the correct version. */
30991
30992   if ($apu_check_berkeley_db_major != -1) {
30993     if (major < $apu_check_berkeley_db_major)
30994       exit (1);
30995     if (major > $apu_check_berkeley_db_major)
30996       exit (0);
30997   }
30998
30999   if ($apu_check_berkeley_db_minor != -1) {
31000     if (minor < $apu_check_berkeley_db_minor)
31001       exit (1);
31002     if (minor > $apu_check_berkeley_db_minor)
31003       exit (0);
31004   }
31005
31006   if ($apu_check_berkeley_db_patch == -1
31007       || patch >= $apu_check_berkeley_db_patch)
31008     exit (0);
31009   else
31010     exit (1);
31011 }
31012
31013 _ACEOF
31014 rm -f conftest$ac_exeext
31015 if { (ac_try="$ac_link"
31016 case "(($ac_try" in
31017   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31018   *) ac_try_echo=$ac_try;;
31019 esac
31020 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31021 $as_echo "$ac_try_echo") >&5
31022   (eval "$ac_link") 2>&5
31023   ac_status=$?
31024   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31025   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
31026   { (case "(($ac_try" in
31027   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31028   *) ac_try_echo=$ac_try;;
31029 esac
31030 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31031 $as_echo "$ac_try_echo") >&5
31032   (eval "$ac_try") 2>&5
31033   ac_status=$?
31034   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31035   (exit $ac_status); }; }; then
31036   apu_try_berkeley_db=yes
31037 else
31038   $as_echo "$as_me: program exited with status $ac_status" >&5
31039 $as_echo "$as_me: failed program was:" >&5
31040 sed 's/^/| /' conftest.$ac_ext >&5
31041
31042 ( exit $ac_status )
31043 apu_try_berkeley_db=no
31044 fi
31045 rm -rf conftest.dSYM
31046 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
31047 fi
31048
31049
31050
31051     LIBS="$apu_try_berkeley_db_save_libs"
31052
31053
31054                 eval "$cache_id=$apu_try_berkeley_db"
31055
31056 fi
31057
31058             result="`eval echo '$'$cache_id`"
31059             { $as_echo "$as_me:$LINENO: result: $result" >&5
31060 $as_echo "$result" >&6; }
31061           elif test ""4"" = "1"; then
31062             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
31063 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
31064 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
31065 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
31066   $as_echo_n "(cached) " >&6
31067 else
31068   ac_check_lib_save_LIBS=$LIBS
31069 LIBS="-l$bdb_libname  $LIBS"
31070 cat >conftest.$ac_ext <<_ACEOF
31071 /* confdefs.h.  */
31072 _ACEOF
31073 cat confdefs.h >>conftest.$ac_ext
31074 cat >>conftest.$ac_ext <<_ACEOF
31075 /* end confdefs.h.  */
31076
31077 /* Override any GCC internal prototype to avoid an error.
31078    Use char because int might match the return type of a GCC
31079    builtin and then its argument prototype would still apply.  */
31080 #ifdef __cplusplus
31081 extern "C"
31082 #endif
31083 char dbopen ();
31084 int
31085 main ()
31086 {
31087 return dbopen ();
31088   ;
31089   return 0;
31090 }
31091 _ACEOF
31092 rm -f conftest.$ac_objext conftest$ac_exeext
31093 if { (ac_try="$ac_link"
31094 case "(($ac_try" in
31095   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31096   *) ac_try_echo=$ac_try;;
31097 esac
31098 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31099 $as_echo "$ac_try_echo") >&5
31100   (eval "$ac_link") 2>conftest.er1
31101   ac_status=$?
31102   grep -v '^ *+' conftest.er1 >conftest.err
31103   rm -f conftest.er1
31104   cat conftest.err >&5
31105   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31106   (exit $ac_status); } && {
31107          test -z "$ac_c_werror_flag" ||
31108          test ! -s conftest.err
31109        } && test -s conftest$ac_exeext && {
31110          test "$cross_compiling" = yes ||
31111          $as_test_x conftest$ac_exeext
31112        }; then
31113   eval "$as_ac_Lib=yes"
31114 else
31115   $as_echo "$as_me: failed program was:" >&5
31116 sed 's/^/| /' conftest.$ac_ext >&5
31117
31118         eval "$as_ac_Lib=no"
31119 fi
31120
31121 rm -rf conftest.dSYM
31122 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
31123       conftest$ac_exeext conftest.$ac_ext
31124 LIBS=$ac_check_lib_save_LIBS
31125 fi
31126 ac_res=`eval 'as_val=${'$as_ac_Lib'}
31127                  $as_echo "$as_val"'`
31128                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
31129 $as_echo "$ac_res" >&6; }
31130 as_val=`eval 'as_val=${'$as_ac_Lib'}
31131                  $as_echo "$as_val"'`
31132    if test "x$as_val" = x""yes; then
31133   result=yes
31134 else
31135   result=no
31136
31137 fi
31138
31139           elif test ""4"" = "2"; then
31140             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
31141 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
31142 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
31143 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
31144   $as_echo_n "(cached) " >&6
31145 else
31146   ac_check_lib_save_LIBS=$LIBS
31147 LIBS="-l$bdb_libname  $LIBS"
31148 cat >conftest.$ac_ext <<_ACEOF
31149 /* confdefs.h.  */
31150 _ACEOF
31151 cat confdefs.h >>conftest.$ac_ext
31152 cat >>conftest.$ac_ext <<_ACEOF
31153 /* end confdefs.h.  */
31154
31155 /* Override any GCC internal prototype to avoid an error.
31156    Use char because int might match the return type of a GCC
31157    builtin and then its argument prototype would still apply.  */
31158 #ifdef __cplusplus
31159 extern "C"
31160 #endif
31161 char db_open ();
31162 int
31163 main ()
31164 {
31165 return db_open ();
31166   ;
31167   return 0;
31168 }
31169 _ACEOF
31170 rm -f conftest.$ac_objext conftest$ac_exeext
31171 if { (ac_try="$ac_link"
31172 case "(($ac_try" in
31173   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31174   *) ac_try_echo=$ac_try;;
31175 esac
31176 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31177 $as_echo "$ac_try_echo") >&5
31178   (eval "$ac_link") 2>conftest.er1
31179   ac_status=$?
31180   grep -v '^ *+' conftest.er1 >conftest.err
31181   rm -f conftest.er1
31182   cat conftest.err >&5
31183   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31184   (exit $ac_status); } && {
31185          test -z "$ac_c_werror_flag" ||
31186          test ! -s conftest.err
31187        } && test -s conftest$ac_exeext && {
31188          test "$cross_compiling" = yes ||
31189          $as_test_x conftest$ac_exeext
31190        }; then
31191   eval "$as_ac_Lib=yes"
31192 else
31193   $as_echo "$as_me: failed program was:" >&5
31194 sed 's/^/| /' conftest.$ac_ext >&5
31195
31196         eval "$as_ac_Lib=no"
31197 fi
31198
31199 rm -rf conftest.dSYM
31200 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
31201       conftest$ac_exeext conftest.$ac_ext
31202 LIBS=$ac_check_lib_save_LIBS
31203 fi
31204 ac_res=`eval 'as_val=${'$as_ac_Lib'}
31205                  $as_echo "$as_val"'`
31206                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
31207 $as_echo "$ac_res" >&6; }
31208 as_val=`eval 'as_val=${'$as_ac_Lib'}
31209                  $as_echo "$as_val"'`
31210    if test "x$as_val" = x""yes; then
31211   result=yes
31212 else
31213   result=no
31214
31215 fi
31216
31217           fi
31218
31219 else
31220   result="no"
31221 fi
31222
31223
31224
31225         # If we found it, no need to search any more.
31226         if test "$result" = "yes"; then
31227           found="$bdb_place"
31228           break
31229         fi
31230       done
31231       test "$found" != "not" && break
31232     done
31233     test "$found" != "not" && break
31234   done
31235
31236   # Restore the original values of the flags we tweak.
31237   LDFLAGS="$apu_check_lib_save_ldflags"
31238   CPPFLAGS="$apu_check_lib_save_cppflags"
31239
31240   case "$found" in
31241   "not")
31242     apu_have_db=0
31243     ;;
31244   "std")
31245     apu_db_header=$bdb_header
31246     apu_db_lib=$bdb_libname
31247     apu_have_db=1
31248     ;;
31249   *":"*)
31250     header="`echo $found | sed -e 's/:.*$//'`"
31251     lib="`echo $found | sed -e 's/^.*://'`"
31252
31253
31254   if test "x$APRUTIL_INCLUDES" = "x"; then
31255     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
31256     APRUTIL_INCLUDES="-I$header"
31257   else
31258     apr_addto_bugger="-I$header"
31259     for i in $apr_addto_bugger; do
31260       apr_addto_duplicate="0"
31261       for j in $APRUTIL_INCLUDES; do
31262         if test "x$i" = "x$j"; then
31263           apr_addto_duplicate="1"
31264           break
31265         fi
31266       done
31267       if test $apr_addto_duplicate = "0"; then
31268         echo "  adding \"$i\" to APRUTIL_INCLUDES"
31269         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
31270       fi
31271     done
31272   fi
31273
31274
31275   if test "x$APRUTIL_LDFLAGS" = "x"; then
31276     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
31277     APRUTIL_LDFLAGS="-L$lib"
31278   else
31279     apr_addto_bugger="-L$lib"
31280     for i in $apr_addto_bugger; do
31281       apr_addto_duplicate="0"
31282       for j in $APRUTIL_LDFLAGS; do
31283         if test "x$i" = "x$j"; then
31284           apr_addto_duplicate="1"
31285           break
31286         fi
31287       done
31288       if test $apr_addto_duplicate = "0"; then
31289         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
31290         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
31291       fi
31292     done
31293   fi
31294
31295     apu_db_header=$bdb_header
31296     apu_db_lib=$bdb_libname
31297     apu_have_db=1
31298     ;;
31299   *)
31300
31301   if test "x$APRUTIL_INCLUDES" = "x"; then
31302     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
31303     APRUTIL_INCLUDES="-I$found/include"
31304   else
31305     apr_addto_bugger="-I$found/include"
31306     for i in $apr_addto_bugger; do
31307       apr_addto_duplicate="0"
31308       for j in $APRUTIL_INCLUDES; do
31309         if test "x$i" = "x$j"; then
31310           apr_addto_duplicate="1"
31311           break
31312         fi
31313       done
31314       if test $apr_addto_duplicate = "0"; then
31315         echo "  adding \"$i\" to APRUTIL_INCLUDES"
31316         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
31317       fi
31318     done
31319   fi
31320
31321
31322   if test "x$APRUTIL_LDFLAGS" = "x"; then
31323     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
31324     APRUTIL_LDFLAGS="-L$found/lib"
31325   else
31326     apr_addto_bugger="-L$found/lib"
31327     for i in $apr_addto_bugger; do
31328       apr_addto_duplicate="0"
31329       for j in $APRUTIL_LDFLAGS; do
31330         if test "x$i" = "x$j"; then
31331           apr_addto_duplicate="1"
31332           break
31333         fi
31334       done
31335       if test $apr_addto_duplicate = "0"; then
31336         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
31337         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
31338       fi
31339     done
31340   fi
31341
31342     apu_db_header=$bdb_header
31343     apu_db_lib=$bdb_libname
31344     apu_have_db=1
31345     ;;
31346   esac
31347
31348   if test "$apu_have_db" = "1"; then
31349     apu_db_version=4
31350   fi
31351
31352                   if test "$apu_db_version" != "4"; then
31353
31354   places="$all_places"
31355   if test -z "$places"; then
31356     places="std"
31357   fi
31358
31359   bdb_version=3
31360   if test "-1" != "-1"; then
31361     bdb_version="$bdb_version.-1"
31362     if test "-1" != "-1"; then
31363       bdb_version="$bdb_version.-1"
31364     fi
31365   fi
31366   bdb_places="$places"
31367   bdb_default_search_headers="db3/db.h db.h"
31368   bdb_default_search_lib_names="db3 db"
31369
31370
31371   apu_have_db=0
31372
31373   # Save the original values of the flags we tweak.
31374   apu_check_lib_save_libs="$LIBS"
31375   apu_check_lib_save_ldflags="$LDFLAGS"
31376   apu_check_lib_save_cppflags="$CPPFLAGS"
31377
31378   # The variable `found' is the prefix under which we've found
31379   # Berkeley DB, or `not' if we haven't found it anywhere yet.
31380   found=not
31381   for bdb_place in $bdb_places; do
31382
31383     LDFLAGS="$apu_check_lib_save_ldflags"
31384     CPPFLAGS="$apu_check_lib_save_cppflags"
31385     case "$bdb_place" in
31386       "std" )
31387         description="the standard places"
31388       ;;
31389       *":"* )
31390         header="`echo $bdb_place | sed -e 's/:.*$//'`"
31391         lib="`echo $bdb_place | sed -e 's/^.*://'`"
31392         CPPFLAGS="$CPPFLAGS -I$header"
31393         LDFLAGS="$LDFLAGS -L$lib"
31394         description="$header and $lib"
31395       ;;
31396       * )
31397         if test -d $bdb_place; then
31398           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
31399           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
31400         else
31401           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
31402 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
31403           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
31404 $as_echo "directory not found" >&6; }
31405           continue
31406         fi
31407         description="$bdb_place"
31408       ;;
31409     esac
31410
31411     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
31412     # trick to display a message instead.
31413     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
31414 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
31415     { $as_echo "$as_me:$LINENO: result: " >&5
31416 $as_echo "" >&6; }
31417
31418     for bdb_libname in $bdb_default_search_lib_names; do
31419       for bdb_header in $bdb_default_search_headers; do
31420         # Clear the header cache variable for each location
31421
31422         cache_id="`echo ac_cv_header_${bdb_header} \
31423                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
31424
31425         unset $cache_id
31426         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
31427 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
31428   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
31429 $as_echo_n "checking for $bdb_header... " >&6; }
31430 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
31431   $as_echo_n "(cached) " >&6
31432 fi
31433 ac_res=`eval 'as_val=${'$as_ac_Header'}
31434                  $as_echo "$as_val"'`
31435                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
31436 $as_echo "$ac_res" >&6; }
31437 else
31438   # Is the header compilable?
31439 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
31440 $as_echo_n "checking $bdb_header usability... " >&6; }
31441 cat >conftest.$ac_ext <<_ACEOF
31442 /* confdefs.h.  */
31443 _ACEOF
31444 cat confdefs.h >>conftest.$ac_ext
31445 cat >>conftest.$ac_ext <<_ACEOF
31446 /* end confdefs.h.  */
31447 $ac_includes_default
31448 #include <$bdb_header>
31449 _ACEOF
31450 rm -f conftest.$ac_objext
31451 if { (ac_try="$ac_compile"
31452 case "(($ac_try" in
31453   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31454   *) ac_try_echo=$ac_try;;
31455 esac
31456 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31457 $as_echo "$ac_try_echo") >&5
31458   (eval "$ac_compile") 2>conftest.er1
31459   ac_status=$?
31460   grep -v '^ *+' conftest.er1 >conftest.err
31461   rm -f conftest.er1
31462   cat conftest.err >&5
31463   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31464   (exit $ac_status); } && {
31465          test -z "$ac_c_werror_flag" ||
31466          test ! -s conftest.err
31467        } && test -s conftest.$ac_objext; then
31468   ac_header_compiler=yes
31469 else
31470   $as_echo "$as_me: failed program was:" >&5
31471 sed 's/^/| /' conftest.$ac_ext >&5
31472
31473         ac_header_compiler=no
31474 fi
31475
31476 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
31477 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
31478 $as_echo "$ac_header_compiler" >&6; }
31479
31480 # Is the header present?
31481 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
31482 $as_echo_n "checking $bdb_header presence... " >&6; }
31483 cat >conftest.$ac_ext <<_ACEOF
31484 /* confdefs.h.  */
31485 _ACEOF
31486 cat confdefs.h >>conftest.$ac_ext
31487 cat >>conftest.$ac_ext <<_ACEOF
31488 /* end confdefs.h.  */
31489 #include <$bdb_header>
31490 _ACEOF
31491 if { (ac_try="$ac_cpp conftest.$ac_ext"
31492 case "(($ac_try" in
31493   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31494   *) ac_try_echo=$ac_try;;
31495 esac
31496 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31497 $as_echo "$ac_try_echo") >&5
31498   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
31499   ac_status=$?
31500   grep -v '^ *+' conftest.er1 >conftest.err
31501   rm -f conftest.er1
31502   cat conftest.err >&5
31503   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31504   (exit $ac_status); } >/dev/null && {
31505          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
31506          test ! -s conftest.err
31507        }; then
31508   ac_header_preproc=yes
31509 else
31510   $as_echo "$as_me: failed program was:" >&5
31511 sed 's/^/| /' conftest.$ac_ext >&5
31512
31513   ac_header_preproc=no
31514 fi
31515
31516 rm -f conftest.err conftest.$ac_ext
31517 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
31518 $as_echo "$ac_header_preproc" >&6; }
31519
31520 # So?  What about this header?
31521 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
31522   yes:no: )
31523     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
31524 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
31525     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
31526 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
31527     ac_header_preproc=yes
31528     ;;
31529   no:yes:* )
31530     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
31531 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
31532     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
31533 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
31534     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
31535 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
31536     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
31537 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
31538     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
31539 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
31540     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
31541 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
31542
31543     ;;
31544 esac
31545 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
31546 $as_echo_n "checking for $bdb_header... " >&6; }
31547 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
31548   $as_echo_n "(cached) " >&6
31549 else
31550   eval "$as_ac_Header=\$ac_header_preproc"
31551 fi
31552 ac_res=`eval 'as_val=${'$as_ac_Header'}
31553                  $as_echo "$as_val"'`
31554                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
31555 $as_echo "$ac_res" >&6; }
31556
31557 fi
31558 as_val=`eval 'as_val=${'$as_ac_Header'}
31559                  $as_echo "$as_val"'`
31560    if test "x$as_val" = x""yes; then
31561
31562           if test "3" = "3" -o "3" = "4"; then
31563             # We generate a separate cache variable for each prefix and libname
31564             # we search under.  That way, we avoid caching information that
31565             # changes if the user runs `configure' with a different set of
31566             # switches.
31567
31568             cache_id="`echo apu_cv_check_berkeley_db_3_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
31569                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
31570
31571
31572             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
31573 $as_echo_n "checking for -l$bdb_libname... " >&6; }
31574                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
31575   $as_echo_n "(cached) " >&6
31576 else
31577
31578
31579     apu_try_berkeley_db_save_libs="$LIBS"
31580
31581     apu_check_berkeley_db_major=3
31582     apu_check_berkeley_db_minor=-1
31583     apu_check_berkeley_db_patch=-1
31584     apu_try_berkeley_db_header=$bdb_header
31585     apu_try_berkeley_db_libname=$bdb_libname
31586
31587     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
31588     if test "$cross_compiling" = yes; then
31589   apu_try_berkeley_db=yes
31590
31591 else
31592   cat >conftest.$ac_ext <<_ACEOF
31593 /* confdefs.h.  */
31594 _ACEOF
31595 cat confdefs.h >>conftest.$ac_ext
31596 cat >>conftest.$ac_ext <<_ACEOF
31597 /* end confdefs.h.  */
31598
31599 #include <stdlib.h>
31600 #include <stdio.h>
31601 #include <$apu_try_berkeley_db_header>
31602 main ()
31603 {
31604   int major, minor, patch;
31605
31606   db_version(&major, &minor, &patch);
31607
31608   /* Sanity check: ensure that db.h constants actually match the db library */
31609   if (major != DB_VERSION_MAJOR
31610       || minor != DB_VERSION_MINOR
31611       || patch != DB_VERSION_PATCH)
31612     exit (1);
31613
31614   /* Run-time check:  ensure the library claims to be the correct version. */
31615
31616   if ($apu_check_berkeley_db_major != -1) {
31617     if (major < $apu_check_berkeley_db_major)
31618       exit (1);
31619     if (major > $apu_check_berkeley_db_major)
31620       exit (0);
31621   }
31622
31623   if ($apu_check_berkeley_db_minor != -1) {
31624     if (minor < $apu_check_berkeley_db_minor)
31625       exit (1);
31626     if (minor > $apu_check_berkeley_db_minor)
31627       exit (0);
31628   }
31629
31630   if ($apu_check_berkeley_db_patch == -1
31631       || patch >= $apu_check_berkeley_db_patch)
31632     exit (0);
31633   else
31634     exit (1);
31635 }
31636
31637 _ACEOF
31638 rm -f conftest$ac_exeext
31639 if { (ac_try="$ac_link"
31640 case "(($ac_try" in
31641   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31642   *) ac_try_echo=$ac_try;;
31643 esac
31644 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31645 $as_echo "$ac_try_echo") >&5
31646   (eval "$ac_link") 2>&5
31647   ac_status=$?
31648   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31649   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
31650   { (case "(($ac_try" in
31651   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31652   *) ac_try_echo=$ac_try;;
31653 esac
31654 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31655 $as_echo "$ac_try_echo") >&5
31656   (eval "$ac_try") 2>&5
31657   ac_status=$?
31658   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31659   (exit $ac_status); }; }; then
31660   apu_try_berkeley_db=yes
31661 else
31662   $as_echo "$as_me: program exited with status $ac_status" >&5
31663 $as_echo "$as_me: failed program was:" >&5
31664 sed 's/^/| /' conftest.$ac_ext >&5
31665
31666 ( exit $ac_status )
31667 apu_try_berkeley_db=no
31668 fi
31669 rm -rf conftest.dSYM
31670 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
31671 fi
31672
31673
31674
31675     LIBS="$apu_try_berkeley_db_save_libs"
31676
31677
31678                 eval "$cache_id=$apu_try_berkeley_db"
31679
31680 fi
31681
31682             result="`eval echo '$'$cache_id`"
31683             { $as_echo "$as_me:$LINENO: result: $result" >&5
31684 $as_echo "$result" >&6; }
31685           elif test "3" = "1"; then
31686             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
31687 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
31688 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
31689 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
31690   $as_echo_n "(cached) " >&6
31691 else
31692   ac_check_lib_save_LIBS=$LIBS
31693 LIBS="-l$bdb_libname  $LIBS"
31694 cat >conftest.$ac_ext <<_ACEOF
31695 /* confdefs.h.  */
31696 _ACEOF
31697 cat confdefs.h >>conftest.$ac_ext
31698 cat >>conftest.$ac_ext <<_ACEOF
31699 /* end confdefs.h.  */
31700
31701 /* Override any GCC internal prototype to avoid an error.
31702    Use char because int might match the return type of a GCC
31703    builtin and then its argument prototype would still apply.  */
31704 #ifdef __cplusplus
31705 extern "C"
31706 #endif
31707 char dbopen ();
31708 int
31709 main ()
31710 {
31711 return dbopen ();
31712   ;
31713   return 0;
31714 }
31715 _ACEOF
31716 rm -f conftest.$ac_objext conftest$ac_exeext
31717 if { (ac_try="$ac_link"
31718 case "(($ac_try" in
31719   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31720   *) ac_try_echo=$ac_try;;
31721 esac
31722 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31723 $as_echo "$ac_try_echo") >&5
31724   (eval "$ac_link") 2>conftest.er1
31725   ac_status=$?
31726   grep -v '^ *+' conftest.er1 >conftest.err
31727   rm -f conftest.er1
31728   cat conftest.err >&5
31729   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31730   (exit $ac_status); } && {
31731          test -z "$ac_c_werror_flag" ||
31732          test ! -s conftest.err
31733        } && test -s conftest$ac_exeext && {
31734          test "$cross_compiling" = yes ||
31735          $as_test_x conftest$ac_exeext
31736        }; then
31737   eval "$as_ac_Lib=yes"
31738 else
31739   $as_echo "$as_me: failed program was:" >&5
31740 sed 's/^/| /' conftest.$ac_ext >&5
31741
31742         eval "$as_ac_Lib=no"
31743 fi
31744
31745 rm -rf conftest.dSYM
31746 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
31747       conftest$ac_exeext conftest.$ac_ext
31748 LIBS=$ac_check_lib_save_LIBS
31749 fi
31750 ac_res=`eval 'as_val=${'$as_ac_Lib'}
31751                  $as_echo "$as_val"'`
31752                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
31753 $as_echo "$ac_res" >&6; }
31754 as_val=`eval 'as_val=${'$as_ac_Lib'}
31755                  $as_echo "$as_val"'`
31756    if test "x$as_val" = x""yes; then
31757   result=yes
31758 else
31759   result=no
31760
31761 fi
31762
31763           elif test "3" = "2"; then
31764             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
31765 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
31766 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
31767 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
31768   $as_echo_n "(cached) " >&6
31769 else
31770   ac_check_lib_save_LIBS=$LIBS
31771 LIBS="-l$bdb_libname  $LIBS"
31772 cat >conftest.$ac_ext <<_ACEOF
31773 /* confdefs.h.  */
31774 _ACEOF
31775 cat confdefs.h >>conftest.$ac_ext
31776 cat >>conftest.$ac_ext <<_ACEOF
31777 /* end confdefs.h.  */
31778
31779 /* Override any GCC internal prototype to avoid an error.
31780    Use char because int might match the return type of a GCC
31781    builtin and then its argument prototype would still apply.  */
31782 #ifdef __cplusplus
31783 extern "C"
31784 #endif
31785 char db_open ();
31786 int
31787 main ()
31788 {
31789 return db_open ();
31790   ;
31791   return 0;
31792 }
31793 _ACEOF
31794 rm -f conftest.$ac_objext conftest$ac_exeext
31795 if { (ac_try="$ac_link"
31796 case "(($ac_try" in
31797   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
31798   *) ac_try_echo=$ac_try;;
31799 esac
31800 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
31801 $as_echo "$ac_try_echo") >&5
31802   (eval "$ac_link") 2>conftest.er1
31803   ac_status=$?
31804   grep -v '^ *+' conftest.er1 >conftest.err
31805   rm -f conftest.er1
31806   cat conftest.err >&5
31807   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
31808   (exit $ac_status); } && {
31809          test -z "$ac_c_werror_flag" ||
31810          test ! -s conftest.err
31811        } && test -s conftest$ac_exeext && {
31812          test "$cross_compiling" = yes ||
31813          $as_test_x conftest$ac_exeext
31814        }; then
31815   eval "$as_ac_Lib=yes"
31816 else
31817   $as_echo "$as_me: failed program was:" >&5
31818 sed 's/^/| /' conftest.$ac_ext >&5
31819
31820         eval "$as_ac_Lib=no"
31821 fi
31822
31823 rm -rf conftest.dSYM
31824 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
31825       conftest$ac_exeext conftest.$ac_ext
31826 LIBS=$ac_check_lib_save_LIBS
31827 fi
31828 ac_res=`eval 'as_val=${'$as_ac_Lib'}
31829                  $as_echo "$as_val"'`
31830                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
31831 $as_echo "$ac_res" >&6; }
31832 as_val=`eval 'as_val=${'$as_ac_Lib'}
31833                  $as_echo "$as_val"'`
31834    if test "x$as_val" = x""yes; then
31835   result=yes
31836 else
31837   result=no
31838
31839 fi
31840
31841           fi
31842
31843 else
31844   result="no"
31845 fi
31846
31847
31848
31849         # If we found it, no need to search any more.
31850         if test "$result" = "yes"; then
31851           found="$bdb_place"
31852           break
31853         fi
31854       done
31855       test "$found" != "not" && break
31856     done
31857     test "$found" != "not" && break
31858   done
31859
31860   # Restore the original values of the flags we tweak.
31861   LDFLAGS="$apu_check_lib_save_ldflags"
31862   CPPFLAGS="$apu_check_lib_save_cppflags"
31863
31864   case "$found" in
31865   "not")
31866     apu_have_db=0
31867     ;;
31868   "std")
31869     apu_db_header=$bdb_header
31870     apu_db_lib=$bdb_libname
31871     apu_have_db=1
31872     ;;
31873   *":"*)
31874     header="`echo $found | sed -e 's/:.*$//'`"
31875     lib="`echo $found | sed -e 's/^.*://'`"
31876
31877
31878   if test "x$APRUTIL_INCLUDES" = "x"; then
31879     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
31880     APRUTIL_INCLUDES="-I$header"
31881   else
31882     apr_addto_bugger="-I$header"
31883     for i in $apr_addto_bugger; do
31884       apr_addto_duplicate="0"
31885       for j in $APRUTIL_INCLUDES; do
31886         if test "x$i" = "x$j"; then
31887           apr_addto_duplicate="1"
31888           break
31889         fi
31890       done
31891       if test $apr_addto_duplicate = "0"; then
31892         echo "  adding \"$i\" to APRUTIL_INCLUDES"
31893         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
31894       fi
31895     done
31896   fi
31897
31898
31899   if test "x$APRUTIL_LDFLAGS" = "x"; then
31900     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
31901     APRUTIL_LDFLAGS="-L$lib"
31902   else
31903     apr_addto_bugger="-L$lib"
31904     for i in $apr_addto_bugger; do
31905       apr_addto_duplicate="0"
31906       for j in $APRUTIL_LDFLAGS; do
31907         if test "x$i" = "x$j"; then
31908           apr_addto_duplicate="1"
31909           break
31910         fi
31911       done
31912       if test $apr_addto_duplicate = "0"; then
31913         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
31914         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
31915       fi
31916     done
31917   fi
31918
31919     apu_db_header=$bdb_header
31920     apu_db_lib=$bdb_libname
31921     apu_have_db=1
31922     ;;
31923   *)
31924
31925   if test "x$APRUTIL_INCLUDES" = "x"; then
31926     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
31927     APRUTIL_INCLUDES="-I$found/include"
31928   else
31929     apr_addto_bugger="-I$found/include"
31930     for i in $apr_addto_bugger; do
31931       apr_addto_duplicate="0"
31932       for j in $APRUTIL_INCLUDES; do
31933         if test "x$i" = "x$j"; then
31934           apr_addto_duplicate="1"
31935           break
31936         fi
31937       done
31938       if test $apr_addto_duplicate = "0"; then
31939         echo "  adding \"$i\" to APRUTIL_INCLUDES"
31940         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
31941       fi
31942     done
31943   fi
31944
31945
31946   if test "x$APRUTIL_LDFLAGS" = "x"; then
31947     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
31948     APRUTIL_LDFLAGS="-L$found/lib"
31949   else
31950     apr_addto_bugger="-L$found/lib"
31951     for i in $apr_addto_bugger; do
31952       apr_addto_duplicate="0"
31953       for j in $APRUTIL_LDFLAGS; do
31954         if test "x$i" = "x$j"; then
31955           apr_addto_duplicate="1"
31956           break
31957         fi
31958       done
31959       if test $apr_addto_duplicate = "0"; then
31960         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
31961         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
31962       fi
31963     done
31964   fi
31965
31966     apu_db_header=$bdb_header
31967     apu_db_lib=$bdb_libname
31968     apu_have_db=1
31969     ;;
31970   esac
31971
31972   if test "$apu_have_db" = "1"; then
31973     apu_db_version=3
31974   fi
31975
31976                     if test "$apu_db_version" != "3"; then
31977
31978   places="$all_places"
31979   if test -z "$places"; then
31980     places="std"
31981   fi
31982
31983   bdb_version=2
31984   if test "-1" != "-1"; then
31985     bdb_version="$bdb_version.-1"
31986     if test "-1" != "-1"; then
31987       bdb_version="$bdb_version.-1"
31988     fi
31989   fi
31990   bdb_places="$places"
31991   bdb_default_search_headers="db2/db.h db.h"
31992   bdb_default_search_lib_names="db2 db"
31993
31994
31995   apu_have_db=0
31996
31997   # Save the original values of the flags we tweak.
31998   apu_check_lib_save_libs="$LIBS"
31999   apu_check_lib_save_ldflags="$LDFLAGS"
32000   apu_check_lib_save_cppflags="$CPPFLAGS"
32001
32002   # The variable `found' is the prefix under which we've found
32003   # Berkeley DB, or `not' if we haven't found it anywhere yet.
32004   found=not
32005   for bdb_place in $bdb_places; do
32006
32007     LDFLAGS="$apu_check_lib_save_ldflags"
32008     CPPFLAGS="$apu_check_lib_save_cppflags"
32009     case "$bdb_place" in
32010       "std" )
32011         description="the standard places"
32012       ;;
32013       *":"* )
32014         header="`echo $bdb_place | sed -e 's/:.*$//'`"
32015         lib="`echo $bdb_place | sed -e 's/^.*://'`"
32016         CPPFLAGS="$CPPFLAGS -I$header"
32017         LDFLAGS="$LDFLAGS -L$lib"
32018         description="$header and $lib"
32019       ;;
32020       * )
32021         if test -d $bdb_place; then
32022           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
32023           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
32024         else
32025           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
32026 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
32027           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
32028 $as_echo "directory not found" >&6; }
32029           continue
32030         fi
32031         description="$bdb_place"
32032       ;;
32033     esac
32034
32035     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
32036     # trick to display a message instead.
32037     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
32038 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
32039     { $as_echo "$as_me:$LINENO: result: " >&5
32040 $as_echo "" >&6; }
32041
32042     for bdb_libname in $bdb_default_search_lib_names; do
32043       for bdb_header in $bdb_default_search_headers; do
32044         # Clear the header cache variable for each location
32045
32046         cache_id="`echo ac_cv_header_${bdb_header} \
32047                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
32048
32049         unset $cache_id
32050         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
32051 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
32052   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
32053 $as_echo_n "checking for $bdb_header... " >&6; }
32054 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
32055   $as_echo_n "(cached) " >&6
32056 fi
32057 ac_res=`eval 'as_val=${'$as_ac_Header'}
32058                  $as_echo "$as_val"'`
32059                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
32060 $as_echo "$ac_res" >&6; }
32061 else
32062   # Is the header compilable?
32063 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
32064 $as_echo_n "checking $bdb_header usability... " >&6; }
32065 cat >conftest.$ac_ext <<_ACEOF
32066 /* confdefs.h.  */
32067 _ACEOF
32068 cat confdefs.h >>conftest.$ac_ext
32069 cat >>conftest.$ac_ext <<_ACEOF
32070 /* end confdefs.h.  */
32071 $ac_includes_default
32072 #include <$bdb_header>
32073 _ACEOF
32074 rm -f conftest.$ac_objext
32075 if { (ac_try="$ac_compile"
32076 case "(($ac_try" in
32077   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32078   *) ac_try_echo=$ac_try;;
32079 esac
32080 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32081 $as_echo "$ac_try_echo") >&5
32082   (eval "$ac_compile") 2>conftest.er1
32083   ac_status=$?
32084   grep -v '^ *+' conftest.er1 >conftest.err
32085   rm -f conftest.er1
32086   cat conftest.err >&5
32087   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32088   (exit $ac_status); } && {
32089          test -z "$ac_c_werror_flag" ||
32090          test ! -s conftest.err
32091        } && test -s conftest.$ac_objext; then
32092   ac_header_compiler=yes
32093 else
32094   $as_echo "$as_me: failed program was:" >&5
32095 sed 's/^/| /' conftest.$ac_ext >&5
32096
32097         ac_header_compiler=no
32098 fi
32099
32100 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
32101 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
32102 $as_echo "$ac_header_compiler" >&6; }
32103
32104 # Is the header present?
32105 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
32106 $as_echo_n "checking $bdb_header presence... " >&6; }
32107 cat >conftest.$ac_ext <<_ACEOF
32108 /* confdefs.h.  */
32109 _ACEOF
32110 cat confdefs.h >>conftest.$ac_ext
32111 cat >>conftest.$ac_ext <<_ACEOF
32112 /* end confdefs.h.  */
32113 #include <$bdb_header>
32114 _ACEOF
32115 if { (ac_try="$ac_cpp conftest.$ac_ext"
32116 case "(($ac_try" in
32117   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32118   *) ac_try_echo=$ac_try;;
32119 esac
32120 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32121 $as_echo "$ac_try_echo") >&5
32122   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
32123   ac_status=$?
32124   grep -v '^ *+' conftest.er1 >conftest.err
32125   rm -f conftest.er1
32126   cat conftest.err >&5
32127   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32128   (exit $ac_status); } >/dev/null && {
32129          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
32130          test ! -s conftest.err
32131        }; then
32132   ac_header_preproc=yes
32133 else
32134   $as_echo "$as_me: failed program was:" >&5
32135 sed 's/^/| /' conftest.$ac_ext >&5
32136
32137   ac_header_preproc=no
32138 fi
32139
32140 rm -f conftest.err conftest.$ac_ext
32141 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
32142 $as_echo "$ac_header_preproc" >&6; }
32143
32144 # So?  What about this header?
32145 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
32146   yes:no: )
32147     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
32148 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
32149     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
32150 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
32151     ac_header_preproc=yes
32152     ;;
32153   no:yes:* )
32154     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
32155 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
32156     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
32157 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
32158     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
32159 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
32160     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
32161 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
32162     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
32163 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
32164     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
32165 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
32166
32167     ;;
32168 esac
32169 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
32170 $as_echo_n "checking for $bdb_header... " >&6; }
32171 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
32172   $as_echo_n "(cached) " >&6
32173 else
32174   eval "$as_ac_Header=\$ac_header_preproc"
32175 fi
32176 ac_res=`eval 'as_val=${'$as_ac_Header'}
32177                  $as_echo "$as_val"'`
32178                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
32179 $as_echo "$ac_res" >&6; }
32180
32181 fi
32182 as_val=`eval 'as_val=${'$as_ac_Header'}
32183                  $as_echo "$as_val"'`
32184    if test "x$as_val" = x""yes; then
32185
32186           if test "2" = "3" -o "2" = "4"; then
32187             # We generate a separate cache variable for each prefix and libname
32188             # we search under.  That way, we avoid caching information that
32189             # changes if the user runs `configure' with a different set of
32190             # switches.
32191
32192             cache_id="`echo apu_cv_check_berkeley_db_2_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
32193                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
32194
32195
32196             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
32197 $as_echo_n "checking for -l$bdb_libname... " >&6; }
32198                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
32199   $as_echo_n "(cached) " >&6
32200 else
32201
32202
32203     apu_try_berkeley_db_save_libs="$LIBS"
32204
32205     apu_check_berkeley_db_major=2
32206     apu_check_berkeley_db_minor=-1
32207     apu_check_berkeley_db_patch=-1
32208     apu_try_berkeley_db_header=$bdb_header
32209     apu_try_berkeley_db_libname=$bdb_libname
32210
32211     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
32212     if test "$cross_compiling" = yes; then
32213   apu_try_berkeley_db=yes
32214
32215 else
32216   cat >conftest.$ac_ext <<_ACEOF
32217 /* confdefs.h.  */
32218 _ACEOF
32219 cat confdefs.h >>conftest.$ac_ext
32220 cat >>conftest.$ac_ext <<_ACEOF
32221 /* end confdefs.h.  */
32222
32223 #include <stdlib.h>
32224 #include <stdio.h>
32225 #include <$apu_try_berkeley_db_header>
32226 main ()
32227 {
32228   int major, minor, patch;
32229
32230   db_version(&major, &minor, &patch);
32231
32232   /* Sanity check: ensure that db.h constants actually match the db library */
32233   if (major != DB_VERSION_MAJOR
32234       || minor != DB_VERSION_MINOR
32235       || patch != DB_VERSION_PATCH)
32236     exit (1);
32237
32238   /* Run-time check:  ensure the library claims to be the correct version. */
32239
32240   if ($apu_check_berkeley_db_major != -1) {
32241     if (major < $apu_check_berkeley_db_major)
32242       exit (1);
32243     if (major > $apu_check_berkeley_db_major)
32244       exit (0);
32245   }
32246
32247   if ($apu_check_berkeley_db_minor != -1) {
32248     if (minor < $apu_check_berkeley_db_minor)
32249       exit (1);
32250     if (minor > $apu_check_berkeley_db_minor)
32251       exit (0);
32252   }
32253
32254   if ($apu_check_berkeley_db_patch == -1
32255       || patch >= $apu_check_berkeley_db_patch)
32256     exit (0);
32257   else
32258     exit (1);
32259 }
32260
32261 _ACEOF
32262 rm -f conftest$ac_exeext
32263 if { (ac_try="$ac_link"
32264 case "(($ac_try" in
32265   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32266   *) ac_try_echo=$ac_try;;
32267 esac
32268 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32269 $as_echo "$ac_try_echo") >&5
32270   (eval "$ac_link") 2>&5
32271   ac_status=$?
32272   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32273   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
32274   { (case "(($ac_try" in
32275   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32276   *) ac_try_echo=$ac_try;;
32277 esac
32278 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32279 $as_echo "$ac_try_echo") >&5
32280   (eval "$ac_try") 2>&5
32281   ac_status=$?
32282   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32283   (exit $ac_status); }; }; then
32284   apu_try_berkeley_db=yes
32285 else
32286   $as_echo "$as_me: program exited with status $ac_status" >&5
32287 $as_echo "$as_me: failed program was:" >&5
32288 sed 's/^/| /' conftest.$ac_ext >&5
32289
32290 ( exit $ac_status )
32291 apu_try_berkeley_db=no
32292 fi
32293 rm -rf conftest.dSYM
32294 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
32295 fi
32296
32297
32298
32299     LIBS="$apu_try_berkeley_db_save_libs"
32300
32301
32302                 eval "$cache_id=$apu_try_berkeley_db"
32303
32304 fi
32305
32306             result="`eval echo '$'$cache_id`"
32307             { $as_echo "$as_me:$LINENO: result: $result" >&5
32308 $as_echo "$result" >&6; }
32309           elif test "2" = "1"; then
32310             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
32311 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
32312 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
32313 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
32314   $as_echo_n "(cached) " >&6
32315 else
32316   ac_check_lib_save_LIBS=$LIBS
32317 LIBS="-l$bdb_libname  $LIBS"
32318 cat >conftest.$ac_ext <<_ACEOF
32319 /* confdefs.h.  */
32320 _ACEOF
32321 cat confdefs.h >>conftest.$ac_ext
32322 cat >>conftest.$ac_ext <<_ACEOF
32323 /* end confdefs.h.  */
32324
32325 /* Override any GCC internal prototype to avoid an error.
32326    Use char because int might match the return type of a GCC
32327    builtin and then its argument prototype would still apply.  */
32328 #ifdef __cplusplus
32329 extern "C"
32330 #endif
32331 char dbopen ();
32332 int
32333 main ()
32334 {
32335 return dbopen ();
32336   ;
32337   return 0;
32338 }
32339 _ACEOF
32340 rm -f conftest.$ac_objext conftest$ac_exeext
32341 if { (ac_try="$ac_link"
32342 case "(($ac_try" in
32343   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32344   *) ac_try_echo=$ac_try;;
32345 esac
32346 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32347 $as_echo "$ac_try_echo") >&5
32348   (eval "$ac_link") 2>conftest.er1
32349   ac_status=$?
32350   grep -v '^ *+' conftest.er1 >conftest.err
32351   rm -f conftest.er1
32352   cat conftest.err >&5
32353   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32354   (exit $ac_status); } && {
32355          test -z "$ac_c_werror_flag" ||
32356          test ! -s conftest.err
32357        } && test -s conftest$ac_exeext && {
32358          test "$cross_compiling" = yes ||
32359          $as_test_x conftest$ac_exeext
32360        }; then
32361   eval "$as_ac_Lib=yes"
32362 else
32363   $as_echo "$as_me: failed program was:" >&5
32364 sed 's/^/| /' conftest.$ac_ext >&5
32365
32366         eval "$as_ac_Lib=no"
32367 fi
32368
32369 rm -rf conftest.dSYM
32370 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
32371       conftest$ac_exeext conftest.$ac_ext
32372 LIBS=$ac_check_lib_save_LIBS
32373 fi
32374 ac_res=`eval 'as_val=${'$as_ac_Lib'}
32375                  $as_echo "$as_val"'`
32376                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
32377 $as_echo "$ac_res" >&6; }
32378 as_val=`eval 'as_val=${'$as_ac_Lib'}
32379                  $as_echo "$as_val"'`
32380    if test "x$as_val" = x""yes; then
32381   result=yes
32382 else
32383   result=no
32384
32385 fi
32386
32387           elif test "2" = "2"; then
32388             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
32389 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
32390 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
32391 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
32392   $as_echo_n "(cached) " >&6
32393 else
32394   ac_check_lib_save_LIBS=$LIBS
32395 LIBS="-l$bdb_libname  $LIBS"
32396 cat >conftest.$ac_ext <<_ACEOF
32397 /* confdefs.h.  */
32398 _ACEOF
32399 cat confdefs.h >>conftest.$ac_ext
32400 cat >>conftest.$ac_ext <<_ACEOF
32401 /* end confdefs.h.  */
32402
32403 /* Override any GCC internal prototype to avoid an error.
32404    Use char because int might match the return type of a GCC
32405    builtin and then its argument prototype would still apply.  */
32406 #ifdef __cplusplus
32407 extern "C"
32408 #endif
32409 char db_open ();
32410 int
32411 main ()
32412 {
32413 return db_open ();
32414   ;
32415   return 0;
32416 }
32417 _ACEOF
32418 rm -f conftest.$ac_objext conftest$ac_exeext
32419 if { (ac_try="$ac_link"
32420 case "(($ac_try" in
32421   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32422   *) ac_try_echo=$ac_try;;
32423 esac
32424 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32425 $as_echo "$ac_try_echo") >&5
32426   (eval "$ac_link") 2>conftest.er1
32427   ac_status=$?
32428   grep -v '^ *+' conftest.er1 >conftest.err
32429   rm -f conftest.er1
32430   cat conftest.err >&5
32431   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32432   (exit $ac_status); } && {
32433          test -z "$ac_c_werror_flag" ||
32434          test ! -s conftest.err
32435        } && test -s conftest$ac_exeext && {
32436          test "$cross_compiling" = yes ||
32437          $as_test_x conftest$ac_exeext
32438        }; then
32439   eval "$as_ac_Lib=yes"
32440 else
32441   $as_echo "$as_me: failed program was:" >&5
32442 sed 's/^/| /' conftest.$ac_ext >&5
32443
32444         eval "$as_ac_Lib=no"
32445 fi
32446
32447 rm -rf conftest.dSYM
32448 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
32449       conftest$ac_exeext conftest.$ac_ext
32450 LIBS=$ac_check_lib_save_LIBS
32451 fi
32452 ac_res=`eval 'as_val=${'$as_ac_Lib'}
32453                  $as_echo "$as_val"'`
32454                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
32455 $as_echo "$ac_res" >&6; }
32456 as_val=`eval 'as_val=${'$as_ac_Lib'}
32457                  $as_echo "$as_val"'`
32458    if test "x$as_val" = x""yes; then
32459   result=yes
32460 else
32461   result=no
32462
32463 fi
32464
32465           fi
32466
32467 else
32468   result="no"
32469 fi
32470
32471
32472
32473         # If we found it, no need to search any more.
32474         if test "$result" = "yes"; then
32475           found="$bdb_place"
32476           break
32477         fi
32478       done
32479       test "$found" != "not" && break
32480     done
32481     test "$found" != "not" && break
32482   done
32483
32484   # Restore the original values of the flags we tweak.
32485   LDFLAGS="$apu_check_lib_save_ldflags"
32486   CPPFLAGS="$apu_check_lib_save_cppflags"
32487
32488   case "$found" in
32489   "not")
32490     apu_have_db=0
32491     ;;
32492   "std")
32493     apu_db_header=$bdb_header
32494     apu_db_lib=$bdb_libname
32495     apu_have_db=1
32496     ;;
32497   *":"*)
32498     header="`echo $found | sed -e 's/:.*$//'`"
32499     lib="`echo $found | sed -e 's/^.*://'`"
32500
32501
32502   if test "x$APRUTIL_INCLUDES" = "x"; then
32503     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
32504     APRUTIL_INCLUDES="-I$header"
32505   else
32506     apr_addto_bugger="-I$header"
32507     for i in $apr_addto_bugger; do
32508       apr_addto_duplicate="0"
32509       for j in $APRUTIL_INCLUDES; do
32510         if test "x$i" = "x$j"; then
32511           apr_addto_duplicate="1"
32512           break
32513         fi
32514       done
32515       if test $apr_addto_duplicate = "0"; then
32516         echo "  adding \"$i\" to APRUTIL_INCLUDES"
32517         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
32518       fi
32519     done
32520   fi
32521
32522
32523   if test "x$APRUTIL_LDFLAGS" = "x"; then
32524     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
32525     APRUTIL_LDFLAGS="-L$lib"
32526   else
32527     apr_addto_bugger="-L$lib"
32528     for i in $apr_addto_bugger; do
32529       apr_addto_duplicate="0"
32530       for j in $APRUTIL_LDFLAGS; do
32531         if test "x$i" = "x$j"; then
32532           apr_addto_duplicate="1"
32533           break
32534         fi
32535       done
32536       if test $apr_addto_duplicate = "0"; then
32537         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
32538         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
32539       fi
32540     done
32541   fi
32542
32543     apu_db_header=$bdb_header
32544     apu_db_lib=$bdb_libname
32545     apu_have_db=1
32546     ;;
32547   *)
32548
32549   if test "x$APRUTIL_INCLUDES" = "x"; then
32550     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
32551     APRUTIL_INCLUDES="-I$found/include"
32552   else
32553     apr_addto_bugger="-I$found/include"
32554     for i in $apr_addto_bugger; do
32555       apr_addto_duplicate="0"
32556       for j in $APRUTIL_INCLUDES; do
32557         if test "x$i" = "x$j"; then
32558           apr_addto_duplicate="1"
32559           break
32560         fi
32561       done
32562       if test $apr_addto_duplicate = "0"; then
32563         echo "  adding \"$i\" to APRUTIL_INCLUDES"
32564         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
32565       fi
32566     done
32567   fi
32568
32569
32570   if test "x$APRUTIL_LDFLAGS" = "x"; then
32571     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
32572     APRUTIL_LDFLAGS="-L$found/lib"
32573   else
32574     apr_addto_bugger="-L$found/lib"
32575     for i in $apr_addto_bugger; do
32576       apr_addto_duplicate="0"
32577       for j in $APRUTIL_LDFLAGS; do
32578         if test "x$i" = "x$j"; then
32579           apr_addto_duplicate="1"
32580           break
32581         fi
32582       done
32583       if test $apr_addto_duplicate = "0"; then
32584         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
32585         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
32586       fi
32587     done
32588   fi
32589
32590     apu_db_header=$bdb_header
32591     apu_db_lib=$bdb_libname
32592     apu_have_db=1
32593     ;;
32594   esac
32595
32596   if test "$apu_have_db" = "1"; then
32597     apu_db_version=2
32598   fi
32599
32600                       if test "$apu_db_version" != "2"; then
32601
32602   places="$all_places"
32603   if test -z "$places"; then
32604     places="std"
32605   fi
32606
32607   bdb_version=1
32608   if test "0" != "-1"; then
32609     bdb_version="$bdb_version.0"
32610     if test "0" != "-1"; then
32611       bdb_version="$bdb_version.0"
32612     fi
32613   fi
32614   bdb_places="$places"
32615   bdb_default_search_headers="db1/db.h db.h"
32616   bdb_default_search_lib_names="db1"
32617
32618
32619   apu_have_db=0
32620
32621   # Save the original values of the flags we tweak.
32622   apu_check_lib_save_libs="$LIBS"
32623   apu_check_lib_save_ldflags="$LDFLAGS"
32624   apu_check_lib_save_cppflags="$CPPFLAGS"
32625
32626   # The variable `found' is the prefix under which we've found
32627   # Berkeley DB, or `not' if we haven't found it anywhere yet.
32628   found=not
32629   for bdb_place in $bdb_places; do
32630
32631     LDFLAGS="$apu_check_lib_save_ldflags"
32632     CPPFLAGS="$apu_check_lib_save_cppflags"
32633     case "$bdb_place" in
32634       "std" )
32635         description="the standard places"
32636       ;;
32637       *":"* )
32638         header="`echo $bdb_place | sed -e 's/:.*$//'`"
32639         lib="`echo $bdb_place | sed -e 's/^.*://'`"
32640         CPPFLAGS="$CPPFLAGS -I$header"
32641         LDFLAGS="$LDFLAGS -L$lib"
32642         description="$header and $lib"
32643       ;;
32644       * )
32645         if test -d $bdb_place; then
32646           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
32647           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
32648         else
32649           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
32650 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
32651           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
32652 $as_echo "directory not found" >&6; }
32653           continue
32654         fi
32655         description="$bdb_place"
32656       ;;
32657     esac
32658
32659     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
32660     # trick to display a message instead.
32661     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
32662 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
32663     { $as_echo "$as_me:$LINENO: result: " >&5
32664 $as_echo "" >&6; }
32665
32666     for bdb_libname in $bdb_default_search_lib_names; do
32667       for bdb_header in $bdb_default_search_headers; do
32668         # Clear the header cache variable for each location
32669
32670         cache_id="`echo ac_cv_header_${bdb_header} \
32671                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
32672
32673         unset $cache_id
32674         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
32675 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
32676   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
32677 $as_echo_n "checking for $bdb_header... " >&6; }
32678 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
32679   $as_echo_n "(cached) " >&6
32680 fi
32681 ac_res=`eval 'as_val=${'$as_ac_Header'}
32682                  $as_echo "$as_val"'`
32683                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
32684 $as_echo "$ac_res" >&6; }
32685 else
32686   # Is the header compilable?
32687 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
32688 $as_echo_n "checking $bdb_header usability... " >&6; }
32689 cat >conftest.$ac_ext <<_ACEOF
32690 /* confdefs.h.  */
32691 _ACEOF
32692 cat confdefs.h >>conftest.$ac_ext
32693 cat >>conftest.$ac_ext <<_ACEOF
32694 /* end confdefs.h.  */
32695 $ac_includes_default
32696 #include <$bdb_header>
32697 _ACEOF
32698 rm -f conftest.$ac_objext
32699 if { (ac_try="$ac_compile"
32700 case "(($ac_try" in
32701   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32702   *) ac_try_echo=$ac_try;;
32703 esac
32704 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32705 $as_echo "$ac_try_echo") >&5
32706   (eval "$ac_compile") 2>conftest.er1
32707   ac_status=$?
32708   grep -v '^ *+' conftest.er1 >conftest.err
32709   rm -f conftest.er1
32710   cat conftest.err >&5
32711   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32712   (exit $ac_status); } && {
32713          test -z "$ac_c_werror_flag" ||
32714          test ! -s conftest.err
32715        } && test -s conftest.$ac_objext; then
32716   ac_header_compiler=yes
32717 else
32718   $as_echo "$as_me: failed program was:" >&5
32719 sed 's/^/| /' conftest.$ac_ext >&5
32720
32721         ac_header_compiler=no
32722 fi
32723
32724 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
32725 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
32726 $as_echo "$ac_header_compiler" >&6; }
32727
32728 # Is the header present?
32729 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
32730 $as_echo_n "checking $bdb_header presence... " >&6; }
32731 cat >conftest.$ac_ext <<_ACEOF
32732 /* confdefs.h.  */
32733 _ACEOF
32734 cat confdefs.h >>conftest.$ac_ext
32735 cat >>conftest.$ac_ext <<_ACEOF
32736 /* end confdefs.h.  */
32737 #include <$bdb_header>
32738 _ACEOF
32739 if { (ac_try="$ac_cpp conftest.$ac_ext"
32740 case "(($ac_try" in
32741   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32742   *) ac_try_echo=$ac_try;;
32743 esac
32744 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32745 $as_echo "$ac_try_echo") >&5
32746   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
32747   ac_status=$?
32748   grep -v '^ *+' conftest.er1 >conftest.err
32749   rm -f conftest.er1
32750   cat conftest.err >&5
32751   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32752   (exit $ac_status); } >/dev/null && {
32753          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
32754          test ! -s conftest.err
32755        }; then
32756   ac_header_preproc=yes
32757 else
32758   $as_echo "$as_me: failed program was:" >&5
32759 sed 's/^/| /' conftest.$ac_ext >&5
32760
32761   ac_header_preproc=no
32762 fi
32763
32764 rm -f conftest.err conftest.$ac_ext
32765 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
32766 $as_echo "$ac_header_preproc" >&6; }
32767
32768 # So?  What about this header?
32769 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
32770   yes:no: )
32771     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
32772 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
32773     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
32774 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
32775     ac_header_preproc=yes
32776     ;;
32777   no:yes:* )
32778     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
32779 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
32780     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
32781 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
32782     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
32783 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
32784     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
32785 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
32786     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
32787 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
32788     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
32789 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
32790
32791     ;;
32792 esac
32793 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
32794 $as_echo_n "checking for $bdb_header... " >&6; }
32795 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
32796   $as_echo_n "(cached) " >&6
32797 else
32798   eval "$as_ac_Header=\$ac_header_preproc"
32799 fi
32800 ac_res=`eval 'as_val=${'$as_ac_Header'}
32801                  $as_echo "$as_val"'`
32802                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
32803 $as_echo "$ac_res" >&6; }
32804
32805 fi
32806 as_val=`eval 'as_val=${'$as_ac_Header'}
32807                  $as_echo "$as_val"'`
32808    if test "x$as_val" = x""yes; then
32809
32810           if test "1" = "3" -o "1" = "4"; then
32811             # We generate a separate cache variable for each prefix and libname
32812             # we search under.  That way, we avoid caching information that
32813             # changes if the user runs `configure' with a different set of
32814             # switches.
32815
32816             cache_id="`echo apu_cv_check_berkeley_db_1_0_0_${bdb_header}_${bdb_libname}_in_${bdb_place} \
32817                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
32818
32819
32820             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
32821 $as_echo_n "checking for -l$bdb_libname... " >&6; }
32822                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
32823   $as_echo_n "(cached) " >&6
32824 else
32825
32826
32827     apu_try_berkeley_db_save_libs="$LIBS"
32828
32829     apu_check_berkeley_db_major=1
32830     apu_check_berkeley_db_minor=0
32831     apu_check_berkeley_db_patch=0
32832     apu_try_berkeley_db_header=$bdb_header
32833     apu_try_berkeley_db_libname=$bdb_libname
32834
32835     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
32836     if test "$cross_compiling" = yes; then
32837   apu_try_berkeley_db=yes
32838
32839 else
32840   cat >conftest.$ac_ext <<_ACEOF
32841 /* confdefs.h.  */
32842 _ACEOF
32843 cat confdefs.h >>conftest.$ac_ext
32844 cat >>conftest.$ac_ext <<_ACEOF
32845 /* end confdefs.h.  */
32846
32847 #include <stdlib.h>
32848 #include <stdio.h>
32849 #include <$apu_try_berkeley_db_header>
32850 main ()
32851 {
32852   int major, minor, patch;
32853
32854   db_version(&major, &minor, &patch);
32855
32856   /* Sanity check: ensure that db.h constants actually match the db library */
32857   if (major != DB_VERSION_MAJOR
32858       || minor != DB_VERSION_MINOR
32859       || patch != DB_VERSION_PATCH)
32860     exit (1);
32861
32862   /* Run-time check:  ensure the library claims to be the correct version. */
32863
32864   if ($apu_check_berkeley_db_major != -1) {
32865     if (major < $apu_check_berkeley_db_major)
32866       exit (1);
32867     if (major > $apu_check_berkeley_db_major)
32868       exit (0);
32869   }
32870
32871   if ($apu_check_berkeley_db_minor != -1) {
32872     if (minor < $apu_check_berkeley_db_minor)
32873       exit (1);
32874     if (minor > $apu_check_berkeley_db_minor)
32875       exit (0);
32876   }
32877
32878   if ($apu_check_berkeley_db_patch == -1
32879       || patch >= $apu_check_berkeley_db_patch)
32880     exit (0);
32881   else
32882     exit (1);
32883 }
32884
32885 _ACEOF
32886 rm -f conftest$ac_exeext
32887 if { (ac_try="$ac_link"
32888 case "(($ac_try" in
32889   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32890   *) ac_try_echo=$ac_try;;
32891 esac
32892 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32893 $as_echo "$ac_try_echo") >&5
32894   (eval "$ac_link") 2>&5
32895   ac_status=$?
32896   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32897   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
32898   { (case "(($ac_try" in
32899   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32900   *) ac_try_echo=$ac_try;;
32901 esac
32902 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32903 $as_echo "$ac_try_echo") >&5
32904   (eval "$ac_try") 2>&5
32905   ac_status=$?
32906   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32907   (exit $ac_status); }; }; then
32908   apu_try_berkeley_db=yes
32909 else
32910   $as_echo "$as_me: program exited with status $ac_status" >&5
32911 $as_echo "$as_me: failed program was:" >&5
32912 sed 's/^/| /' conftest.$ac_ext >&5
32913
32914 ( exit $ac_status )
32915 apu_try_berkeley_db=no
32916 fi
32917 rm -rf conftest.dSYM
32918 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
32919 fi
32920
32921
32922
32923     LIBS="$apu_try_berkeley_db_save_libs"
32924
32925
32926                 eval "$cache_id=$apu_try_berkeley_db"
32927
32928 fi
32929
32930             result="`eval echo '$'$cache_id`"
32931             { $as_echo "$as_me:$LINENO: result: $result" >&5
32932 $as_echo "$result" >&6; }
32933           elif test "1" = "1"; then
32934             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
32935 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
32936 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
32937 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
32938   $as_echo_n "(cached) " >&6
32939 else
32940   ac_check_lib_save_LIBS=$LIBS
32941 LIBS="-l$bdb_libname  $LIBS"
32942 cat >conftest.$ac_ext <<_ACEOF
32943 /* confdefs.h.  */
32944 _ACEOF
32945 cat confdefs.h >>conftest.$ac_ext
32946 cat >>conftest.$ac_ext <<_ACEOF
32947 /* end confdefs.h.  */
32948
32949 /* Override any GCC internal prototype to avoid an error.
32950    Use char because int might match the return type of a GCC
32951    builtin and then its argument prototype would still apply.  */
32952 #ifdef __cplusplus
32953 extern "C"
32954 #endif
32955 char dbopen ();
32956 int
32957 main ()
32958 {
32959 return dbopen ();
32960   ;
32961   return 0;
32962 }
32963 _ACEOF
32964 rm -f conftest.$ac_objext conftest$ac_exeext
32965 if { (ac_try="$ac_link"
32966 case "(($ac_try" in
32967   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
32968   *) ac_try_echo=$ac_try;;
32969 esac
32970 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
32971 $as_echo "$ac_try_echo") >&5
32972   (eval "$ac_link") 2>conftest.er1
32973   ac_status=$?
32974   grep -v '^ *+' conftest.er1 >conftest.err
32975   rm -f conftest.er1
32976   cat conftest.err >&5
32977   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
32978   (exit $ac_status); } && {
32979          test -z "$ac_c_werror_flag" ||
32980          test ! -s conftest.err
32981        } && test -s conftest$ac_exeext && {
32982          test "$cross_compiling" = yes ||
32983          $as_test_x conftest$ac_exeext
32984        }; then
32985   eval "$as_ac_Lib=yes"
32986 else
32987   $as_echo "$as_me: failed program was:" >&5
32988 sed 's/^/| /' conftest.$ac_ext >&5
32989
32990         eval "$as_ac_Lib=no"
32991 fi
32992
32993 rm -rf conftest.dSYM
32994 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
32995       conftest$ac_exeext conftest.$ac_ext
32996 LIBS=$ac_check_lib_save_LIBS
32997 fi
32998 ac_res=`eval 'as_val=${'$as_ac_Lib'}
32999                  $as_echo "$as_val"'`
33000                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
33001 $as_echo "$ac_res" >&6; }
33002 as_val=`eval 'as_val=${'$as_ac_Lib'}
33003                  $as_echo "$as_val"'`
33004    if test "x$as_val" = x""yes; then
33005   result=yes
33006 else
33007   result=no
33008
33009 fi
33010
33011           elif test "1" = "2"; then
33012             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
33013 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
33014 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
33015 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
33016   $as_echo_n "(cached) " >&6
33017 else
33018   ac_check_lib_save_LIBS=$LIBS
33019 LIBS="-l$bdb_libname  $LIBS"
33020 cat >conftest.$ac_ext <<_ACEOF
33021 /* confdefs.h.  */
33022 _ACEOF
33023 cat confdefs.h >>conftest.$ac_ext
33024 cat >>conftest.$ac_ext <<_ACEOF
33025 /* end confdefs.h.  */
33026
33027 /* Override any GCC internal prototype to avoid an error.
33028    Use char because int might match the return type of a GCC
33029    builtin and then its argument prototype would still apply.  */
33030 #ifdef __cplusplus
33031 extern "C"
33032 #endif
33033 char db_open ();
33034 int
33035 main ()
33036 {
33037 return db_open ();
33038   ;
33039   return 0;
33040 }
33041 _ACEOF
33042 rm -f conftest.$ac_objext conftest$ac_exeext
33043 if { (ac_try="$ac_link"
33044 case "(($ac_try" in
33045   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
33046   *) ac_try_echo=$ac_try;;
33047 esac
33048 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
33049 $as_echo "$ac_try_echo") >&5
33050   (eval "$ac_link") 2>conftest.er1
33051   ac_status=$?
33052   grep -v '^ *+' conftest.er1 >conftest.err
33053   rm -f conftest.er1
33054   cat conftest.err >&5
33055   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
33056   (exit $ac_status); } && {
33057          test -z "$ac_c_werror_flag" ||
33058          test ! -s conftest.err
33059        } && test -s conftest$ac_exeext && {
33060          test "$cross_compiling" = yes ||
33061          $as_test_x conftest$ac_exeext
33062        }; then
33063   eval "$as_ac_Lib=yes"
33064 else
33065   $as_echo "$as_me: failed program was:" >&5
33066 sed 's/^/| /' conftest.$ac_ext >&5
33067
33068         eval "$as_ac_Lib=no"
33069 fi
33070
33071 rm -rf conftest.dSYM
33072 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
33073       conftest$ac_exeext conftest.$ac_ext
33074 LIBS=$ac_check_lib_save_LIBS
33075 fi
33076 ac_res=`eval 'as_val=${'$as_ac_Lib'}
33077                  $as_echo "$as_val"'`
33078                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
33079 $as_echo "$ac_res" >&6; }
33080 as_val=`eval 'as_val=${'$as_ac_Lib'}
33081                  $as_echo "$as_val"'`
33082    if test "x$as_val" = x""yes; then
33083   result=yes
33084 else
33085   result=no
33086
33087 fi
33088
33089           fi
33090
33091 else
33092   result="no"
33093 fi
33094
33095
33096
33097         # If we found it, no need to search any more.
33098         if test "$result" = "yes"; then
33099           found="$bdb_place"
33100           break
33101         fi
33102       done
33103       test "$found" != "not" && break
33104     done
33105     test "$found" != "not" && break
33106   done
33107
33108   # Restore the original values of the flags we tweak.
33109   LDFLAGS="$apu_check_lib_save_ldflags"
33110   CPPFLAGS="$apu_check_lib_save_cppflags"
33111
33112   case "$found" in
33113   "not")
33114     apu_have_db=0
33115     ;;
33116   "std")
33117     apu_db_header=$bdb_header
33118     apu_db_lib=$bdb_libname
33119     apu_have_db=1
33120     ;;
33121   *":"*)
33122     header="`echo $found | sed -e 's/:.*$//'`"
33123     lib="`echo $found | sed -e 's/^.*://'`"
33124
33125
33126   if test "x$APRUTIL_INCLUDES" = "x"; then
33127     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
33128     APRUTIL_INCLUDES="-I$header"
33129   else
33130     apr_addto_bugger="-I$header"
33131     for i in $apr_addto_bugger; do
33132       apr_addto_duplicate="0"
33133       for j in $APRUTIL_INCLUDES; do
33134         if test "x$i" = "x$j"; then
33135           apr_addto_duplicate="1"
33136           break
33137         fi
33138       done
33139       if test $apr_addto_duplicate = "0"; then
33140         echo "  adding \"$i\" to APRUTIL_INCLUDES"
33141         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
33142       fi
33143     done
33144   fi
33145
33146
33147   if test "x$APRUTIL_LDFLAGS" = "x"; then
33148     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
33149     APRUTIL_LDFLAGS="-L$lib"
33150   else
33151     apr_addto_bugger="-L$lib"
33152     for i in $apr_addto_bugger; do
33153       apr_addto_duplicate="0"
33154       for j in $APRUTIL_LDFLAGS; do
33155         if test "x$i" = "x$j"; then
33156           apr_addto_duplicate="1"
33157           break
33158         fi
33159       done
33160       if test $apr_addto_duplicate = "0"; then
33161         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
33162         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
33163       fi
33164     done
33165   fi
33166
33167     apu_db_header=$bdb_header
33168     apu_db_lib=$bdb_libname
33169     apu_have_db=1
33170     ;;
33171   *)
33172
33173   if test "x$APRUTIL_INCLUDES" = "x"; then
33174     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
33175     APRUTIL_INCLUDES="-I$found/include"
33176   else
33177     apr_addto_bugger="-I$found/include"
33178     for i in $apr_addto_bugger; do
33179       apr_addto_duplicate="0"
33180       for j in $APRUTIL_INCLUDES; do
33181         if test "x$i" = "x$j"; then
33182           apr_addto_duplicate="1"
33183           break
33184         fi
33185       done
33186       if test $apr_addto_duplicate = "0"; then
33187         echo "  adding \"$i\" to APRUTIL_INCLUDES"
33188         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
33189       fi
33190     done
33191   fi
33192
33193
33194   if test "x$APRUTIL_LDFLAGS" = "x"; then
33195     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
33196     APRUTIL_LDFLAGS="-L$found/lib"
33197   else
33198     apr_addto_bugger="-L$found/lib"
33199     for i in $apr_addto_bugger; do
33200       apr_addto_duplicate="0"
33201       for j in $APRUTIL_LDFLAGS; do
33202         if test "x$i" = "x$j"; then
33203           apr_addto_duplicate="1"
33204           break
33205         fi
33206       done
33207       if test $apr_addto_duplicate = "0"; then
33208         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
33209         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
33210       fi
33211     done
33212   fi
33213
33214     apu_db_header=$bdb_header
33215     apu_db_lib=$bdb_libname
33216     apu_have_db=1
33217     ;;
33218   esac
33219
33220   if test "$apu_have_db" = "1"; then
33221     apu_db_version=1
33222   fi
33223
33224                         if test "$apu_db_version" != "1"; then
33225
33226   places="$all_places"
33227   if test -z "$places"; then
33228     places="std"
33229   fi
33230
33231   bdb_version=1
33232   if test "-1" != "-1"; then
33233     bdb_version="$bdb_version.-1"
33234     if test "-1" != "-1"; then
33235       bdb_version="$bdb_version.-1"
33236     fi
33237   fi
33238   bdb_places="$places"
33239   bdb_default_search_headers="db_185.h"
33240   bdb_default_search_lib_names="db"
33241
33242
33243   apu_have_db=0
33244
33245   # Save the original values of the flags we tweak.
33246   apu_check_lib_save_libs="$LIBS"
33247   apu_check_lib_save_ldflags="$LDFLAGS"
33248   apu_check_lib_save_cppflags="$CPPFLAGS"
33249
33250   # The variable `found' is the prefix under which we've found
33251   # Berkeley DB, or `not' if we haven't found it anywhere yet.
33252   found=not
33253   for bdb_place in $bdb_places; do
33254
33255     LDFLAGS="$apu_check_lib_save_ldflags"
33256     CPPFLAGS="$apu_check_lib_save_cppflags"
33257     case "$bdb_place" in
33258       "std" )
33259         description="the standard places"
33260       ;;
33261       *":"* )
33262         header="`echo $bdb_place | sed -e 's/:.*$//'`"
33263         lib="`echo $bdb_place | sed -e 's/^.*://'`"
33264         CPPFLAGS="$CPPFLAGS -I$header"
33265         LDFLAGS="$LDFLAGS -L$lib"
33266         description="$header and $lib"
33267       ;;
33268       * )
33269         if test -d $bdb_place; then
33270           LDFLAGS="$LDFLAGS -L$bdb_place/lib"
33271           CPPFLAGS="$CPPFLAGS -I$bdb_place/include"
33272         else
33273           { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $bdb_place" >&5
33274 $as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; }
33275           { $as_echo "$as_me:$LINENO: result: directory not found" >&5
33276 $as_echo "directory not found" >&6; }
33277           continue
33278         fi
33279         description="$bdb_place"
33280       ;;
33281     esac
33282
33283     # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this
33284     # trick to display a message instead.
33285     { $as_echo "$as_me:$LINENO: checking for Berkeley DB $bdb_version in $description" >&5
33286 $as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; }
33287     { $as_echo "$as_me:$LINENO: result: " >&5
33288 $as_echo "" >&6; }
33289
33290     for bdb_libname in $bdb_default_search_lib_names; do
33291       for bdb_header in $bdb_default_search_headers; do
33292         # Clear the header cache variable for each location
33293
33294         cache_id="`echo ac_cv_header_${bdb_header} \
33295                  | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
33296
33297         unset $cache_id
33298         as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh`
33299 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
33300   { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
33301 $as_echo_n "checking for $bdb_header... " >&6; }
33302 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
33303   $as_echo_n "(cached) " >&6
33304 fi
33305 ac_res=`eval 'as_val=${'$as_ac_Header'}
33306                  $as_echo "$as_val"'`
33307                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
33308 $as_echo "$ac_res" >&6; }
33309 else
33310   # Is the header compilable?
33311 { $as_echo "$as_me:$LINENO: checking $bdb_header usability" >&5
33312 $as_echo_n "checking $bdb_header usability... " >&6; }
33313 cat >conftest.$ac_ext <<_ACEOF
33314 /* confdefs.h.  */
33315 _ACEOF
33316 cat confdefs.h >>conftest.$ac_ext
33317 cat >>conftest.$ac_ext <<_ACEOF
33318 /* end confdefs.h.  */
33319 $ac_includes_default
33320 #include <$bdb_header>
33321 _ACEOF
33322 rm -f conftest.$ac_objext
33323 if { (ac_try="$ac_compile"
33324 case "(($ac_try" in
33325   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
33326   *) ac_try_echo=$ac_try;;
33327 esac
33328 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
33329 $as_echo "$ac_try_echo") >&5
33330   (eval "$ac_compile") 2>conftest.er1
33331   ac_status=$?
33332   grep -v '^ *+' conftest.er1 >conftest.err
33333   rm -f conftest.er1
33334   cat conftest.err >&5
33335   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
33336   (exit $ac_status); } && {
33337          test -z "$ac_c_werror_flag" ||
33338          test ! -s conftest.err
33339        } && test -s conftest.$ac_objext; then
33340   ac_header_compiler=yes
33341 else
33342   $as_echo "$as_me: failed program was:" >&5
33343 sed 's/^/| /' conftest.$ac_ext >&5
33344
33345         ac_header_compiler=no
33346 fi
33347
33348 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33349 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
33350 $as_echo "$ac_header_compiler" >&6; }
33351
33352 # Is the header present?
33353 { $as_echo "$as_me:$LINENO: checking $bdb_header presence" >&5
33354 $as_echo_n "checking $bdb_header presence... " >&6; }
33355 cat >conftest.$ac_ext <<_ACEOF
33356 /* confdefs.h.  */
33357 _ACEOF
33358 cat confdefs.h >>conftest.$ac_ext
33359 cat >>conftest.$ac_ext <<_ACEOF
33360 /* end confdefs.h.  */
33361 #include <$bdb_header>
33362 _ACEOF
33363 if { (ac_try="$ac_cpp conftest.$ac_ext"
33364 case "(($ac_try" in
33365   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
33366   *) ac_try_echo=$ac_try;;
33367 esac
33368 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
33369 $as_echo "$ac_try_echo") >&5
33370   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
33371   ac_status=$?
33372   grep -v '^ *+' conftest.er1 >conftest.err
33373   rm -f conftest.er1
33374   cat conftest.err >&5
33375   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
33376   (exit $ac_status); } >/dev/null && {
33377          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
33378          test ! -s conftest.err
33379        }; then
33380   ac_header_preproc=yes
33381 else
33382   $as_echo "$as_me: failed program was:" >&5
33383 sed 's/^/| /' conftest.$ac_ext >&5
33384
33385   ac_header_preproc=no
33386 fi
33387
33388 rm -f conftest.err conftest.$ac_ext
33389 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
33390 $as_echo "$ac_header_preproc" >&6; }
33391
33392 # So?  What about this header?
33393 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
33394   yes:no: )
33395     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&5
33396 $as_echo "$as_me: WARNING: $bdb_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
33397     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the compiler's result" >&5
33398 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the compiler's result" >&2;}
33399     ac_header_preproc=yes
33400     ;;
33401   no:yes:* )
33402     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: present but cannot be compiled" >&5
33403 $as_echo "$as_me: WARNING: $bdb_header: present but cannot be compiled" >&2;}
33404     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     check for missing prerequisite headers?" >&5
33405 $as_echo "$as_me: WARNING: $bdb_header:     check for missing prerequisite headers?" >&2;}
33406     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: see the Autoconf documentation" >&5
33407 $as_echo "$as_me: WARNING: $bdb_header: see the Autoconf documentation" >&2;}
33408     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&5
33409 $as_echo "$as_me: WARNING: $bdb_header:     section \"Present But Cannot Be Compiled\"" >&2;}
33410     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: proceeding with the preprocessor's result" >&5
33411 $as_echo "$as_me: WARNING: $bdb_header: proceeding with the preprocessor's result" >&2;}
33412     { $as_echo "$as_me:$LINENO: WARNING: $bdb_header: in the future, the compiler will take precedence" >&5
33413 $as_echo "$as_me: WARNING: $bdb_header: in the future, the compiler will take precedence" >&2;}
33414
33415     ;;
33416 esac
33417 { $as_echo "$as_me:$LINENO: checking for $bdb_header" >&5
33418 $as_echo_n "checking for $bdb_header... " >&6; }
33419 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
33420   $as_echo_n "(cached) " >&6
33421 else
33422   eval "$as_ac_Header=\$ac_header_preproc"
33423 fi
33424 ac_res=`eval 'as_val=${'$as_ac_Header'}
33425                  $as_echo "$as_val"'`
33426                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
33427 $as_echo "$ac_res" >&6; }
33428
33429 fi
33430 as_val=`eval 'as_val=${'$as_ac_Header'}
33431                  $as_echo "$as_val"'`
33432    if test "x$as_val" = x""yes; then
33433
33434           if test "1" = "3" -o "1" = "4"; then
33435             # We generate a separate cache variable for each prefix and libname
33436             # we search under.  That way, we avoid caching information that
33437             # changes if the user runs `configure' with a different set of
33438             # switches.
33439
33440             cache_id="`echo apu_cv_check_berkeley_db_1_-1_-1_${bdb_header}_${bdb_libname}_in_${bdb_place} \
33441                      | sed -e 's/[^a-zA-Z0-9_]/_/g'`"
33442
33443
33444             { $as_echo "$as_me:$LINENO: checking for -l$bdb_libname" >&5
33445 $as_echo_n "checking for -l$bdb_libname... " >&6; }
33446                                     if { as_var=$cache_id; eval "test \"\${$as_var+set}\" = set"; }; then
33447   $as_echo_n "(cached) " >&6
33448 else
33449
33450
33451     apu_try_berkeley_db_save_libs="$LIBS"
33452
33453     apu_check_berkeley_db_major=1
33454     apu_check_berkeley_db_minor=-1
33455     apu_check_berkeley_db_patch=-1
33456     apu_try_berkeley_db_header=$bdb_header
33457     apu_try_berkeley_db_libname=$bdb_libname
33458
33459     LIBS="$LIBS -l$apu_try_berkeley_db_libname"
33460     if test "$cross_compiling" = yes; then
33461   apu_try_berkeley_db=yes
33462
33463 else
33464   cat >conftest.$ac_ext <<_ACEOF
33465 /* confdefs.h.  */
33466 _ACEOF
33467 cat confdefs.h >>conftest.$ac_ext
33468 cat >>conftest.$ac_ext <<_ACEOF
33469 /* end confdefs.h.  */
33470
33471 #include <stdlib.h>
33472 #include <stdio.h>
33473 #include <$apu_try_berkeley_db_header>
33474 main ()
33475 {
33476   int major, minor, patch;
33477
33478   db_version(&major, &minor, &patch);
33479
33480   /* Sanity check: ensure that db.h constants actually match the db library */
33481   if (major != DB_VERSION_MAJOR
33482       || minor != DB_VERSION_MINOR
33483       || patch != DB_VERSION_PATCH)
33484     exit (1);
33485
33486   /* Run-time check:  ensure the library claims to be the correct version. */
33487
33488   if ($apu_check_berkeley_db_major != -1) {
33489     if (major < $apu_check_berkeley_db_major)
33490       exit (1);
33491     if (major > $apu_check_berkeley_db_major)
33492       exit (0);
33493   }
33494
33495   if ($apu_check_berkeley_db_minor != -1) {
33496     if (minor < $apu_check_berkeley_db_minor)
33497       exit (1);
33498     if (minor > $apu_check_berkeley_db_minor)
33499       exit (0);
33500   }
33501
33502   if ($apu_check_berkeley_db_patch == -1
33503       || patch >= $apu_check_berkeley_db_patch)
33504     exit (0);
33505   else
33506     exit (1);
33507 }
33508
33509 _ACEOF
33510 rm -f conftest$ac_exeext
33511 if { (ac_try="$ac_link"
33512 case "(($ac_try" in
33513   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
33514   *) ac_try_echo=$ac_try;;
33515 esac
33516 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
33517 $as_echo "$ac_try_echo") >&5
33518   (eval "$ac_link") 2>&5
33519   ac_status=$?
33520   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
33521   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
33522   { (case "(($ac_try" in
33523   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
33524   *) ac_try_echo=$ac_try;;
33525 esac
33526 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
33527 $as_echo "$ac_try_echo") >&5
33528   (eval "$ac_try") 2>&5
33529   ac_status=$?
33530   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
33531   (exit $ac_status); }; }; then
33532   apu_try_berkeley_db=yes
33533 else
33534   $as_echo "$as_me: program exited with status $ac_status" >&5
33535 $as_echo "$as_me: failed program was:" >&5
33536 sed 's/^/| /' conftest.$ac_ext >&5
33537
33538 ( exit $ac_status )
33539 apu_try_berkeley_db=no
33540 fi
33541 rm -rf conftest.dSYM
33542 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
33543 fi
33544
33545
33546
33547     LIBS="$apu_try_berkeley_db_save_libs"
33548
33549
33550                 eval "$cache_id=$apu_try_berkeley_db"
33551
33552 fi
33553
33554             result="`eval echo '$'$cache_id`"
33555             { $as_echo "$as_me:$LINENO: result: $result" >&5
33556 $as_echo "$result" >&6; }
33557           elif test "1" = "1"; then
33558             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh`
33559 { $as_echo "$as_me:$LINENO: checking for dbopen in -l$bdb_libname" >&5
33560 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; }
33561 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
33562   $as_echo_n "(cached) " >&6
33563 else
33564   ac_check_lib_save_LIBS=$LIBS
33565 LIBS="-l$bdb_libname  $LIBS"
33566 cat >conftest.$ac_ext <<_ACEOF
33567 /* confdefs.h.  */
33568 _ACEOF
33569 cat confdefs.h >>conftest.$ac_ext
33570 cat >>conftest.$ac_ext <<_ACEOF
33571 /* end confdefs.h.  */
33572
33573 /* Override any GCC internal prototype to avoid an error.
33574    Use char because int might match the return type of a GCC
33575    builtin and then its argument prototype would still apply.  */
33576 #ifdef __cplusplus
33577 extern "C"
33578 #endif
33579 char dbopen ();
33580 int
33581 main ()
33582 {
33583 return dbopen ();
33584   ;
33585   return 0;
33586 }
33587 _ACEOF
33588 rm -f conftest.$ac_objext conftest$ac_exeext
33589 if { (ac_try="$ac_link"
33590 case "(($ac_try" in
33591   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
33592   *) ac_try_echo=$ac_try;;
33593 esac
33594 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
33595 $as_echo "$ac_try_echo") >&5
33596   (eval "$ac_link") 2>conftest.er1
33597   ac_status=$?
33598   grep -v '^ *+' conftest.er1 >conftest.err
33599   rm -f conftest.er1
33600   cat conftest.err >&5
33601   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
33602   (exit $ac_status); } && {
33603          test -z "$ac_c_werror_flag" ||
33604          test ! -s conftest.err
33605        } && test -s conftest$ac_exeext && {
33606          test "$cross_compiling" = yes ||
33607          $as_test_x conftest$ac_exeext
33608        }; then
33609   eval "$as_ac_Lib=yes"
33610 else
33611   $as_echo "$as_me: failed program was:" >&5
33612 sed 's/^/| /' conftest.$ac_ext >&5
33613
33614         eval "$as_ac_Lib=no"
33615 fi
33616
33617 rm -rf conftest.dSYM
33618 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
33619       conftest$ac_exeext conftest.$ac_ext
33620 LIBS=$ac_check_lib_save_LIBS
33621 fi
33622 ac_res=`eval 'as_val=${'$as_ac_Lib'}
33623                  $as_echo "$as_val"'`
33624                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
33625 $as_echo "$ac_res" >&6; }
33626 as_val=`eval 'as_val=${'$as_ac_Lib'}
33627                  $as_echo "$as_val"'`
33628    if test "x$as_val" = x""yes; then
33629   result=yes
33630 else
33631   result=no
33632
33633 fi
33634
33635           elif test "1" = "2"; then
33636             as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh`
33637 { $as_echo "$as_me:$LINENO: checking for db_open in -l$bdb_libname" >&5
33638 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; }
33639 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
33640   $as_echo_n "(cached) " >&6
33641 else
33642   ac_check_lib_save_LIBS=$LIBS
33643 LIBS="-l$bdb_libname  $LIBS"
33644 cat >conftest.$ac_ext <<_ACEOF
33645 /* confdefs.h.  */
33646 _ACEOF
33647 cat confdefs.h >>conftest.$ac_ext
33648 cat >>conftest.$ac_ext <<_ACEOF
33649 /* end confdefs.h.  */
33650
33651 /* Override any GCC internal prototype to avoid an error.
33652    Use char because int might match the return type of a GCC
33653    builtin and then its argument prototype would still apply.  */
33654 #ifdef __cplusplus
33655 extern "C"
33656 #endif
33657 char db_open ();
33658 int
33659 main ()
33660 {
33661 return db_open ();
33662   ;
33663   return 0;
33664 }
33665 _ACEOF
33666 rm -f conftest.$ac_objext conftest$ac_exeext
33667 if { (ac_try="$ac_link"
33668 case "(($ac_try" in
33669   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
33670   *) ac_try_echo=$ac_try;;
33671 esac
33672 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
33673 $as_echo "$ac_try_echo") >&5
33674   (eval "$ac_link") 2>conftest.er1
33675   ac_status=$?
33676   grep -v '^ *+' conftest.er1 >conftest.err
33677   rm -f conftest.er1
33678   cat conftest.err >&5
33679   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
33680   (exit $ac_status); } && {
33681          test -z "$ac_c_werror_flag" ||
33682          test ! -s conftest.err
33683        } && test -s conftest$ac_exeext && {
33684          test "$cross_compiling" = yes ||
33685          $as_test_x conftest$ac_exeext
33686        }; then
33687   eval "$as_ac_Lib=yes"
33688 else
33689   $as_echo "$as_me: failed program was:" >&5
33690 sed 's/^/| /' conftest.$ac_ext >&5
33691
33692         eval "$as_ac_Lib=no"
33693 fi
33694
33695 rm -rf conftest.dSYM
33696 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
33697       conftest$ac_exeext conftest.$ac_ext
33698 LIBS=$ac_check_lib_save_LIBS
33699 fi
33700 ac_res=`eval 'as_val=${'$as_ac_Lib'}
33701                  $as_echo "$as_val"'`
33702                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
33703 $as_echo "$ac_res" >&6; }
33704 as_val=`eval 'as_val=${'$as_ac_Lib'}
33705                  $as_echo "$as_val"'`
33706    if test "x$as_val" = x""yes; then
33707   result=yes
33708 else
33709   result=no
33710
33711 fi
33712
33713           fi
33714
33715 else
33716   result="no"
33717 fi
33718
33719
33720
33721         # If we found it, no need to search any more.
33722         if test "$result" = "yes"; then
33723           found="$bdb_place"
33724           break
33725         fi
33726       done
33727       test "$found" != "not" && break
33728     done
33729     test "$found" != "not" && break
33730   done
33731
33732   # Restore the original values of the flags we tweak.
33733   LDFLAGS="$apu_check_lib_save_ldflags"
33734   CPPFLAGS="$apu_check_lib_save_cppflags"
33735
33736   case "$found" in
33737   "not")
33738     apu_have_db=0
33739     ;;
33740   "std")
33741     apu_db_header=$bdb_header
33742     apu_db_lib=$bdb_libname
33743     apu_have_db=1
33744     ;;
33745   *":"*)
33746     header="`echo $found | sed -e 's/:.*$//'`"
33747     lib="`echo $found | sed -e 's/^.*://'`"
33748
33749
33750   if test "x$APRUTIL_INCLUDES" = "x"; then
33751     echo "  setting APRUTIL_INCLUDES to \"-I$header\""
33752     APRUTIL_INCLUDES="-I$header"
33753   else
33754     apr_addto_bugger="-I$header"
33755     for i in $apr_addto_bugger; do
33756       apr_addto_duplicate="0"
33757       for j in $APRUTIL_INCLUDES; do
33758         if test "x$i" = "x$j"; then
33759           apr_addto_duplicate="1"
33760           break
33761         fi
33762       done
33763       if test $apr_addto_duplicate = "0"; then
33764         echo "  adding \"$i\" to APRUTIL_INCLUDES"
33765         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
33766       fi
33767     done
33768   fi
33769
33770
33771   if test "x$APRUTIL_LDFLAGS" = "x"; then
33772     echo "  setting APRUTIL_LDFLAGS to \"-L$lib\""
33773     APRUTIL_LDFLAGS="-L$lib"
33774   else
33775     apr_addto_bugger="-L$lib"
33776     for i in $apr_addto_bugger; do
33777       apr_addto_duplicate="0"
33778       for j in $APRUTIL_LDFLAGS; do
33779         if test "x$i" = "x$j"; then
33780           apr_addto_duplicate="1"
33781           break
33782         fi
33783       done
33784       if test $apr_addto_duplicate = "0"; then
33785         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
33786         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
33787       fi
33788     done
33789   fi
33790
33791     apu_db_header=$bdb_header
33792     apu_db_lib=$bdb_libname
33793     apu_have_db=1
33794     ;;
33795   *)
33796
33797   if test "x$APRUTIL_INCLUDES" = "x"; then
33798     echo "  setting APRUTIL_INCLUDES to \"-I$found/include\""
33799     APRUTIL_INCLUDES="-I$found/include"
33800   else
33801     apr_addto_bugger="-I$found/include"
33802     for i in $apr_addto_bugger; do
33803       apr_addto_duplicate="0"
33804       for j in $APRUTIL_INCLUDES; do
33805         if test "x$i" = "x$j"; then
33806           apr_addto_duplicate="1"
33807           break
33808         fi
33809       done
33810       if test $apr_addto_duplicate = "0"; then
33811         echo "  adding \"$i\" to APRUTIL_INCLUDES"
33812         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
33813       fi
33814     done
33815   fi
33816
33817
33818   if test "x$APRUTIL_LDFLAGS" = "x"; then
33819     echo "  setting APRUTIL_LDFLAGS to \"-L$found/lib\""
33820     APRUTIL_LDFLAGS="-L$found/lib"
33821   else
33822     apr_addto_bugger="-L$found/lib"
33823     for i in $apr_addto_bugger; do
33824       apr_addto_duplicate="0"
33825       for j in $APRUTIL_LDFLAGS; do
33826         if test "x$i" = "x$j"; then
33827           apr_addto_duplicate="1"
33828           break
33829         fi
33830       done
33831       if test $apr_addto_duplicate = "0"; then
33832         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
33833         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
33834       fi
33835     done
33836   fi
33837
33838     apu_db_header=$bdb_header
33839     apu_db_lib=$bdb_libname
33840     apu_have_db=1
33841     ;;
33842   esac
33843
33844   if test "$apu_have_db" = "1"; then
33845     apu_db_version=185
33846   fi
33847
33848                         fi
33849                       fi
33850                     fi
33851                   fi
33852                 fi
33853               fi
33854             fi
33855           fi
33856         fi
33857       fi
33858     fi
33859   fi
33860   { $as_echo "$as_me:$LINENO: checking for Berkeley DB" >&5
33861 $as_echo_n "checking for Berkeley DB... " >&6; }
33862   if test "$apu_have_db" = "1"; then
33863     { $as_echo "$as_me:$LINENO: result: found db$apu_db_version" >&5
33864 $as_echo "found db$apu_db_version" >&6; }
33865   else
33866     { $as_echo "$as_me:$LINENO: result: not found" >&5
33867 $as_echo "not found" >&6; }
33868   fi
33869
33870     ;;
33871   esac
33872
33873       if test "$apu_have_db" = "0"; then
33874         { { $as_echo "$as_me:$LINENO: error: Berkeley DB not found." >&5
33875 $as_echo "$as_me: error: Berkeley DB not found." >&2;}
33876    { (exit 1); exit 1; }; }
33877       fi
33878     fi
33879
33880 fi
33881
33882
33883   if test -n "$apu_db_xtra_libs"; then
33884     LIBS="$saveddbxtralibs"
33885   fi
33886
33887   case "$requested" in
33888     sdbm)
33889       apu_use_sdbm=1
33890       apu_default_dbm=sdbm
33891       ;;
33892     gdbm)
33893       apu_use_gdbm=1
33894       apu_default_dbm=gdbm
33895       ;;
33896     ndbm)
33897       apu_use_ndbm=1
33898       apu_default_dbm=ndbm
33899       ;;
33900     db)
33901       apu_use_db=1
33902       apu_default_dbm=db
33903       ;;
33904     db1)
33905       apu_use_db=1
33906       apu_default_dbm=db1
33907       ;;
33908     db185)
33909       apu_use_db=1
33910       apu_default_dbm=db185
33911       ;;
33912     db2)
33913       apu_use_db=1
33914       apu_default_dbm=db2
33915       ;;
33916     db3)
33917       apu_use_db=1
33918       apu_default_dbm=db3
33919       ;;
33920     db4)
33921       apu_use_db=1
33922       apu_default_dbm=db4
33923       ;;
33924     db41)
33925       apu_use_db=1
33926       apu_default_dbm=db4
33927       ;;
33928     db42)
33929       apu_use_db=1
33930       apu_default_dbm=db4
33931       ;;
33932     db43)
33933       apu_use_db=1
33934       apu_default_dbm=db4
33935       ;;
33936     db44)
33937       apu_use_db=1
33938       apu_default_dbm=db4
33939       ;;
33940     db45)
33941       apu_use_db=1
33942       apu_default_dbm=db4
33943       ;;
33944     db46)
33945       apu_use_db=1
33946       apu_default_dbm=db4
33947       ;;
33948     db47)
33949       apu_use_db=1
33950       apu_default_dbm=db4
33951       ;;
33952     db48)
33953       apu_use_db=1
33954       apu_default_dbm=db4
33955       ;;
33956     default)
33957             apu_default_dbm="sdbm (default)"
33958       apu_use_sdbm=1
33959       ;;
33960     *)
33961       { { $as_echo "$as_me:$LINENO: error: --with-dbm=$look_for is an unknown DBM type.
33962         Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48" >&5
33963 $as_echo "$as_me: error: --with-dbm=$look_for is an unknown DBM type.
33964         Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48" >&2;}
33965    { (exit 1); exit 1; }; }
33966       ;;
33967   esac
33968
33969         { $as_echo "$as_me:$LINENO: checking for default DBM" >&5
33970 $as_echo_n "checking for default DBM... " >&6; }
33971   { $as_echo "$as_me:$LINENO: result: $apu_default_dbm" >&5
33972 $as_echo "$apu_default_dbm" >&6; }
33973
33974
33975
33976
33977
33978
33979
33980
33981
33982
33983
33984
33985
33986       if test "$apu_have_gdbm" = "1"; then
33987
33988   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
33989     echo "  setting APRUTIL_EXPORT_LIBS to \"-lgdbm\""
33990     APRUTIL_EXPORT_LIBS="-lgdbm"
33991   else
33992     apr_addto_bugger="-lgdbm"
33993     for i in $apr_addto_bugger; do
33994       apr_addto_duplicate="0"
33995       for j in $APRUTIL_EXPORT_LIBS; do
33996         if test "x$i" = "x$j"; then
33997           apr_addto_duplicate="1"
33998           break
33999         fi
34000       done
34001       if test $apr_addto_duplicate = "0"; then
34002         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
34003         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
34004       fi
34005     done
34006   fi
34007
34008
34009   if test "x$APRUTIL_LIBS" = "x"; then
34010     echo "  setting APRUTIL_LIBS to \"-lgdbm\""
34011     APRUTIL_LIBS="-lgdbm"
34012   else
34013     apr_addto_bugger="-lgdbm"
34014     for i in $apr_addto_bugger; do
34015       apr_addto_duplicate="0"
34016       for j in $APRUTIL_LIBS; do
34017         if test "x$i" = "x$j"; then
34018           apr_addto_duplicate="1"
34019           break
34020         fi
34021       done
34022       if test $apr_addto_duplicate = "0"; then
34023         echo "  adding \"$i\" to APRUTIL_LIBS"
34024         APRUTIL_LIBS="$APRUTIL_LIBS $i"
34025       fi
34026     done
34027   fi
34028
34029   fi
34030
34031   if test "$apu_have_ndbm" = "1"; then
34032
34033   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
34034     echo "  setting APRUTIL_EXPORT_LIBS to \"-l$apu_ndbm_lib\""
34035     APRUTIL_EXPORT_LIBS="-l$apu_ndbm_lib"
34036   else
34037     apr_addto_bugger="-l$apu_ndbm_lib"
34038     for i in $apr_addto_bugger; do
34039       apr_addto_duplicate="0"
34040       for j in $APRUTIL_EXPORT_LIBS; do
34041         if test "x$i" = "x$j"; then
34042           apr_addto_duplicate="1"
34043           break
34044         fi
34045       done
34046       if test $apr_addto_duplicate = "0"; then
34047         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
34048         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
34049       fi
34050     done
34051   fi
34052
34053
34054   if test "x$APRUTIL_LIBS" = "x"; then
34055     echo "  setting APRUTIL_LIBS to \"-l$apu_ndbm_lib\""
34056     APRUTIL_LIBS="-l$apu_ndbm_lib"
34057   else
34058     apr_addto_bugger="-l$apu_ndbm_lib"
34059     for i in $apr_addto_bugger; do
34060       apr_addto_duplicate="0"
34061       for j in $APRUTIL_LIBS; do
34062         if test "x$i" = "x$j"; then
34063           apr_addto_duplicate="1"
34064           break
34065         fi
34066       done
34067       if test $apr_addto_duplicate = "0"; then
34068         echo "  adding \"$i\" to APRUTIL_LIBS"
34069         APRUTIL_LIBS="$APRUTIL_LIBS $i"
34070       fi
34071     done
34072   fi
34073
34074   fi
34075
34076   if test "$apu_have_db" = "1"; then
34077
34078   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
34079     echo "  setting APRUTIL_EXPORT_LIBS to \"-l$apu_db_lib\""
34080     APRUTIL_EXPORT_LIBS="-l$apu_db_lib"
34081   else
34082     apr_addto_bugger="-l$apu_db_lib"
34083     for i in $apr_addto_bugger; do
34084       apr_addto_duplicate="0"
34085       for j in $APRUTIL_EXPORT_LIBS; do
34086         if test "x$i" = "x$j"; then
34087           apr_addto_duplicate="1"
34088           break
34089         fi
34090       done
34091       if test $apr_addto_duplicate = "0"; then
34092         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
34093         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
34094       fi
34095     done
34096   fi
34097
34098
34099   if test "x$APRUTIL_LIBS" = "x"; then
34100     echo "  setting APRUTIL_LIBS to \"-l$apu_db_lib\""
34101     APRUTIL_LIBS="-l$apu_db_lib"
34102   else
34103     apr_addto_bugger="-l$apu_db_lib"
34104     for i in $apr_addto_bugger; do
34105       apr_addto_duplicate="0"
34106       for j in $APRUTIL_LIBS; do
34107         if test "x$i" = "x$j"; then
34108           apr_addto_duplicate="1"
34109           break
34110         fi
34111       done
34112       if test $apr_addto_duplicate = "0"; then
34113         echo "  adding \"$i\" to APRUTIL_LIBS"
34114         APRUTIL_LIBS="$APRUTIL_LIBS $i"
34115       fi
34116     done
34117   fi
34118
34119     if test -n "apu_db_xtra_libs"; then
34120
34121   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
34122     echo "  setting APRUTIL_EXPORT_LIBS to \"$apu_db_xtra_libs\""
34123     APRUTIL_EXPORT_LIBS="$apu_db_xtra_libs"
34124   else
34125     apr_addto_bugger="$apu_db_xtra_libs"
34126     for i in $apr_addto_bugger; do
34127       apr_addto_duplicate="0"
34128       for j in $APRUTIL_EXPORT_LIBS; do
34129         if test "x$i" = "x$j"; then
34130           apr_addto_duplicate="1"
34131           break
34132         fi
34133       done
34134       if test $apr_addto_duplicate = "0"; then
34135         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
34136         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
34137       fi
34138     done
34139   fi
34140
34141
34142   if test "x$APRUTIL_LIBS" = "x"; then
34143     echo "  setting APRUTIL_LIBS to \"$apu_db_xtra_libs\""
34144     APRUTIL_LIBS="$apu_db_xtra_libs"
34145   else
34146     apr_addto_bugger="$apu_db_xtra_libs"
34147     for i in $apr_addto_bugger; do
34148       apr_addto_duplicate="0"
34149       for j in $APRUTIL_LIBS; do
34150         if test "x$i" = "x$j"; then
34151           apr_addto_duplicate="1"
34152           break
34153         fi
34154       done
34155       if test $apr_addto_duplicate = "0"; then
34156         echo "  adding \"$i\" to APRUTIL_LIBS"
34157         APRUTIL_LIBS="$APRUTIL_LIBS $i"
34158       fi
34159     done
34160   fi
34161
34162     fi
34163   fi
34164
34165
34166
34167
34168 # Check whether --with-expat was given.
34169 if test "${with_expat+set}" = set; then
34170   withval=$with_expat;
34171   if test "$withval" = "yes"; then
34172     { { $as_echo "$as_me:$LINENO: error: a directory must be specified for --with-expat" >&5
34173 $as_echo "$as_me: error: a directory must be specified for --with-expat" >&2;}
34174    { (exit 1); exit 1; }; }
34175   elif test "$withval" = "no"; then
34176     { { $as_echo "$as_me:$LINENO: error: Expat cannot be disabled (at this time)" >&5
34177 $as_echo "$as_me: error: Expat cannot be disabled (at this time)" >&2;}
34178    { (exit 1); exit 1; }; }
34179   elif test "$withval" = "builtin"; then
34180     abs_expatdir="`cd $srcdir/xml/expat && pwd`"
34181     if test -d $abs_expatdir/. -a ! -d xml/expat/.; then
34182       $mkdir_p xml/expat
34183     fi
34184
34185   { $as_echo "$as_me:$LINENO: checking for Expat in xml/expat" >&5
34186 $as_echo_n "checking for Expat in xml/expat... " >&6; }
34187
34188   expat_libtool=""
34189
34190   if test -r "$abs_expatdir/lib/expat.h"; then
34191         expat_include_dir="$abs_expatdir/lib"
34192     expat_ldflags="-L$abs_expatdir"
34193     expat_libs="-lexpat"
34194     expat_libtool="$abs_expatdir/libexpat.la"
34195   elif test -r "$abs_expatdir/include/expat.h" -a \
34196     -r "$abs_expatdir/lib/libexpat.la"; then
34197         expat_include_dir="$abs_expatdir/include"
34198     expat_ldflags="-L$abs_expatdir/lib"
34199     expat_libs="-lexpat"
34200     expat_libtool="$abs_expatdir/lib/libexpat.la"
34201   elif test -r "$abs_expatdir/include/expat.h" -a \
34202     -r "$abs_expatdir/lib64/libexpat.la"; then
34203         expat_include_dir="$abs_expatdir/include"
34204     expat_ldflags="-L$abs_expatdir/lib64"
34205     expat_libs="-lexpat"
34206     expat_libtool="$abs_expatdir/lib64/libexpat.la"
34207   elif test -r "$abs_expatdir/include/expat.h" -a \
34208     -r "$abs_expatdir/lib/libexpat.a"; then
34209             expat_include_dir="$abs_expatdir/include"
34210     expat_ldflags="-L$abs_expatdir/lib"
34211     expat_libs="-lexpat"
34212   elif test -r "$abs_expatdir/xmlparse.h"; then
34213         expat_include_dir="$abs_expatdir"
34214     expat_ldflags="-L$abs_expatdir"
34215     expat_libs="-lexpat"
34216     expat_libtool="$abs_expatdir/libexpat.la"
34217     expat_old=yes
34218   elif test -r "$abs_expatdir/include/xmlparse.h" -a \
34219        -r "$abs_expatdir/lib/libexpat.a"; then
34220         expat_include_dir="$abs_expatdir/include"
34221     expat_ldflags="-L$abs_expatdir/lib"
34222     expat_libs="-lexpat"
34223     expat_old=yes
34224   elif test -r "$abs_expatdir/include/xml/xmlparse.h" -a \
34225        -r "$abs_expatdir/lib/xml/libexpat.a"; then
34226         expat_include_dir="$abs_expatdir/include/xml"
34227     expat_ldflags="-L$abs_expatdir/lib"
34228     expat_libs="-lexpat"
34229     expat_old=yes
34230   elif test -r "$abs_expatdir/include/xmltok/xmlparse.h"; then
34231         expat_include_dir="$abs_expatdir/include/xmltok"
34232     expat_ldflags="-L$abs_expatdir/lib"
34233     expat_libs="-lxmlparse -lxmltok"
34234     expat_old=yes
34235   elif test -r "$abs_expatdir/include/xml/xmlparse.h" -a \
34236        -r "$abs_expatdir/lib/libexpat.a"; then
34237         expat_include_dir="$abs_expatdir/include/xml"
34238     expat_ldflags="-L$abs_expatdir/lib"
34239     expat_libs="-lexpat"
34240     expat_old=yes
34241   elif test -r "$abs_expatdir/xmlparse/xmlparse.h"; then
34242         expat_include_dir="$abs_expatdir/xmlparse"
34243     expat_ldflags="-L$abs_expatdir"
34244     expat_libs="-lexpat"
34245     expat_old=yes
34246   fi
34247
34248   if test -n "$expat_include_dir"; then
34249         { $as_echo "$as_me:$LINENO: result: yes" >&5
34250 $as_echo "yes" >&6; }
34251   else
34252     { $as_echo "$as_me:$LINENO: result: no" >&5
34253 $as_echo "no" >&6; }
34254   fi
34255
34256   else
34257     abs_expatdir="`cd $withval && pwd`"
34258
34259   { $as_echo "$as_me:$LINENO: checking for Expat in $withval" >&5
34260 $as_echo_n "checking for Expat in $withval... " >&6; }
34261
34262   expat_libtool=""
34263
34264   if test -r "$abs_expatdir/lib/expat.h"; then
34265         expat_include_dir="$abs_expatdir/lib"
34266     expat_ldflags="-L$abs_expatdir"
34267     expat_libs="-lexpat"
34268     expat_libtool="$abs_expatdir/libexpat.la"
34269   elif test -r "$abs_expatdir/include/expat.h" -a \
34270     -r "$abs_expatdir/lib/libexpat.la"; then
34271         expat_include_dir="$abs_expatdir/include"
34272     expat_ldflags="-L$abs_expatdir/lib"
34273     expat_libs="-lexpat"
34274     expat_libtool="$abs_expatdir/lib/libexpat.la"
34275   elif test -r "$abs_expatdir/include/expat.h" -a \
34276     -r "$abs_expatdir/lib64/libexpat.la"; then
34277         expat_include_dir="$abs_expatdir/include"
34278     expat_ldflags="-L$abs_expatdir/lib64"
34279     expat_libs="-lexpat"
34280     expat_libtool="$abs_expatdir/lib64/libexpat.la"
34281   elif test -r "$abs_expatdir/include/expat.h" -a \
34282     -r "$abs_expatdir/lib/libexpat.a"; then
34283             expat_include_dir="$abs_expatdir/include"
34284     expat_ldflags="-L$abs_expatdir/lib"
34285     expat_libs="-lexpat"
34286   elif test -r "$abs_expatdir/xmlparse.h"; then
34287         expat_include_dir="$abs_expatdir"
34288     expat_ldflags="-L$abs_expatdir"
34289     expat_libs="-lexpat"
34290     expat_libtool="$abs_expatdir/libexpat.la"
34291     expat_old=yes
34292   elif test -r "$abs_expatdir/include/xmlparse.h" -a \
34293        -r "$abs_expatdir/lib/libexpat.a"; then
34294         expat_include_dir="$abs_expatdir/include"
34295     expat_ldflags="-L$abs_expatdir/lib"
34296     expat_libs="-lexpat"
34297     expat_old=yes
34298   elif test -r "$abs_expatdir/include/xml/xmlparse.h" -a \
34299        -r "$abs_expatdir/lib/xml/libexpat.a"; then
34300         expat_include_dir="$abs_expatdir/include/xml"
34301     expat_ldflags="-L$abs_expatdir/lib"
34302     expat_libs="-lexpat"
34303     expat_old=yes
34304   elif test -r "$abs_expatdir/include/xmltok/xmlparse.h"; then
34305         expat_include_dir="$abs_expatdir/include/xmltok"
34306     expat_ldflags="-L$abs_expatdir/lib"
34307     expat_libs="-lxmlparse -lxmltok"
34308     expat_old=yes
34309   elif test -r "$abs_expatdir/include/xml/xmlparse.h" -a \
34310        -r "$abs_expatdir/lib/libexpat.a"; then
34311         expat_include_dir="$abs_expatdir/include/xml"
34312     expat_ldflags="-L$abs_expatdir/lib"
34313     expat_libs="-lexpat"
34314     expat_old=yes
34315   elif test -r "$abs_expatdir/xmlparse/xmlparse.h"; then
34316         expat_include_dir="$abs_expatdir/xmlparse"
34317     expat_ldflags="-L$abs_expatdir"
34318     expat_libs="-lexpat"
34319     expat_old=yes
34320   fi
34321
34322   if test -n "$expat_include_dir"; then
34323         { $as_echo "$as_me:$LINENO: result: yes" >&5
34324 $as_echo "yes" >&6; }
34325   else
34326     { $as_echo "$as_me:$LINENO: result: no" >&5
34327 $as_echo "no" >&6; }
34328   fi
34329
34330     if test -z "$expat_include_dir"; then
34331       { { $as_echo "$as_me:$LINENO: error: Expat was not found (or recognized) in \"$withval\"" >&5
34332 $as_echo "$as_me: error: Expat was not found (or recognized) in \"$withval\"" >&2;}
34333    { (exit 1); exit 1; }; }
34334     fi
34335   fi
34336
34337 fi
34338
34339
34340 if test -z "$expat_include_dir"; then
34341   for d in /usr /usr/local xml/expat-cvs xml/expat $srcdir/xml/expat ; do
34342
34343   { $as_echo "$as_me:$LINENO: checking for Expat in $d" >&5
34344 $as_echo_n "checking for Expat in $d... " >&6; }
34345
34346   expat_libtool=""
34347
34348   if test -r "$d/lib/expat.h"; then
34349         expat_include_dir="$d/lib"
34350     expat_ldflags="-L$d"
34351     expat_libs="-lexpat"
34352     expat_libtool="$d/libexpat.la"
34353   elif test -r "$d/include/expat.h" -a \
34354     -r "$d/lib/libexpat.la"; then
34355         expat_include_dir="$d/include"
34356     expat_ldflags="-L$d/lib"
34357     expat_libs="-lexpat"
34358     expat_libtool="$d/lib/libexpat.la"
34359   elif test -r "$d/include/expat.h" -a \
34360     -r "$d/lib64/libexpat.la"; then
34361         expat_include_dir="$d/include"
34362     expat_ldflags="-L$d/lib64"
34363     expat_libs="-lexpat"
34364     expat_libtool="$d/lib64/libexpat.la"
34365   elif test -r "$d/include/expat.h" -a \
34366     -r "$d/lib/libexpat.a"; then
34367             expat_include_dir="$d/include"
34368     expat_ldflags="-L$d/lib"
34369     expat_libs="-lexpat"
34370   elif test -r "$d/xmlparse.h"; then
34371         expat_include_dir="$d"
34372     expat_ldflags="-L$d"
34373     expat_libs="-lexpat"
34374     expat_libtool="$d/libexpat.la"
34375     expat_old=yes
34376   elif test -r "$d/include/xmlparse.h" -a \
34377        -r "$d/lib/libexpat.a"; then
34378         expat_include_dir="$d/include"
34379     expat_ldflags="-L$d/lib"
34380     expat_libs="-lexpat"
34381     expat_old=yes
34382   elif test -r "$d/include/xml/xmlparse.h" -a \
34383        -r "$d/lib/xml/libexpat.a"; then
34384         expat_include_dir="$d/include/xml"
34385     expat_ldflags="-L$d/lib"
34386     expat_libs="-lexpat"
34387     expat_old=yes
34388   elif test -r "$d/include/xmltok/xmlparse.h"; then
34389         expat_include_dir="$d/include/xmltok"
34390     expat_ldflags="-L$d/lib"
34391     expat_libs="-lxmlparse -lxmltok"
34392     expat_old=yes
34393   elif test -r "$d/include/xml/xmlparse.h" -a \
34394        -r "$d/lib/libexpat.a"; then
34395         expat_include_dir="$d/include/xml"
34396     expat_ldflags="-L$d/lib"
34397     expat_libs="-lexpat"
34398     expat_old=yes
34399   elif test -r "$d/xmlparse/xmlparse.h"; then
34400         expat_include_dir="$d/xmlparse"
34401     expat_ldflags="-L$d"
34402     expat_libs="-lexpat"
34403     expat_old=yes
34404   fi
34405
34406   if test -n "$expat_include_dir"; then
34407         { $as_echo "$as_me:$LINENO: result: yes" >&5
34408 $as_echo "yes" >&6; }
34409   else
34410     { $as_echo "$as_me:$LINENO: result: no" >&5
34411 $as_echo "no" >&6; }
34412   fi
34413
34414     if test -n "$expat_include_dir"; then
34415             if test "$d" = "/usr"; then
34416         expat_ldflags=""
34417       fi
34418       break
34419     fi
34420   done
34421 fi
34422 if test -z "$expat_include_dir"; then
34423   { { $as_echo "$as_me:$LINENO: error: could not locate Expat. use --with-expat" >&5
34424 $as_echo "$as_me: error: could not locate Expat. use --with-expat" >&2;}
34425    { (exit 1); exit 1; }; }
34426 fi
34427
34428 if test -z "$expat_libtool"; then
34429   expat_libtool="$expat_ldflags $expat_libs"
34430 fi
34431
34432 if test -n "$expat_old"; then
34433
34434 cat >>confdefs.h <<\_ACEOF
34435 #define APR_HAVE_OLD_EXPAT 1
34436 _ACEOF
34437
34438 fi
34439
34440 if test "$expat_include_dir" = "xml/expat/lib" -o "$expat_include_dir" = "xml/expat-cvs/lib"; then
34441   bundled_subdir="`echo $expat_include_dir | sed -e 's%/lib%%'`"
34442
34443   # save our work to this point; this allows the sub-package to use it
34444   cat >confcache <<\_ACEOF
34445 # This file is a shell script that caches the results of configure
34446 # tests run on this system so they can be shared between configure
34447 # scripts and configure runs, see configure's option --config-cache.
34448 # It is not useful on other systems.  If it contains results you don't
34449 # want to keep, you may remove or edit it.
34450 #
34451 # config.status only pays attention to the cache file if you give it
34452 # the --recheck option to rerun configure.
34453 #
34454 # `ac_cv_env_foo' variables (set or unset) will be overridden when
34455 # loading this file, other *unset* `ac_cv_foo' will be assigned the
34456 # following values.
34457
34458 _ACEOF
34459
34460 # The following way of writing the cache mishandles newlines in values,
34461 # but we know of no workaround that is simple, portable, and efficient.
34462 # So, we kill variables containing newlines.
34463 # Ultrix sh set writes to stderr and can't be redirected directly,
34464 # and sets the high bit in the cache file unless we assign to the vars.
34465 (
34466   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
34467     eval ac_val=\$$ac_var
34468     case $ac_val in #(
34469     *${as_nl}*)
34470       case $ac_var in #(
34471       *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
34472 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
34473       esac
34474       case $ac_var in #(
34475       _ | IFS | as_nl) ;; #(
34476       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
34477       *) $as_unset $ac_var ;;
34478       esac ;;
34479     esac
34480   done
34481
34482   (set) 2>&1 |
34483     case $as_nl`(ac_space=' '; set) 2>&1` in #(
34484     *${as_nl}ac_space=\ *)
34485       # `set' does not quote correctly, so add quotes (double-quote
34486       # substitution turns \\\\ into \\, and sed turns \\ into \).
34487       sed -n \
34488         "s/'/'\\\\''/g;
34489           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
34490       ;; #(
34491     *)
34492       # `set' quotes correctly as required by POSIX, so do not add quotes.
34493       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
34494       ;;
34495     esac |
34496     sort
34497 ) |
34498   sed '
34499      /^ac_cv_env_/b end
34500      t clear
34501      :clear
34502      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
34503      t end
34504      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
34505      :end' >>confcache
34506 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
34507   if test -w "$cache_file"; then
34508     test "x$cache_file" != "x/dev/null" &&
34509       { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
34510 $as_echo "$as_me: updating cache $cache_file" >&6;}
34511     cat confcache >$cache_file
34512   else
34513     { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
34514 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
34515   fi
34516 fi
34517 rm -f confcache
34518
34519   echo "configuring package in $bundled_subdir now"
34520   ac_popdir=`pwd`
34521   apr_config_subdirs="$bundled_subdir"
34522   test -d $bundled_subdir || $mkdir_p $bundled_subdir
34523   ac_abs_srcdir=`(cd $srcdir/$bundled_subdir && pwd)`
34524   cd $bundled_subdir
34525
34526       # A "../" for each directory in /$config_subdirs.
34527       ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
34528
34529   # Make the cache file pathname absolute for the subdirs
34530   # required to correctly handle subdirs that might actually
34531   # be symlinks
34532   case "$cache_file" in
34533   /*) # already absolute
34534     ac_sub_cache_file=$cache_file ;;
34535   *)  # Was relative path.
34536     ac_sub_cache_file="$ac_popdir/$cache_file" ;;
34537   esac
34538
34539   apr_configure_args=$ac_configure_args
34540
34541     test "x$silent" = "xyes" && apr_configure_args="$apr_configure_args --silent"
34542
34543     apr_configure_args="--disable-option-checking $apr_configure_args"
34544
34545               if eval $SHELL $ac_abs_srcdir/configure $apr_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir
34546   then :
34547     echo "$bundled_subdir configured properly"
34548   else
34549     echo "configure failed for $bundled_subdir"
34550     exit 1
34551   fi
34552
34553   cd $ac_popdir
34554
34555   # grab any updates from the sub-package
34556   if test -r "$cache_file"; then
34557   # Some versions of bash will fail to source /dev/null (special
34558   # files actually), so we avoid doing that.
34559   if test -f "$cache_file"; then
34560     { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
34561 $as_echo "$as_me: loading cache $cache_file" >&6;}
34562     case $cache_file in
34563       [\\/]* | ?:[\\/]* ) . "$cache_file";;
34564       *)                      . "./$cache_file";;
34565     esac
34566   fi
34567 else
34568   { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
34569 $as_echo "$as_me: creating cache $cache_file" >&6;}
34570   >$cache_file
34571 fi
34572
34573
34574   expat_include_dir=$top_builddir/$bundled_subdir/lib
34575   expat_ldflags="-L$top_builddir/$bundled_subdir/lib"
34576   expat_libs="-lexpat"
34577   expat_libtool=$top_builddir/$bundled_subdir/libexpat.la
34578   APR_XML_SUBDIRS="`echo $bundled_subdir | sed -e 's%xml/%%'`"
34579
34580   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
34581     echo "  setting APRUTIL_EXPORT_LIBS to \"$expat_libtool\""
34582     APRUTIL_EXPORT_LIBS="$expat_libtool"
34583   else
34584     apr_addto_bugger="$expat_libtool"
34585     for i in $apr_addto_bugger; do
34586       apr_addto_duplicate="0"
34587       for j in $APRUTIL_EXPORT_LIBS; do
34588         if test "x$i" = "x$j"; then
34589           apr_addto_duplicate="1"
34590           break
34591         fi
34592       done
34593       if test $apr_addto_duplicate = "0"; then
34594         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
34595         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
34596       fi
34597     done
34598   fi
34599
34600 else
34601 if test "$expat_include_dir" = "$abs_srcdir/xml/expat/include" -o "$expat_include_dir" = "$abs_srcdir/xml/expat/lib"; then
34602       bundled_subdir="xml/expat"
34603
34604   # save our work to this point; this allows the sub-package to use it
34605   cat >confcache <<\_ACEOF
34606 # This file is a shell script that caches the results of configure
34607 # tests run on this system so they can be shared between configure
34608 # scripts and configure runs, see configure's option --config-cache.
34609 # It is not useful on other systems.  If it contains results you don't
34610 # want to keep, you may remove or edit it.
34611 #
34612 # config.status only pays attention to the cache file if you give it
34613 # the --recheck option to rerun configure.
34614 #
34615 # `ac_cv_env_foo' variables (set or unset) will be overridden when
34616 # loading this file, other *unset* `ac_cv_foo' will be assigned the
34617 # following values.
34618
34619 _ACEOF
34620
34621 # The following way of writing the cache mishandles newlines in values,
34622 # but we know of no workaround that is simple, portable, and efficient.
34623 # So, we kill variables containing newlines.
34624 # Ultrix sh set writes to stderr and can't be redirected directly,
34625 # and sets the high bit in the cache file unless we assign to the vars.
34626 (
34627   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
34628     eval ac_val=\$$ac_var
34629     case $ac_val in #(
34630     *${as_nl}*)
34631       case $ac_var in #(
34632       *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
34633 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
34634       esac
34635       case $ac_var in #(
34636       _ | IFS | as_nl) ;; #(
34637       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
34638       *) $as_unset $ac_var ;;
34639       esac ;;
34640     esac
34641   done
34642
34643   (set) 2>&1 |
34644     case $as_nl`(ac_space=' '; set) 2>&1` in #(
34645     *${as_nl}ac_space=\ *)
34646       # `set' does not quote correctly, so add quotes (double-quote
34647       # substitution turns \\\\ into \\, and sed turns \\ into \).
34648       sed -n \
34649         "s/'/'\\\\''/g;
34650           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
34651       ;; #(
34652     *)
34653       # `set' quotes correctly as required by POSIX, so do not add quotes.
34654       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
34655       ;;
34656     esac |
34657     sort
34658 ) |
34659   sed '
34660      /^ac_cv_env_/b end
34661      t clear
34662      :clear
34663      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
34664      t end
34665      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
34666      :end' >>confcache
34667 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
34668   if test -w "$cache_file"; then
34669     test "x$cache_file" != "x/dev/null" &&
34670       { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
34671 $as_echo "$as_me: updating cache $cache_file" >&6;}
34672     cat confcache >$cache_file
34673   else
34674     { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
34675 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
34676   fi
34677 fi
34678 rm -f confcache
34679
34680   echo "configuring package in $bundled_subdir now"
34681   ac_popdir=`pwd`
34682   apr_config_subdirs="$bundled_subdir"
34683   test -d $bundled_subdir || $mkdir_p $bundled_subdir
34684   ac_abs_srcdir=`(cd $srcdir/$bundled_subdir && pwd)`
34685   cd $bundled_subdir
34686
34687       # A "../" for each directory in /$config_subdirs.
34688       ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
34689
34690   # Make the cache file pathname absolute for the subdirs
34691   # required to correctly handle subdirs that might actually
34692   # be symlinks
34693   case "$cache_file" in
34694   /*) # already absolute
34695     ac_sub_cache_file=$cache_file ;;
34696   *)  # Was relative path.
34697     ac_sub_cache_file="$ac_popdir/$cache_file" ;;
34698   esac
34699
34700   apr_configure_args=$ac_configure_args
34701
34702     test "x$silent" = "xyes" && apr_configure_args="$apr_configure_args --silent"
34703
34704     apr_configure_args="--disable-option-checking $apr_configure_args"
34705
34706               if eval $SHELL $ac_abs_srcdir/configure $apr_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir
34707   then :
34708     echo "$bundled_subdir configured properly"
34709   else
34710     echo "configure failed for $bundled_subdir"
34711     exit 1
34712   fi
34713
34714   cd $ac_popdir
34715
34716   # grab any updates from the sub-package
34717   if test -r "$cache_file"; then
34718   # Some versions of bash will fail to source /dev/null (special
34719   # files actually), so we avoid doing that.
34720   if test -f "$cache_file"; then
34721     { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
34722 $as_echo "$as_me: loading cache $cache_file" >&6;}
34723     case $cache_file in
34724       [\\/]* | ?:[\\/]* ) . "$cache_file";;
34725       *)                      . "./$cache_file";;
34726     esac
34727   fi
34728 else
34729   { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
34730 $as_echo "$as_me: creating cache $cache_file" >&6;}
34731   >$cache_file
34732 fi
34733
34734
34735   expat_include_dir=$abs_srcdir/$bundled_subdir/lib
34736   expat_ldflags="-L$top_builddir/$bundled_subdir/lib"
34737   expat_libs="-lexpat"
34738   expat_libtool=$top_builddir/$bundled_subdir/libexpat.la
34739   APR_XML_SUBDIRS="`echo $bundled_subdir | sed -e 's%xml/%%'`"
34740
34741   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
34742     echo "  setting APRUTIL_EXPORT_LIBS to \"$expat_libtool\""
34743     APRUTIL_EXPORT_LIBS="$expat_libtool"
34744   else
34745     apr_addto_bugger="$expat_libtool"
34746     for i in $apr_addto_bugger; do
34747       apr_addto_duplicate="0"
34748       for j in $APRUTIL_EXPORT_LIBS; do
34749         if test "x$i" = "x$j"; then
34750           apr_addto_duplicate="1"
34751           break
34752         fi
34753       done
34754       if test $apr_addto_duplicate = "0"; then
34755         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
34756         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
34757       fi
34758     done
34759   fi
34760
34761 else
34762
34763   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
34764     echo "  setting APRUTIL_EXPORT_LIBS to \"$expat_libs\""
34765     APRUTIL_EXPORT_LIBS="$expat_libs"
34766   else
34767     apr_addto_bugger="$expat_libs"
34768     for i in $apr_addto_bugger; do
34769       apr_addto_duplicate="0"
34770       for j in $APRUTIL_EXPORT_LIBS; do
34771         if test "x$i" = "x$j"; then
34772           apr_addto_duplicate="1"
34773           break
34774         fi
34775       done
34776       if test $apr_addto_duplicate = "0"; then
34777         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
34778         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
34779       fi
34780     done
34781   fi
34782
34783 fi
34784 fi
34785 APR_XML_DIR=$bundled_subdir
34786 APR_XML_EXPAT_OLD=$expat_old
34787
34788
34789
34790
34791 if test "$expat_include_dir" != "/usr/include"; then
34792
34793   if test "x$APRUTIL_INCLUDES" = "x"; then
34794     echo "  setting APRUTIL_INCLUDES to \"-I$expat_include_dir\""
34795     APRUTIL_INCLUDES="-I$expat_include_dir"
34796   else
34797     apr_addto_bugger="-I$expat_include_dir"
34798     for i in $apr_addto_bugger; do
34799       apr_addto_duplicate="0"
34800       for j in $APRUTIL_INCLUDES; do
34801         if test "x$i" = "x$j"; then
34802           apr_addto_duplicate="1"
34803           break
34804         fi
34805       done
34806       if test $apr_addto_duplicate = "0"; then
34807         echo "  adding \"$i\" to APRUTIL_INCLUDES"
34808         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
34809       fi
34810     done
34811   fi
34812
34813 fi
34814
34815   if test "x$APRUTIL_LDFLAGS" = "x"; then
34816     echo "  setting APRUTIL_LDFLAGS to \"$expat_ldflags\""
34817     APRUTIL_LDFLAGS="$expat_ldflags"
34818   else
34819     apr_addto_bugger="$expat_ldflags"
34820     for i in $apr_addto_bugger; do
34821       apr_addto_duplicate="0"
34822       for j in $APRUTIL_LDFLAGS; do
34823         if test "x$i" = "x$j"; then
34824           apr_addto_duplicate="1"
34825           break
34826         fi
34827       done
34828       if test $apr_addto_duplicate = "0"; then
34829         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
34830         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
34831       fi
34832     done
34833   fi
34834
34835
34836   if test "x$APRUTIL_LIBS" = "x"; then
34837     echo "  setting APRUTIL_LIBS to \"$expat_libtool\""
34838     APRUTIL_LIBS="$expat_libtool"
34839   else
34840     apr_addto_bugger="$expat_libtool"
34841     for i in $apr_addto_bugger; do
34842       apr_addto_duplicate="0"
34843       for j in $APRUTIL_LIBS; do
34844         if test "x$i" = "x$j"; then
34845           apr_addto_duplicate="1"
34846           break
34847         fi
34848       done
34849       if test $apr_addto_duplicate = "0"; then
34850         echo "  adding \"$i\" to APRUTIL_LIBS"
34851         APRUTIL_LIBS="$APRUTIL_LIBS $i"
34852       fi
34853     done
34854   fi
34855
34856
34857
34858
34859 apu_iconv_dir="unknown"
34860
34861 # Check whether --with-iconv was given.
34862 if test "${with_iconv+set}" = set; then
34863   withval=$with_iconv;  apu_iconv_dir="$withval"
34864     if test "$apu_iconv_dir" != "yes"; then
34865
34866   if test "x$CPPFLAGS" = "x"; then
34867     echo "  setting CPPFLAGS to \"-I$apu_iconv_dir/include\""
34868     CPPFLAGS="-I$apu_iconv_dir/include"
34869   else
34870     apr_addto_bugger="-I$apu_iconv_dir/include"
34871     for i in $apr_addto_bugger; do
34872       apr_addto_duplicate="0"
34873       for j in $CPPFLAGS; do
34874         if test "x$i" = "x$j"; then
34875           apr_addto_duplicate="1"
34876           break
34877         fi
34878       done
34879       if test $apr_addto_duplicate = "0"; then
34880         echo "  adding \"$i\" to CPPFLAGS"
34881         CPPFLAGS="$CPPFLAGS $i"
34882       fi
34883     done
34884   fi
34885
34886
34887   if test "x$LDFLAGS" = "x"; then
34888     echo "  setting LDFLAGS to \"-L$apu_iconv_dir/lib\""
34889     LDFLAGS="-L$apu_iconv_dir/lib"
34890   else
34891     apr_addto_bugger="-L$apu_iconv_dir/lib"
34892     for i in $apr_addto_bugger; do
34893       apr_addto_duplicate="0"
34894       for j in $LDFLAGS; do
34895         if test "x$i" = "x$j"; then
34896           apr_addto_duplicate="1"
34897           break
34898         fi
34899       done
34900       if test $apr_addto_duplicate = "0"; then
34901         echo "  adding \"$i\" to LDFLAGS"
34902         LDFLAGS="$LDFLAGS $i"
34903       fi
34904     done
34905   fi
34906
34907     fi
34908
34909 fi
34910
34911
34912 if test "${ac_cv_header_iconv_h+set}" = set; then
34913   { $as_echo "$as_me:$LINENO: checking for iconv.h" >&5
34914 $as_echo_n "checking for iconv.h... " >&6; }
34915 if test "${ac_cv_header_iconv_h+set}" = set; then
34916   $as_echo_n "(cached) " >&6
34917 fi
34918 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
34919 $as_echo "$ac_cv_header_iconv_h" >&6; }
34920 else
34921   # Is the header compilable?
34922 { $as_echo "$as_me:$LINENO: checking iconv.h usability" >&5
34923 $as_echo_n "checking iconv.h usability... " >&6; }
34924 cat >conftest.$ac_ext <<_ACEOF
34925 /* confdefs.h.  */
34926 _ACEOF
34927 cat confdefs.h >>conftest.$ac_ext
34928 cat >>conftest.$ac_ext <<_ACEOF
34929 /* end confdefs.h.  */
34930 $ac_includes_default
34931 #include <iconv.h>
34932 _ACEOF
34933 rm -f conftest.$ac_objext
34934 if { (ac_try="$ac_compile"
34935 case "(($ac_try" in
34936   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
34937   *) ac_try_echo=$ac_try;;
34938 esac
34939 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
34940 $as_echo "$ac_try_echo") >&5
34941   (eval "$ac_compile") 2>conftest.er1
34942   ac_status=$?
34943   grep -v '^ *+' conftest.er1 >conftest.err
34944   rm -f conftest.er1
34945   cat conftest.err >&5
34946   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
34947   (exit $ac_status); } && {
34948          test -z "$ac_c_werror_flag" ||
34949          test ! -s conftest.err
34950        } && test -s conftest.$ac_objext; then
34951   ac_header_compiler=yes
34952 else
34953   $as_echo "$as_me: failed program was:" >&5
34954 sed 's/^/| /' conftest.$ac_ext >&5
34955
34956         ac_header_compiler=no
34957 fi
34958
34959 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34960 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
34961 $as_echo "$ac_header_compiler" >&6; }
34962
34963 # Is the header present?
34964 { $as_echo "$as_me:$LINENO: checking iconv.h presence" >&5
34965 $as_echo_n "checking iconv.h presence... " >&6; }
34966 cat >conftest.$ac_ext <<_ACEOF
34967 /* confdefs.h.  */
34968 _ACEOF
34969 cat confdefs.h >>conftest.$ac_ext
34970 cat >>conftest.$ac_ext <<_ACEOF
34971 /* end confdefs.h.  */
34972 #include <iconv.h>
34973 _ACEOF
34974 if { (ac_try="$ac_cpp conftest.$ac_ext"
34975 case "(($ac_try" in
34976   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
34977   *) ac_try_echo=$ac_try;;
34978 esac
34979 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
34980 $as_echo "$ac_try_echo") >&5
34981   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
34982   ac_status=$?
34983   grep -v '^ *+' conftest.er1 >conftest.err
34984   rm -f conftest.er1
34985   cat conftest.err >&5
34986   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
34987   (exit $ac_status); } >/dev/null && {
34988          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
34989          test ! -s conftest.err
34990        }; then
34991   ac_header_preproc=yes
34992 else
34993   $as_echo "$as_me: failed program was:" >&5
34994 sed 's/^/| /' conftest.$ac_ext >&5
34995
34996   ac_header_preproc=no
34997 fi
34998
34999 rm -f conftest.err conftest.$ac_ext
35000 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
35001 $as_echo "$ac_header_preproc" >&6; }
35002
35003 # So?  What about this header?
35004 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
35005   yes:no: )
35006     { $as_echo "$as_me:$LINENO: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5
35007 $as_echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
35008     { $as_echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the compiler's result" >&5
35009 $as_echo "$as_me: WARNING: iconv.h: proceeding with the compiler's result" >&2;}
35010     ac_header_preproc=yes
35011     ;;
35012   no:yes:* )
35013     { $as_echo "$as_me:$LINENO: WARNING: iconv.h: present but cannot be compiled" >&5
35014 $as_echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;}
35015     { $as_echo "$as_me:$LINENO: WARNING: iconv.h:     check for missing prerequisite headers?" >&5
35016 $as_echo "$as_me: WARNING: iconv.h:     check for missing prerequisite headers?" >&2;}
35017     { $as_echo "$as_me:$LINENO: WARNING: iconv.h: see the Autoconf documentation" >&5
35018 $as_echo "$as_me: WARNING: iconv.h: see the Autoconf documentation" >&2;}
35019     { $as_echo "$as_me:$LINENO: WARNING: iconv.h:     section \"Present But Cannot Be Compiled\"" >&5
35020 $as_echo "$as_me: WARNING: iconv.h:     section \"Present But Cannot Be Compiled\"" >&2;}
35021     { $as_echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5
35022 $as_echo "$as_me: WARNING: iconv.h: proceeding with the preprocessor's result" >&2;}
35023     { $as_echo "$as_me:$LINENO: WARNING: iconv.h: in the future, the compiler will take precedence" >&5
35024 $as_echo "$as_me: WARNING: iconv.h: in the future, the compiler will take precedence" >&2;}
35025
35026     ;;
35027 esac
35028 { $as_echo "$as_me:$LINENO: checking for iconv.h" >&5
35029 $as_echo_n "checking for iconv.h... " >&6; }
35030 if test "${ac_cv_header_iconv_h+set}" = set; then
35031   $as_echo_n "(cached) " >&6
35032 else
35033   ac_cv_header_iconv_h=$ac_header_preproc
35034 fi
35035 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5
35036 $as_echo "$ac_cv_header_iconv_h" >&6; }
35037
35038 fi
35039 if test "x$ac_cv_header_iconv_h" = x""yes; then
35040
35041
35042   cat >conftest.$ac_ext <<_ACEOF
35043 /* confdefs.h.  */
35044 _ACEOF
35045 cat confdefs.h >>conftest.$ac_ext
35046 cat >>conftest.$ac_ext <<_ACEOF
35047 /* end confdefs.h.  */
35048
35049 #include <stdlib.h>
35050 #include <iconv.h>
35051
35052 int
35053 main ()
35054 {
35055
35056   iconv_t cd = iconv_open("", "");
35057   iconv(cd, NULL, NULL, NULL, NULL);
35058
35059   ;
35060   return 0;
35061 }
35062 _ACEOF
35063 rm -f conftest.$ac_objext conftest$ac_exeext
35064 if { (ac_try="$ac_link"
35065 case "(($ac_try" in
35066   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35067   *) ac_try_echo=$ac_try;;
35068 esac
35069 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35070 $as_echo "$ac_try_echo") >&5
35071   (eval "$ac_link") 2>conftest.er1
35072   ac_status=$?
35073   grep -v '^ *+' conftest.er1 >conftest.err
35074   rm -f conftest.er1
35075   cat conftest.err >&5
35076   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
35077   (exit $ac_status); } && {
35078          test -z "$ac_c_werror_flag" ||
35079          test ! -s conftest.err
35080        } && test -s conftest$ac_exeext && {
35081          test "$cross_compiling" = yes ||
35082          $as_test_x conftest$ac_exeext
35083        }; then
35084    have_iconv="1"
35085 else
35086   $as_echo "$as_me: failed program was:" >&5
35087 sed 's/^/| /' conftest.$ac_ext >&5
35088
35089
35090
35091
35092   if test "x$LIBS" = "x"; then
35093     echo "  setting LIBS to \"-liconv\""
35094     LIBS="-liconv"
35095   else
35096     apr_addto_bugger="-liconv"
35097     for i in $apr_addto_bugger; do
35098       apr_addto_duplicate="0"
35099       for j in $LIBS; do
35100         if test "x$i" = "x$j"; then
35101           apr_addto_duplicate="1"
35102           break
35103         fi
35104       done
35105       if test $apr_addto_duplicate = "0"; then
35106         echo "  adding \"$i\" to LIBS"
35107         LIBS="$LIBS $i"
35108       fi
35109     done
35110   fi
35111
35112
35113
35114   cat >conftest.$ac_ext <<_ACEOF
35115 /* confdefs.h.  */
35116 _ACEOF
35117 cat confdefs.h >>conftest.$ac_ext
35118 cat >>conftest.$ac_ext <<_ACEOF
35119 /* end confdefs.h.  */
35120
35121 #include <stdlib.h>
35122 #include <iconv.h>
35123
35124 int
35125 main ()
35126 {
35127
35128   iconv_t cd = iconv_open("", "");
35129   iconv(cd, NULL, NULL, NULL, NULL);
35130
35131   ;
35132   return 0;
35133 }
35134 _ACEOF
35135 rm -f conftest.$ac_objext conftest$ac_exeext
35136 if { (ac_try="$ac_link"
35137 case "(($ac_try" in
35138   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35139   *) ac_try_echo=$ac_try;;
35140 esac
35141 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35142 $as_echo "$ac_try_echo") >&5
35143   (eval "$ac_link") 2>conftest.er1
35144   ac_status=$?
35145   grep -v '^ *+' conftest.er1 >conftest.err
35146   rm -f conftest.er1
35147   cat conftest.err >&5
35148   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
35149   (exit $ac_status); } && {
35150          test -z "$ac_c_werror_flag" ||
35151          test ! -s conftest.err
35152        } && test -s conftest$ac_exeext && {
35153          test "$cross_compiling" = yes ||
35154          $as_test_x conftest$ac_exeext
35155        }; then
35156
35157
35158   if test "x$APRUTIL_LIBS" = "x"; then
35159     echo "  setting APRUTIL_LIBS to \"-liconv\""
35160     APRUTIL_LIBS="-liconv"
35161   else
35162     apr_addto_bugger="-liconv"
35163     for i in $apr_addto_bugger; do
35164       apr_addto_duplicate="0"
35165       for j in $APRUTIL_LIBS; do
35166         if test "x$i" = "x$j"; then
35167           apr_addto_duplicate="1"
35168           break
35169         fi
35170       done
35171       if test $apr_addto_duplicate = "0"; then
35172         echo "  adding \"$i\" to APRUTIL_LIBS"
35173         APRUTIL_LIBS="$APRUTIL_LIBS $i"
35174       fi
35175     done
35176   fi
35177
35178
35179   if test "x$APRUTIL_EXPORT_LIBS" = "x"; then
35180     echo "  setting APRUTIL_EXPORT_LIBS to \"-liconv\""
35181     APRUTIL_EXPORT_LIBS="-liconv"
35182   else
35183     apr_addto_bugger="-liconv"
35184     for i in $apr_addto_bugger; do
35185       apr_addto_duplicate="0"
35186       for j in $APRUTIL_EXPORT_LIBS; do
35187         if test "x$i" = "x$j"; then
35188           apr_addto_duplicate="1"
35189           break
35190         fi
35191       done
35192       if test $apr_addto_duplicate = "0"; then
35193         echo "  adding \"$i\" to APRUTIL_EXPORT_LIBS"
35194         APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $i"
35195       fi
35196     done
35197   fi
35198
35199      have_iconv="1"
35200 else
35201   $as_echo "$as_me: failed program was:" >&5
35202 sed 's/^/| /' conftest.$ac_ext >&5
35203
35204          have_iconv="0"
35205 fi
35206
35207 rm -rf conftest.dSYM
35208 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
35209       conftest$ac_exeext conftest.$ac_ext
35210
35211
35212
35213   if test "x$LIBS" = "x-liconv"; then
35214     echo "  nulling LIBS"
35215     LIBS=""
35216   else
35217     apr_new_bugger=""
35218     apr_removed=0
35219     for i in $LIBS; do
35220       if test "x$i" != "x-liconv"; then
35221         apr_new_bugger="$apr_new_bugger $i"
35222       else
35223         apr_removed=1
35224       fi
35225     done
35226     if test $apr_removed = "1"; then
35227       echo "  removed \"-liconv\" from LIBS"
35228       LIBS=$apr_new_bugger
35229     fi
35230   fi
35231
35232
35233
35234 fi
35235
35236 rm -rf conftest.dSYM
35237 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
35238       conftest$ac_exeext conftest.$ac_ext
35239
35240
35241 else
35242    have_iconv="0"
35243 fi
35244
35245
35246
35247 if test "$apu_iconv_dir" != "unknown"; then
35248   if test "$have_iconv" != "1"; then
35249     { { $as_echo "$as_me:$LINENO: error: iconv support requested, but not found" >&5
35250 $as_echo "$as_me: error: iconv support requested, but not found" >&2;}
35251    { (exit 1); exit 1; }; }
35252   fi
35253
35254   if test "x$CPPFLAGS" = "x-I$apu_iconv_dir/include"; then
35255     echo "  nulling CPPFLAGS"
35256     CPPFLAGS=""
35257   else
35258     apr_new_bugger=""
35259     apr_removed=0
35260     for i in $CPPFLAGS; do
35261       if test "x$i" != "x-I$apu_iconv_dir/include"; then
35262         apr_new_bugger="$apr_new_bugger $i"
35263       else
35264         apr_removed=1
35265       fi
35266     done
35267     if test $apr_removed = "1"; then
35268       echo "  removed \"-I$apu_iconv_dir/include\" from CPPFLAGS"
35269       CPPFLAGS=$apr_new_bugger
35270     fi
35271   fi
35272
35273
35274   if test "x$LDFLAGS" = "x-L$apu_iconv_dir/lib"; then
35275     echo "  nulling LDFLAGS"
35276     LDFLAGS=""
35277   else
35278     apr_new_bugger=""
35279     apr_removed=0
35280     for i in $LDFLAGS; do
35281       if test "x$i" != "x-L$apu_iconv_dir/lib"; then
35282         apr_new_bugger="$apr_new_bugger $i"
35283       else
35284         apr_removed=1
35285       fi
35286     done
35287     if test $apr_removed = "1"; then
35288       echo "  removed \"-L$apu_iconv_dir/lib\" from LDFLAGS"
35289       LDFLAGS=$apr_new_bugger
35290     fi
35291   fi
35292
35293
35294   if test "x$APRUTIL_INCLUDES" = "x"; then
35295     echo "  setting APRUTIL_INCLUDES to \"-I$apu_iconv_dir/include\""
35296     APRUTIL_INCLUDES="-I$apu_iconv_dir/include"
35297   else
35298     apr_addto_bugger="-I$apu_iconv_dir/include"
35299     for i in $apr_addto_bugger; do
35300       apr_addto_duplicate="0"
35301       for j in $APRUTIL_INCLUDES; do
35302         if test "x$i" = "x$j"; then
35303           apr_addto_duplicate="1"
35304           break
35305         fi
35306       done
35307       if test $apr_addto_duplicate = "0"; then
35308         echo "  adding \"$i\" to APRUTIL_INCLUDES"
35309         APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i"
35310       fi
35311     done
35312   fi
35313
35314
35315   if test "x$APRUTIL_LDFLAGS" = "x"; then
35316     echo "  setting APRUTIL_LDFLAGS to \"-L$apu_iconv_dir/lib\""
35317     APRUTIL_LDFLAGS="-L$apu_iconv_dir/lib"
35318   else
35319     apr_addto_bugger="-L$apu_iconv_dir/lib"
35320     for i in $apr_addto_bugger; do
35321       apr_addto_duplicate="0"
35322       for j in $APRUTIL_LDFLAGS; do
35323         if test "x$i" = "x$j"; then
35324           apr_addto_duplicate="1"
35325           break
35326         fi
35327       done
35328       if test $apr_addto_duplicate = "0"; then
35329         echo "  adding \"$i\" to APRUTIL_LDFLAGS"
35330         APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i"
35331       fi
35332     done
35333   fi
35334
35335 fi
35336
35337 if test "$have_iconv" = "1"; then
35338
35339 { $as_echo "$as_me:$LINENO: checking for type of inbuf parameter to iconv" >&5
35340 $as_echo_n "checking for type of inbuf parameter to iconv... " >&6; }
35341 if test "x$apu_iconv_inbuf_const" = "x"; then
35342     if test "x$CFLAGS_WARN" = "x"; then
35343   apr_tcnw_flags=""
35344 else
35345   apr_tcnw_flags=$CFLAGS_WARN
35346 fi
35347 if test "$ac_cv_c_compiler_gnu" = "yes"; then
35348   apr_tcnw_flags="$apr_tcnw_flags -Werror"
35349 fi
35350
35351 cat > conftest.$ac_ext <<EOTEST
35352 #include "confdefs.h"
35353
35354     #include <stddef.h>
35355     #include <iconv.h>
35356
35357 int main(int argc, const char * const *argv) {
35358
35359     iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0);
35360
35361 ; return 0; }
35362 EOTEST
35363
35364 if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 2>&5 ; then
35365   rm -rf conftest*
35366   apu_iconv_inbuf_const="0"
35367 else
35368   echo "configure: failed or warning program:" >&5
35369   cat conftest.$ac_ext >&5
35370   rm -rf conftest*
35371   apu_iconv_inbuf_const="1"
35372 fi
35373 rm -f conftest*
35374
35375 fi
35376 if test "$apu_iconv_inbuf_const" = "1"; then
35377
35378 cat >>confdefs.h <<\_ACEOF
35379 #define APU_ICONV_INBUF_CONST 1
35380 _ACEOF
35381
35382     msg="const char **"
35383 else
35384     msg="char **"
35385 fi
35386 { $as_echo "$as_me:$LINENO: result: $msg" >&5
35387 $as_echo "$msg" >&6; }
35388
35389 fi
35390
35391
35392
35393
35394 for ac_header in iconv.h langinfo.h
35395 do
35396 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
35397 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
35398   { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
35399 $as_echo_n "checking for $ac_header... " >&6; }
35400 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
35401   $as_echo_n "(cached) " >&6
35402 fi
35403 ac_res=`eval 'as_val=${'$as_ac_Header'}
35404                  $as_echo "$as_val"'`
35405                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
35406 $as_echo "$ac_res" >&6; }
35407 else
35408   # Is the header compilable?
35409 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
35410 $as_echo_n "checking $ac_header usability... " >&6; }
35411 cat >conftest.$ac_ext <<_ACEOF
35412 /* confdefs.h.  */
35413 _ACEOF
35414 cat confdefs.h >>conftest.$ac_ext
35415 cat >>conftest.$ac_ext <<_ACEOF
35416 /* end confdefs.h.  */
35417 $ac_includes_default
35418 #include <$ac_header>
35419 _ACEOF
35420 rm -f conftest.$ac_objext
35421 if { (ac_try="$ac_compile"
35422 case "(($ac_try" in
35423   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35424   *) ac_try_echo=$ac_try;;
35425 esac
35426 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35427 $as_echo "$ac_try_echo") >&5
35428   (eval "$ac_compile") 2>conftest.er1
35429   ac_status=$?
35430   grep -v '^ *+' conftest.er1 >conftest.err
35431   rm -f conftest.er1
35432   cat conftest.err >&5
35433   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
35434   (exit $ac_status); } && {
35435          test -z "$ac_c_werror_flag" ||
35436          test ! -s conftest.err
35437        } && test -s conftest.$ac_objext; then
35438   ac_header_compiler=yes
35439 else
35440   $as_echo "$as_me: failed program was:" >&5
35441 sed 's/^/| /' conftest.$ac_ext >&5
35442
35443         ac_header_compiler=no
35444 fi
35445
35446 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35447 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
35448 $as_echo "$ac_header_compiler" >&6; }
35449
35450 # Is the header present?
35451 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
35452 $as_echo_n "checking $ac_header presence... " >&6; }
35453 cat >conftest.$ac_ext <<_ACEOF
35454 /* confdefs.h.  */
35455 _ACEOF
35456 cat confdefs.h >>conftest.$ac_ext
35457 cat >>conftest.$ac_ext <<_ACEOF
35458 /* end confdefs.h.  */
35459 #include <$ac_header>
35460 _ACEOF
35461 if { (ac_try="$ac_cpp conftest.$ac_ext"
35462 case "(($ac_try" in
35463   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35464   *) ac_try_echo=$ac_try;;
35465 esac
35466 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35467 $as_echo "$ac_try_echo") >&5
35468   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
35469   ac_status=$?
35470   grep -v '^ *+' conftest.er1 >conftest.err
35471   rm -f conftest.er1
35472   cat conftest.err >&5
35473   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
35474   (exit $ac_status); } >/dev/null && {
35475          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
35476          test ! -s conftest.err
35477        }; then
35478   ac_header_preproc=yes
35479 else
35480   $as_echo "$as_me: failed program was:" >&5
35481 sed 's/^/| /' conftest.$ac_ext >&5
35482
35483   ac_header_preproc=no
35484 fi
35485
35486 rm -f conftest.err conftest.$ac_ext
35487 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
35488 $as_echo "$ac_header_preproc" >&6; }
35489
35490 # So?  What about this header?
35491 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
35492   yes:no: )
35493     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
35494 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
35495     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
35496 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
35497     ac_header_preproc=yes
35498     ;;
35499   no:yes:* )
35500     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
35501 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
35502     { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
35503 $as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
35504     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
35505 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
35506     { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
35507 $as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
35508     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
35509 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
35510     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
35511 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
35512
35513     ;;
35514 esac
35515 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
35516 $as_echo_n "checking for $ac_header... " >&6; }
35517 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
35518   $as_echo_n "(cached) " >&6
35519 else
35520   eval "$as_ac_Header=\$ac_header_preproc"
35521 fi
35522 ac_res=`eval 'as_val=${'$as_ac_Header'}
35523                  $as_echo "$as_val"'`
35524                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
35525 $as_echo "$ac_res" >&6; }
35526
35527 fi
35528 as_val=`eval 'as_val=${'$as_ac_Header'}
35529                  $as_echo "$as_val"'`
35530    if test "x$as_val" = x""yes; then
35531   cat >>confdefs.h <<_ACEOF
35532 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
35533 _ACEOF
35534
35535 fi
35536
35537 done
35538
35539 for aprt_i in iconv.h langinfo.h
35540 do
35541     ac_safe=`echo "$aprt_i" | sed 'y%./+-%__p_%'`
35542     aprt_2=`echo "$aprt_i" | sed -e 's%/%_%g' -e 's/\.//g' -e 's/-//g'`
35543     if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
35544        eval "$aprt_2=1"
35545     else
35546        eval "$aprt_2=0"
35547     fi
35548 done
35549
35550
35551
35552 for ac_func in nl_langinfo
35553 do
35554 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
35555 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
35556 $as_echo_n "checking for $ac_func... " >&6; }
35557 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
35558   $as_echo_n "(cached) " >&6
35559 else
35560   cat >conftest.$ac_ext <<_ACEOF
35561 /* confdefs.h.  */
35562 _ACEOF
35563 cat confdefs.h >>conftest.$ac_ext
35564 cat >>conftest.$ac_ext <<_ACEOF
35565 /* end confdefs.h.  */
35566 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
35567    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
35568 #define $ac_func innocuous_$ac_func
35569
35570 /* System header to define __stub macros and hopefully few prototypes,
35571     which can conflict with char $ac_func (); below.
35572     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
35573     <limits.h> exists even on freestanding compilers.  */
35574
35575 #ifdef __STDC__
35576 # include <limits.h>
35577 #else
35578 # include <assert.h>
35579 #endif
35580
35581 #undef $ac_func
35582
35583 /* Override any GCC internal prototype to avoid an error.
35584    Use char because int might match the return type of a GCC
35585    builtin and then its argument prototype would still apply.  */
35586 #ifdef __cplusplus
35587 extern "C"
35588 #endif
35589 char $ac_func ();
35590 /* The GNU C library defines this for functions which it implements
35591     to always fail with ENOSYS.  Some functions are actually named
35592     something starting with __ and the normal name is an alias.  */
35593 #if defined __stub_$ac_func || defined __stub___$ac_func
35594 choke me
35595 #endif
35596
35597 int
35598 main ()
35599 {
35600 return $ac_func ();
35601   ;
35602   return 0;
35603 }
35604 _ACEOF
35605 rm -f conftest.$ac_objext conftest$ac_exeext
35606 if { (ac_try="$ac_link"
35607 case "(($ac_try" in
35608   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35609   *) ac_try_echo=$ac_try;;
35610 esac
35611 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35612 $as_echo "$ac_try_echo") >&5
35613   (eval "$ac_link") 2>conftest.er1
35614   ac_status=$?
35615   grep -v '^ *+' conftest.er1 >conftest.err
35616   rm -f conftest.er1
35617   cat conftest.err >&5
35618   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
35619   (exit $ac_status); } && {
35620          test -z "$ac_c_werror_flag" ||
35621          test ! -s conftest.err
35622        } && test -s conftest$ac_exeext && {
35623          test "$cross_compiling" = yes ||
35624          $as_test_x conftest$ac_exeext
35625        }; then
35626   eval "$as_ac_var=yes"
35627 else
35628   $as_echo "$as_me: failed program was:" >&5
35629 sed 's/^/| /' conftest.$ac_ext >&5
35630
35631         eval "$as_ac_var=no"
35632 fi
35633
35634 rm -rf conftest.dSYM
35635 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
35636       conftest$ac_exeext conftest.$ac_ext
35637 fi
35638 ac_res=`eval 'as_val=${'$as_ac_var'}
35639                  $as_echo "$as_val"'`
35640                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
35641 $as_echo "$ac_res" >&6; }
35642 as_val=`eval 'as_val=${'$as_ac_var'}
35643                  $as_echo "$as_val"'`
35644    if test "x$as_val" = x""yes; then
35645   cat >>confdefs.h <<_ACEOF
35646 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
35647 _ACEOF
35648
35649 fi
35650 done
35651
35652 for aprt_j in nl_langinfo
35653 do
35654     aprt_3="have_$aprt_j"
35655     if eval "test \"`echo '$ac_cv_func_'$aprt_j`\" = yes"; then
35656        eval "$aprt_3=1"
35657     else
35658        eval "$aprt_3=0"
35659     fi
35660 done
35661
35662
35663   { $as_echo "$as_me:$LINENO: checking for CODESET in langinfo.h" >&5
35664 $as_echo_n "checking for CODESET in langinfo.h... " >&6; }
35665 if test "${ac_cv_define_CODESET+set}" = set; then
35666   $as_echo_n "(cached) " >&6
35667 else
35668
35669     cat >conftest.$ac_ext <<_ACEOF
35670 /* confdefs.h.  */
35671 _ACEOF
35672 cat confdefs.h >>conftest.$ac_ext
35673 cat >>conftest.$ac_ext <<_ACEOF
35674 /* end confdefs.h.  */
35675
35676 #include <langinfo.h>
35677 #ifdef CODESET
35678 YES_IS_DEFINED
35679 #endif
35680
35681 _ACEOF
35682 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
35683   $EGREP "YES_IS_DEFINED" >/dev/null 2>&1; then
35684   ac_cv_define_CODESET=yes
35685 else
35686   ac_cv_define_CODESET=no
35687 fi
35688 rm -f conftest*
35689
35690
35691 fi
35692 { $as_echo "$as_me:$LINENO: result: $ac_cv_define_CODESET" >&5
35693 $as_echo "$ac_cv_define_CODESET" >&6; }
35694   if test "$ac_cv_define_CODESET" = "yes"; then
35695
35696 cat >>confdefs.h <<\_ACEOF
35697 #define HAVE_CODESET 1
35698 _ACEOF
35699
35700   fi
35701
35702
35703
35704
35705
35706 { $as_echo "$as_me:$LINENO: checking for library containing crypt" >&5
35707 $as_echo_n "checking for library containing crypt... " >&6; }
35708 if test "${ac_cv_search_crypt+set}" = set; then
35709   $as_echo_n "(cached) " >&6
35710 else
35711   ac_func_search_save_LIBS=$LIBS
35712 cat >conftest.$ac_ext <<_ACEOF
35713 /* confdefs.h.  */
35714 _ACEOF
35715 cat confdefs.h >>conftest.$ac_ext
35716 cat >>conftest.$ac_ext <<_ACEOF
35717 /* end confdefs.h.  */
35718
35719 /* Override any GCC internal prototype to avoid an error.
35720    Use char because int might match the return type of a GCC
35721    builtin and then its argument prototype would still apply.  */
35722 #ifdef __cplusplus
35723 extern "C"
35724 #endif
35725 char crypt ();
35726 int
35727 main ()
35728 {
35729 return crypt ();
35730   ;
35731   return 0;
35732 }
35733 _ACEOF
35734 for ac_lib in '' crypt ufc; do
35735   if test -z "$ac_lib"; then
35736     ac_res="none required"
35737   else
35738     ac_res=-l$ac_lib
35739     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
35740   fi
35741   rm -f conftest.$ac_objext conftest$ac_exeext
35742 if { (ac_try="$ac_link"
35743 case "(($ac_try" in
35744   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35745   *) ac_try_echo=$ac_try;;
35746 esac
35747 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35748 $as_echo "$ac_try_echo") >&5
35749   (eval "$ac_link") 2>conftest.er1
35750   ac_status=$?
35751   grep -v '^ *+' conftest.er1 >conftest.err
35752   rm -f conftest.er1
35753   cat conftest.err >&5
35754   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
35755   (exit $ac_status); } && {
35756          test -z "$ac_c_werror_flag" ||
35757          test ! -s conftest.err
35758        } && test -s conftest$ac_exeext && {
35759          test "$cross_compiling" = yes ||
35760          $as_test_x conftest$ac_exeext
35761        }; then
35762   ac_cv_search_crypt=$ac_res
35763 else
35764   $as_echo "$as_me: failed program was:" >&5
35765 sed 's/^/| /' conftest.$ac_ext >&5
35766
35767
35768 fi
35769
35770 rm -rf conftest.dSYM
35771 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
35772       conftest$ac_exeext
35773   if test "${ac_cv_search_crypt+set}" = set; then
35774   break
35775 fi
35776 done
35777 if test "${ac_cv_search_crypt+set}" = set; then
35778   :
35779 else
35780   ac_cv_search_crypt=no
35781 fi
35782 rm conftest.$ac_ext
35783 LIBS=$ac_func_search_save_LIBS
35784 fi
35785 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_crypt" >&5
35786 $as_echo "$ac_cv_search_crypt" >&6; }
35787 ac_res=$ac_cv_search_crypt
35788 if test "$ac_res" != no; then
35789   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
35790
35791 fi
35792
35793 { $as_echo "$as_me:$LINENO: checking if system crypt() function is threadsafe" >&5
35794 $as_echo_n "checking if system crypt() function is threadsafe... " >&6; }
35795 if test "x$apu_crypt_threadsafe" = "x1"; then
35796
35797 cat >>confdefs.h <<\_ACEOF
35798 #define APU_CRYPT_THREADSAFE 1
35799 _ACEOF
35800
35801   msg="yes"
35802 else
35803   msg="no"
35804 fi
35805 { $as_echo "$as_me:$LINENO: result: $msg" >&5
35806 $as_echo "$msg" >&6; }
35807
35808
35809 for ac_func in crypt_r
35810 do
35811 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
35812 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
35813 $as_echo_n "checking for $ac_func... " >&6; }
35814 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
35815   $as_echo_n "(cached) " >&6
35816 else
35817   cat >conftest.$ac_ext <<_ACEOF
35818 /* confdefs.h.  */
35819 _ACEOF
35820 cat confdefs.h >>conftest.$ac_ext
35821 cat >>conftest.$ac_ext <<_ACEOF
35822 /* end confdefs.h.  */
35823 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
35824    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
35825 #define $ac_func innocuous_$ac_func
35826
35827 /* System header to define __stub macros and hopefully few prototypes,
35828     which can conflict with char $ac_func (); below.
35829     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
35830     <limits.h> exists even on freestanding compilers.  */
35831
35832 #ifdef __STDC__
35833 # include <limits.h>
35834 #else
35835 # include <assert.h>
35836 #endif
35837
35838 #undef $ac_func
35839
35840 /* Override any GCC internal prototype to avoid an error.
35841    Use char because int might match the return type of a GCC
35842    builtin and then its argument prototype would still apply.  */
35843 #ifdef __cplusplus
35844 extern "C"
35845 #endif
35846 char $ac_func ();
35847 /* The GNU C library defines this for functions which it implements
35848     to always fail with ENOSYS.  Some functions are actually named
35849     something starting with __ and the normal name is an alias.  */
35850 #if defined __stub_$ac_func || defined __stub___$ac_func
35851 choke me
35852 #endif
35853
35854 int
35855 main ()
35856 {
35857 return $ac_func ();
35858   ;
35859   return 0;
35860 }
35861 _ACEOF
35862 rm -f conftest.$ac_objext conftest$ac_exeext
35863 if { (ac_try="$ac_link"
35864 case "(($ac_try" in
35865   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35866   *) ac_try_echo=$ac_try;;
35867 esac
35868 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35869 $as_echo "$ac_try_echo") >&5
35870   (eval "$ac_link") 2>conftest.er1
35871   ac_status=$?
35872   grep -v '^ *+' conftest.er1 >conftest.err
35873   rm -f conftest.er1
35874   cat conftest.err >&5
35875   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
35876   (exit $ac_status); } && {
35877          test -z "$ac_c_werror_flag" ||
35878          test ! -s conftest.err
35879        } && test -s conftest$ac_exeext && {
35880          test "$cross_compiling" = yes ||
35881          $as_test_x conftest$ac_exeext
35882        }; then
35883   eval "$as_ac_var=yes"
35884 else
35885   $as_echo "$as_me: failed program was:" >&5
35886 sed 's/^/| /' conftest.$ac_ext >&5
35887
35888         eval "$as_ac_var=no"
35889 fi
35890
35891 rm -rf conftest.dSYM
35892 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
35893       conftest$ac_exeext conftest.$ac_ext
35894 fi
35895 ac_res=`eval 'as_val=${'$as_ac_var'}
35896                  $as_echo "$as_val"'`
35897                { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
35898 $as_echo "$ac_res" >&6; }
35899 as_val=`eval 'as_val=${'$as_ac_var'}
35900                  $as_echo "$as_val"'`
35901    if test "x$as_val" = x""yes; then
35902   cat >>confdefs.h <<_ACEOF
35903 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
35904 _ACEOF
35905   crypt_r="1"
35906 else
35907    crypt_r="0"
35908 fi
35909 done
35910
35911 if test "$crypt_r" = "1"; then
35912
35913 { $as_echo "$as_me:$LINENO: checking style of crypt_r" >&5
35914 $as_echo_n "checking style of crypt_r... " >&6; }
35915 if test "${ac_cv_crypt_r_style+set}" = set; then
35916   $as_echo_n "(cached) " >&6
35917 else
35918
35919 ac_cv_crypt_r_style=none
35920 cat >conftest.$ac_ext <<_ACEOF
35921 /* confdefs.h.  */
35922 _ACEOF
35923 cat confdefs.h >>conftest.$ac_ext
35924 cat >>conftest.$ac_ext <<_ACEOF
35925 /* end confdefs.h.  */
35926
35927 #include <crypt.h>
35928
35929 int
35930 main ()
35931 {
35932
35933 CRYPTD buffer;
35934 crypt_r("passwd", "hash", &buffer);
35935
35936   ;
35937   return 0;
35938 }
35939 _ACEOF
35940 rm -f conftest.$ac_objext
35941 if { (ac_try="$ac_compile"
35942 case "(($ac_try" in
35943   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35944   *) ac_try_echo=$ac_try;;
35945 esac
35946 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35947 $as_echo "$ac_try_echo") >&5
35948   (eval "$ac_compile") 2>conftest.er1
35949   ac_status=$?
35950   grep -v '^ *+' conftest.er1 >conftest.err
35951   rm -f conftest.er1
35952   cat conftest.err >&5
35953   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
35954   (exit $ac_status); } && {
35955          test -z "$ac_c_werror_flag" ||
35956          test ! -s conftest.err
35957        } && test -s conftest.$ac_objext; then
35958   ac_cv_crypt_r_style=cryptd
35959 else
35960   $as_echo "$as_me: failed program was:" >&5
35961 sed 's/^/| /' conftest.$ac_ext >&5
35962
35963
35964 fi
35965
35966 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35967 if test "$ac_cv_crypt_r_style" = "none"; then
35968 cat >conftest.$ac_ext <<_ACEOF
35969 /* confdefs.h.  */
35970 _ACEOF
35971 cat confdefs.h >>conftest.$ac_ext
35972 cat >>conftest.$ac_ext <<_ACEOF
35973 /* end confdefs.h.  */
35974
35975 #include <crypt.h>
35976
35977 int
35978 main ()
35979 {
35980
35981 struct crypt_data buffer;
35982 crypt_r("passwd", "hash", &buffer);
35983
35984   ;
35985   return 0;
35986 }
35987 _ACEOF
35988 rm -f conftest.$ac_objext
35989 if { (ac_try="$ac_compile"
35990 case "(($ac_try" in
35991   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
35992   *) ac_try_echo=$ac_try;;
35993 esac
35994 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
35995 $as_echo "$ac_try_echo") >&5
35996   (eval "$ac_compile") 2>conftest.er1
35997   ac_status=$?
35998   grep -v '^ *+' conftest.er1 >conftest.err
35999   rm -f conftest.er1
36000   cat conftest.err >&5
36001   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
36002   (exit $ac_status); } && {
36003          test -z "$ac_c_werror_flag" ||
36004          test ! -s conftest.err
36005        } && test -s conftest.$ac_objext; then
36006   ac_cv_crypt_r_style=struct_crypt_data
36007 else
36008   $as_echo "$as_me: failed program was:" >&5
36009 sed 's/^/| /' conftest.$ac_ext >&5
36010
36011
36012 fi
36013
36014 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36015 fi
36016
36017 fi
36018 { $as_echo "$as_me:$LINENO: result: $ac_cv_crypt_r_style" >&5
36019 $as_echo "$ac_cv_crypt_r_style" >&6; }
36020 if test "$ac_cv_crypt_r_style" = "cryptd"; then
36021
36022 cat >>confdefs.h <<\_ACEOF
36023 #define CRYPT_R_CRYPTD 1
36024 _ACEOF
36025
36026 fi
36027 # if we don't combine these conditions, CRYPT_R_STRUCT_CRYPT_DATA
36028 # will end up defined twice
36029 if test "$ac_cv_crypt_r_style" = "struct_crypt_data"; then
36030
36031 cat >>confdefs.h <<\_ACEOF
36032 #define CRYPT_R_STRUCT_CRYPT_DATA 1
36033 _ACEOF
36034
36035 fi
36036
36037 fi
36038
36039 so_ext=$APR_SO_EXT
36040 lib_target=$APR_LIB_TARGET
36041
36042
36043
36044 APRUTIL_LIBNAME="aprutil${libsuffix}"
36045
36046
36047 # Use -no-install to link the test programs on all platforms
36048 # but Darwin, where it would cause the programs to be linked
36049 # against installed versions of libapr instead of those just
36050 # built.
36051 case $host in
36052 *-apple-darwin*) LT_NO_INSTALL="" ;;
36053 *) LT_NO_INSTALL="-no-install" ;;
36054 esac
36055
36056
36057 EXTRA_OS_LINK=""
36058 host_alias=`uname -s`
36059 case "$host_alias" in
36060                         *AIX*|*Darwin*|*BeOS*|CYGWIN*)
36061         EXTRA_OS_LINK='$(APRUTIL_LDFLAGS) $(APRUTIL_LIBS)'
36062     ;;
36063 *)
36064     ;;
36065 esac
36066
36067
36068
36069
36070   if test "x$APRUTIL_LIBS" = "x"; then
36071     echo "  setting APRUTIL_LIBS to \"$APR_LIBS\""
36072     APRUTIL_LIBS="$APR_LIBS"
36073   else
36074     apr_addto_bugger="$APR_LIBS"
36075     for i in $apr_addto_bugger; do
36076       apr_addto_duplicate="0"
36077       for j in $APRUTIL_LIBS; do
36078         if test "x$i" = "x$j"; then
36079           apr_addto_duplicate="1"
36080           break
36081         fi
36082       done
36083       if test $apr_addto_duplicate = "0"; then
36084         echo "  adding \"$i\" to APRUTIL_LIBS"
36085         APRUTIL_LIBS="$APRUTIL_LIBS $i"
36086       fi
36087     done
36088   fi
36089
36090
36091
36092
36093
36094
36095
36096
36097
36098 if test ! -d ./build; then
36099    $mkdir_p build
36100 fi
36101 cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
36102
36103 case "$host_alias" in
36104 *bsdi* | BSD/OS)
36105     # Check whether they've installed GNU make
36106     if make --version > /dev/null 2>&1; then
36107         INCLUDE_RULES="include $abs_builddir/build/rules.mk"
36108     else
36109         INCLUDE_RULES=".include \"$abs_builddir/build/rules.mk\""
36110     fi
36111     ;;
36112 *)
36113     INCLUDE_RULES="include $abs_builddir/build/rules.mk"
36114     ;;
36115 esac
36116
36117
36118 if test -f $abs_srcdir/test/Makefile.in; then
36119     test_Makefile="test/Makefile"
36120 fi
36121
36122 if test ! -d "$top_builddir/include/private"; then
36123     $mkdir_p $top_builddir/include/private
36124 fi
36125
36126 MAKEFILES="Makefile buckets/Makefile crypto/Makefile dbm/Makefile dbm/sdbm/Makefile encoding/Makefile hooks/Makefile ldap/Makefile uri/Makefile xml/Makefile misc/Makefile strmatch/Makefile xlate/Makefile $test_Makefile"
36127 ac_config_files="$ac_config_files export_vars.sh apu-config build/pkg/pkginfo include/private/apu_select_dbm.h include/apr_ldap.h include/apu.h include/apu_want.h $MAKEFILES"
36128
36129 ac_config_commands="$ac_config_commands default"
36130
36131 cat >confcache <<\_ACEOF
36132 # This file is a shell script that caches the results of configure
36133 # tests run on this system so they can be shared between configure
36134 # scripts and configure runs, see configure's option --config-cache.
36135 # It is not useful on other systems.  If it contains results you don't
36136 # want to keep, you may remove or edit it.
36137 #
36138 # config.status only pays attention to the cache file if you give it
36139 # the --recheck option to rerun configure.
36140 #
36141 # `ac_cv_env_foo' variables (set or unset) will be overridden when
36142 # loading this file, other *unset* `ac_cv_foo' will be assigned the
36143 # following values.
36144
36145 _ACEOF
36146
36147 # The following way of writing the cache mishandles newlines in values,
36148 # but we know of no workaround that is simple, portable, and efficient.
36149 # So, we kill variables containing newlines.
36150 # Ultrix sh set writes to stderr and can't be redirected directly,
36151 # and sets the high bit in the cache file unless we assign to the vars.
36152 (
36153   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
36154     eval ac_val=\$$ac_var
36155     case $ac_val in #(
36156     *${as_nl}*)
36157       case $ac_var in #(
36158       *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
36159 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
36160       esac
36161       case $ac_var in #(
36162       _ | IFS | as_nl) ;; #(
36163       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
36164       *) $as_unset $ac_var ;;
36165       esac ;;
36166     esac
36167   done
36168
36169   (set) 2>&1 |
36170     case $as_nl`(ac_space=' '; set) 2>&1` in #(
36171     *${as_nl}ac_space=\ *)
36172       # `set' does not quote correctly, so add quotes (double-quote
36173       # substitution turns \\\\ into \\, and sed turns \\ into \).
36174       sed -n \
36175         "s/'/'\\\\''/g;
36176           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
36177       ;; #(
36178     *)
36179       # `set' quotes correctly as required by POSIX, so do not add quotes.
36180       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
36181       ;;
36182     esac |
36183     sort
36184 ) |
36185   sed '
36186      /^ac_cv_env_/b end
36187      t clear
36188      :clear
36189      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
36190      t end
36191      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
36192      :end' >>confcache
36193 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
36194   if test -w "$cache_file"; then
36195     test "x$cache_file" != "x/dev/null" &&
36196       { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
36197 $as_echo "$as_me: updating cache $cache_file" >&6;}
36198     cat confcache >$cache_file
36199   else
36200     { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
36201 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
36202   fi
36203 fi
36204 rm -f confcache
36205
36206 test "x$prefix" = xNONE && prefix=$ac_default_prefix
36207 # Let make expand exec_prefix.
36208 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
36209
36210 DEFS=-DHAVE_CONFIG_H
36211
36212 ac_libobjs=
36213 ac_ltlibobjs=
36214 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
36215   # 1. Remove the extension, and $U if already installed.
36216   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
36217   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
36218   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
36219   #    will be set to the directory where LIBOBJS objects are built.
36220   ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
36221   ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
36222 done
36223 LIBOBJS=$ac_libobjs
36224
36225 LTLIBOBJS=$ac_ltlibobjs
36226
36227
36228
36229 : ${CONFIG_STATUS=./config.status}
36230 ac_write_fail=0
36231 ac_clean_files_save=$ac_clean_files
36232 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
36233 { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
36234 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
36235 cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
36236 #! $SHELL
36237 # Generated by $as_me.
36238 # Run this file to recreate the current configuration.
36239 # Compiler output produced by configure, useful for debugging
36240 # configure, is in config.log if it exists.
36241
36242 debug=false
36243 ac_cs_recheck=false
36244 ac_cs_silent=false
36245 SHELL=\${CONFIG_SHELL-$SHELL}
36246 _ACEOF
36247
36248 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
36249 ## --------------------- ##
36250 ## M4sh Initialization.  ##
36251 ## --------------------- ##
36252
36253 # Be more Bourne compatible
36254 DUALCASE=1; export DUALCASE # for MKS sh
36255 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
36256   emulate sh
36257   NULLCMD=:
36258   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
36259   # is contrary to our usage.  Disable this feature.
36260   alias -g '${1+"$@"}'='"$@"'
36261   setopt NO_GLOB_SUBST
36262 else
36263   case `(set -o) 2>/dev/null` in
36264   *posix*) set -o posix ;;
36265 esac
36266
36267 fi
36268
36269
36270
36271
36272 # PATH needs CR
36273 # Avoid depending upon Character Ranges.
36274 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
36275 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
36276 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
36277 as_cr_digits='0123456789'
36278 as_cr_alnum=$as_cr_Letters$as_cr_digits
36279
36280 as_nl='
36281 '
36282 export as_nl
36283 # Printing a long string crashes Solaris 7 /usr/bin/printf.
36284 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
36285 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
36286 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
36287 if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
36288   as_echo='printf %s\n'
36289   as_echo_n='printf %s'
36290 else
36291   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
36292     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
36293     as_echo_n='/usr/ucb/echo -n'
36294   else
36295     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
36296     as_echo_n_body='eval
36297       arg=$1;
36298       case $arg in
36299       *"$as_nl"*)
36300         expr "X$arg" : "X\\(.*\\)$as_nl";
36301         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
36302       esac;
36303       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
36304     '
36305     export as_echo_n_body
36306     as_echo_n='sh -c $as_echo_n_body as_echo'
36307   fi
36308   export as_echo_body
36309   as_echo='sh -c $as_echo_body as_echo'
36310 fi
36311
36312 # The user is always right.
36313 if test "${PATH_SEPARATOR+set}" != set; then
36314   PATH_SEPARATOR=:
36315   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
36316     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
36317       PATH_SEPARATOR=';'
36318   }
36319 fi
36320
36321 # Support unset when possible.
36322 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
36323   as_unset=unset
36324 else
36325   as_unset=false
36326 fi
36327
36328
36329 # IFS
36330 # We need space, tab and new line, in precisely that order.  Quoting is
36331 # there to prevent editors from complaining about space-tab.
36332 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
36333 # splitting by setting IFS to empty value.)
36334 IFS=" ""        $as_nl"
36335
36336 # Find who we are.  Look in the path if we contain no directory separator.
36337 case $0 in
36338   *[\\/]* ) as_myself=$0 ;;
36339   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
36340 for as_dir in $PATH
36341 do
36342   IFS=$as_save_IFS
36343   test -z "$as_dir" && as_dir=.
36344   test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
36345 done
36346 IFS=$as_save_IFS
36347
36348      ;;
36349 esac
36350 # We did not find ourselves, most probably we were run as `sh COMMAND'
36351 # in which case we are not to be found in the path.
36352 if test "x$as_myself" = x; then
36353   as_myself=$0
36354 fi
36355 if test ! -f "$as_myself"; then
36356   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
36357   { (exit 1); exit 1; }
36358 fi
36359
36360 # Work around bugs in pre-3.0 UWIN ksh.
36361 for as_var in ENV MAIL MAILPATH
36362 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
36363 done
36364 PS1='$ '
36365 PS2='> '
36366 PS4='+ '
36367
36368 # NLS nuisances.
36369 LC_ALL=C
36370 export LC_ALL
36371 LANGUAGE=C
36372 export LANGUAGE
36373
36374 # Required to use basename.
36375 if expr a : '\(a\)' >/dev/null 2>&1 &&
36376    test "X`expr 00001 : '.*\(...\)'`" = X001; then
36377   as_expr=expr
36378 else
36379   as_expr=false
36380 fi
36381
36382 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
36383   as_basename=basename
36384 else
36385   as_basename=false
36386 fi
36387
36388
36389 # Name of the executable.
36390 as_me=`$as_basename -- "$0" ||
36391 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
36392          X"$0" : 'X\(//\)$' \| \
36393          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
36394 $as_echo X/"$0" |
36395     sed '/^.*\/\([^/][^/]*\)\/*$/{
36396             s//\1/
36397             q
36398           }
36399           /^X\/\(\/\/\)$/{
36400             s//\1/
36401             q
36402           }
36403           /^X\/\(\/\).*/{
36404             s//\1/
36405             q
36406           }
36407           s/.*/./; q'`
36408
36409 # CDPATH.
36410 $as_unset CDPATH
36411
36412
36413
36414   as_lineno_1=$LINENO
36415   as_lineno_2=$LINENO
36416   test "x$as_lineno_1" != "x$as_lineno_2" &&
36417   test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
36418
36419   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
36420   # uniformly replaced by the line number.  The first 'sed' inserts a
36421   # line-number line after each line using $LINENO; the second 'sed'
36422   # does the real work.  The second script uses 'N' to pair each
36423   # line-number line with the line containing $LINENO, and appends
36424   # trailing '-' during substitution so that $LINENO is not a special
36425   # case at line end.
36426   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
36427   # scripts with optimization help from Paolo Bonzini.  Blame Lee
36428   # E. McMahon (1931-1989) for sed's syntax.  :-)
36429   sed -n '
36430     p
36431     /[$]LINENO/=
36432   ' <$as_myself |
36433     sed '
36434       s/[$]LINENO.*/&-/
36435       t lineno
36436       b
36437       :lineno
36438       N
36439       :loop
36440       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
36441       t loop
36442       s/-\n.*//
36443     ' >$as_me.lineno &&
36444   chmod +x "$as_me.lineno" ||
36445     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
36446    { (exit 1); exit 1; }; }
36447
36448   # Don't try to exec as it changes $[0], causing all sort of problems
36449   # (the dirname of $[0] is not the place where we might find the
36450   # original and so on.  Autoconf is especially sensitive to this).
36451   . "./$as_me.lineno"
36452   # Exit status is that of the last command.
36453   exit
36454 }
36455
36456
36457 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
36458   as_dirname=dirname
36459 else
36460   as_dirname=false
36461 fi
36462
36463 ECHO_C= ECHO_N= ECHO_T=
36464 case `echo -n x` in
36465 -n*)
36466   case `echo 'x\c'` in
36467   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
36468   *)   ECHO_C='\c';;
36469   esac;;
36470 *)
36471   ECHO_N='-n';;
36472 esac
36473 if expr a : '\(a\)' >/dev/null 2>&1 &&
36474    test "X`expr 00001 : '.*\(...\)'`" = X001; then
36475   as_expr=expr
36476 else
36477   as_expr=false
36478 fi
36479
36480 rm -f conf$$ conf$$.exe conf$$.file
36481 if test -d conf$$.dir; then
36482   rm -f conf$$.dir/conf$$.file
36483 else
36484   rm -f conf$$.dir
36485   mkdir conf$$.dir 2>/dev/null
36486 fi
36487 if (echo >conf$$.file) 2>/dev/null; then
36488   if ln -s conf$$.file conf$$ 2>/dev/null; then
36489     as_ln_s='ln -s'
36490     # ... but there are two gotchas:
36491     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
36492     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
36493     # In both cases, we have to default to `cp -p'.
36494     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
36495       as_ln_s='cp -p'
36496   elif ln conf$$.file conf$$ 2>/dev/null; then
36497     as_ln_s=ln
36498   else
36499     as_ln_s='cp -p'
36500   fi
36501 else
36502   as_ln_s='cp -p'
36503 fi
36504 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
36505 rmdir conf$$.dir 2>/dev/null
36506
36507 if mkdir -p . 2>/dev/null; then
36508   as_mkdir_p=:
36509 else
36510   test -d ./-p && rmdir ./-p
36511   as_mkdir_p=false
36512 fi
36513
36514 if test -x / >/dev/null 2>&1; then
36515   as_test_x='test -x'
36516 else
36517   if ls -dL / >/dev/null 2>&1; then
36518     as_ls_L_option=L
36519   else
36520     as_ls_L_option=
36521   fi
36522   as_test_x='
36523     eval sh -c '\''
36524       if test -d "$1"; then
36525         test -d "$1/.";
36526       else
36527         case $1 in
36528         -*)set "./$1";;
36529         esac;
36530         case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
36531         ???[sx]*):;;*)false;;esac;fi
36532     '\'' sh
36533   '
36534 fi
36535 as_executable_p=$as_test_x
36536
36537 # Sed expression to map a string onto a valid CPP name.
36538 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
36539
36540 # Sed expression to map a string onto a valid variable name.
36541 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
36542
36543
36544 exec 6>&1
36545
36546 # Save the log message, to keep $[0] and so on meaningful, and to
36547 # report actual input values of CONFIG_FILES etc. instead of their
36548 # values after options handling.
36549 ac_log="
36550 This file was extended by $as_me, which was
36551 generated by GNU Autoconf 2.63.  Invocation command line was
36552
36553   CONFIG_FILES    = $CONFIG_FILES
36554   CONFIG_HEADERS  = $CONFIG_HEADERS
36555   CONFIG_LINKS    = $CONFIG_LINKS
36556   CONFIG_COMMANDS = $CONFIG_COMMANDS
36557   $ $0 $@
36558
36559 on `(hostname || uname -n) 2>/dev/null | sed 1q`
36560 "
36561
36562 _ACEOF
36563
36564 case $ac_config_files in *"
36565 "*) set x $ac_config_files; shift; ac_config_files=$*;;
36566 esac
36567
36568 case $ac_config_headers in *"
36569 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
36570 esac
36571
36572
36573 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
36574 # Files that config.status was made for.
36575 config_files="$ac_config_files"
36576 config_headers="$ac_config_headers"
36577 config_commands="$ac_config_commands"
36578
36579 _ACEOF
36580
36581 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
36582 ac_cs_usage="\
36583 \`$as_me' instantiates files from templates according to the
36584 current configuration.
36585
36586 Usage: $0 [OPTION]... [FILE]...
36587
36588   -h, --help       print this help, then exit
36589   -V, --version    print version number and configuration settings, then exit
36590   -q, --quiet, --silent
36591                    do not print progress messages
36592   -d, --debug      don't remove temporary files
36593       --recheck    update $as_me by reconfiguring in the same conditions
36594       --file=FILE[:TEMPLATE]
36595                    instantiate the configuration file FILE
36596       --header=FILE[:TEMPLATE]
36597                    instantiate the configuration header FILE
36598
36599 Configuration files:
36600 $config_files
36601
36602 Configuration headers:
36603 $config_headers
36604
36605 Configuration commands:
36606 $config_commands
36607
36608 Report bugs to <bug-autoconf@gnu.org>."
36609
36610 _ACEOF
36611 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
36612 ac_cs_version="\\
36613 config.status
36614 configured by $0, generated by GNU Autoconf 2.63,
36615   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
36616
36617 Copyright (C) 2008 Free Software Foundation, Inc.
36618 This config.status script is free software; the Free Software Foundation
36619 gives unlimited permission to copy, distribute and modify it."
36620
36621 ac_pwd='$ac_pwd'
36622 srcdir='$srcdir'
36623 test -n "\$AWK" || AWK=awk
36624 _ACEOF
36625
36626 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
36627 # The default lists apply if the user does not specify any file.
36628 ac_need_defaults=:
36629 while test $# != 0
36630 do
36631   case $1 in
36632   --*=*)
36633     ac_option=`expr "X$1" : 'X\([^=]*\)='`
36634     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
36635     ac_shift=:
36636     ;;
36637   *)
36638     ac_option=$1
36639     ac_optarg=$2
36640     ac_shift=shift
36641     ;;
36642   esac
36643
36644   case $ac_option in
36645   # Handling of the options.
36646   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
36647     ac_cs_recheck=: ;;
36648   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
36649     $as_echo "$ac_cs_version"; exit ;;
36650   --debug | --debu | --deb | --de | --d | -d )
36651     debug=: ;;
36652   --file | --fil | --fi | --f )
36653     $ac_shift
36654     case $ac_optarg in
36655     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
36656     esac
36657     CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
36658     ac_need_defaults=false;;
36659   --header | --heade | --head | --hea )
36660     $ac_shift
36661     case $ac_optarg in
36662     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
36663     esac
36664     CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
36665     ac_need_defaults=false;;
36666   --he | --h)
36667     # Conflict between --help and --header
36668     { $as_echo "$as_me: error: ambiguous option: $1
36669 Try \`$0 --help' for more information." >&2
36670    { (exit 1); exit 1; }; };;
36671   --help | --hel | -h )
36672     $as_echo "$ac_cs_usage"; exit ;;
36673   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
36674   | -silent | --silent | --silen | --sile | --sil | --si | --s)
36675     ac_cs_silent=: ;;
36676
36677   # This is an error.
36678   -*) { $as_echo "$as_me: error: unrecognized option: $1
36679 Try \`$0 --help' for more information." >&2
36680    { (exit 1); exit 1; }; } ;;
36681
36682   *) ac_config_targets="$ac_config_targets $1"
36683      ac_need_defaults=false ;;
36684
36685   esac
36686   shift
36687 done
36688
36689 ac_configure_extra_args=
36690
36691 if $ac_cs_silent; then
36692   exec 6>/dev/null
36693   ac_configure_extra_args="$ac_configure_extra_args --silent"
36694 fi
36695
36696 _ACEOF
36697 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
36698 if \$ac_cs_recheck; then
36699   set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
36700   shift
36701   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
36702   CONFIG_SHELL='$SHELL'
36703   export CONFIG_SHELL
36704   exec "\$@"
36705 fi
36706
36707 _ACEOF
36708 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
36709 exec 5>>config.log
36710 {
36711   echo
36712   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
36713 ## Running $as_me. ##
36714 _ASBOX
36715   $as_echo "$ac_log"
36716 } >&5
36717
36718 _ACEOF
36719 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
36720 _ACEOF
36721
36722 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
36723
36724 # Handling of arguments.
36725 for ac_config_target in $ac_config_targets
36726 do
36727   case $ac_config_target in
36728     "include/private/apu_config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/private/apu_config.h" ;;
36729     "export_vars.sh") CONFIG_FILES="$CONFIG_FILES export_vars.sh" ;;
36730     "apu-config") CONFIG_FILES="$CONFIG_FILES apu-config" ;;
36731     "build/pkg/pkginfo") CONFIG_FILES="$CONFIG_FILES build/pkg/pkginfo" ;;
36732     "include/private/apu_select_dbm.h") CONFIG_FILES="$CONFIG_FILES include/private/apu_select_dbm.h" ;;
36733     "include/apr_ldap.h") CONFIG_FILES="$CONFIG_FILES include/apr_ldap.h" ;;
36734     "include/apu.h") CONFIG_FILES="$CONFIG_FILES include/apu.h" ;;
36735     "include/apu_want.h") CONFIG_FILES="$CONFIG_FILES include/apu_want.h" ;;
36736     "$MAKEFILES") CONFIG_FILES="$CONFIG_FILES $MAKEFILES" ;;
36737     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
36738
36739   *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
36740 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
36741    { (exit 1); exit 1; }; };;
36742   esac
36743 done
36744
36745
36746 # If the user did not use the arguments to specify the items to instantiate,
36747 # then the envvar interface is used.  Set only those that are not.
36748 # We use the long form for the default assignment because of an extremely
36749 # bizarre bug on SunOS 4.1.3.
36750 if $ac_need_defaults; then
36751   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
36752   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
36753   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
36754 fi
36755
36756 # Have a temporary directory for convenience.  Make it in the build tree
36757 # simply because there is no reason against having it here, and in addition,
36758 # creating and moving files from /tmp can sometimes cause problems.
36759 # Hook for its removal unless debugging.
36760 # Note that there is a small window in which the directory will not be cleaned:
36761 # after its creation but before its name has been assigned to `$tmp'.
36762 $debug ||
36763 {
36764   tmp=
36765   trap 'exit_status=$?
36766   { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
36767 ' 0
36768   trap '{ (exit 1); exit 1; }' 1 2 13 15
36769 }
36770 # Create a (secure) tmp directory for tmp files.
36771
36772 {
36773   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
36774   test -n "$tmp" && test -d "$tmp"
36775 }  ||
36776 {
36777   tmp=./conf$$-$RANDOM
36778   (umask 077 && mkdir "$tmp")
36779 } ||
36780 {
36781    $as_echo "$as_me: cannot create a temporary directory in ." >&2
36782    { (exit 1); exit 1; }
36783 }
36784
36785 # Set up the scripts for CONFIG_FILES section.
36786 # No need to generate them if there are no CONFIG_FILES.
36787 # This happens for instance with `./config.status config.h'.
36788 if test -n "$CONFIG_FILES"; then
36789
36790
36791 ac_cr='\r'
36792 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
36793 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
36794   ac_cs_awk_cr='\\r'
36795 else
36796   ac_cs_awk_cr=$ac_cr
36797 fi
36798
36799 echo 'BEGIN {' >"$tmp/subs1.awk" &&
36800 _ACEOF
36801
36802
36803 {
36804   echo "cat >conf$$subs.awk <<_ACEOF" &&
36805   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
36806   echo "_ACEOF"
36807 } >conf$$subs.sh ||
36808   { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
36809 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
36810    { (exit 1); exit 1; }; }
36811 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
36812 ac_delim='%!_!# '
36813 for ac_last_try in false false false false false :; do
36814   . ./conf$$subs.sh ||
36815     { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
36816 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
36817    { (exit 1); exit 1; }; }
36818
36819   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
36820   if test $ac_delim_n = $ac_delim_num; then
36821     break
36822   elif $ac_last_try; then
36823     { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
36824 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
36825    { (exit 1); exit 1; }; }
36826   else
36827     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
36828   fi
36829 done
36830 rm -f conf$$subs.sh
36831
36832 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
36833 cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
36834 _ACEOF
36835 sed -n '
36836 h
36837 s/^/S["/; s/!.*/"]=/
36838 p
36839 g
36840 s/^[^!]*!//
36841 :repl
36842 t repl
36843 s/'"$ac_delim"'$//
36844 t delim
36845 :nl
36846 h
36847 s/\(.\{148\}\).*/\1/
36848 t more1
36849 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
36850 p
36851 n
36852 b repl
36853 :more1
36854 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
36855 p
36856 g
36857 s/.\{148\}//
36858 t nl
36859 :delim
36860 h
36861 s/\(.\{148\}\).*/\1/
36862 t more2
36863 s/["\\]/\\&/g; s/^/"/; s/$/"/
36864 p
36865 b
36866 :more2
36867 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
36868 p
36869 g
36870 s/.\{148\}//
36871 t delim
36872 ' <conf$$subs.awk | sed '
36873 /^[^""]/{
36874   N
36875   s/\n//
36876 }
36877 ' >>$CONFIG_STATUS || ac_write_fail=1
36878 rm -f conf$$subs.awk
36879 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
36880 _ACAWK
36881 cat >>"\$tmp/subs1.awk" <<_ACAWK &&
36882   for (key in S) S_is_set[key] = 1
36883   FS = "\a"
36884
36885 }
36886 {
36887   line = $ 0
36888   nfields = split(line, field, "@")
36889   substed = 0
36890   len = length(field[1])
36891   for (i = 2; i < nfields; i++) {
36892     key = field[i]
36893     keylen = length(key)
36894     if (S_is_set[key]) {
36895       value = S[key]
36896       line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
36897       len += length(value) + length(field[++i])
36898       substed = 1
36899     } else
36900       len += 1 + keylen
36901   }
36902
36903   print line
36904 }
36905
36906 _ACAWK
36907 _ACEOF
36908 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
36909 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
36910   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
36911 else
36912   cat
36913 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
36914   || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
36915 $as_echo "$as_me: error: could not setup config files machinery" >&2;}
36916    { (exit 1); exit 1; }; }
36917 _ACEOF
36918
36919 # VPATH may cause trouble with some makes, so we remove $(srcdir),
36920 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
36921 # trailing colons and then remove the whole line if VPATH becomes empty
36922 # (actually we leave an empty line to preserve line numbers).
36923 if test "x$srcdir" = x.; then
36924   ac_vpsub='/^[  ]*VPATH[        ]*=/{
36925 s/:*\$(srcdir):*/:/
36926 s/:*\${srcdir}:*/:/
36927 s/:*@srcdir@:*/:/
36928 s/^\([^=]*=[     ]*\):*/\1/
36929 s/:*$//
36930 s/^[^=]*=[       ]*$//
36931 }'
36932 fi
36933
36934 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
36935 fi # test -n "$CONFIG_FILES"
36936
36937 # Set up the scripts for CONFIG_HEADERS section.
36938 # No need to generate them if there are no CONFIG_HEADERS.
36939 # This happens for instance with `./config.status Makefile'.
36940 if test -n "$CONFIG_HEADERS"; then
36941 cat >"$tmp/defines.awk" <<\_ACAWK ||
36942 BEGIN {
36943 _ACEOF
36944
36945 # Transform confdefs.h into an awk script `defines.awk', embedded as
36946 # here-document in config.status, that substitutes the proper values into
36947 # config.h.in to produce config.h.
36948
36949 # Create a delimiter string that does not exist in confdefs.h, to ease
36950 # handling of long lines.
36951 ac_delim='%!_!# '
36952 for ac_last_try in false false :; do
36953   ac_t=`sed -n "/$ac_delim/p" confdefs.h`
36954   if test -z "$ac_t"; then
36955     break
36956   elif $ac_last_try; then
36957     { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
36958 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
36959    { (exit 1); exit 1; }; }
36960   else
36961     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
36962   fi
36963 done
36964
36965 # For the awk script, D is an array of macro values keyed by name,
36966 # likewise P contains macro parameters if any.  Preserve backslash
36967 # newline sequences.
36968
36969 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
36970 sed -n '
36971 s/.\{148\}/&'"$ac_delim"'/g
36972 t rset
36973 :rset
36974 s/^[     ]*#[    ]*define[       ][      ]*/ /
36975 t def
36976 d
36977 :def
36978 s/\\$//
36979 t bsnl
36980 s/["\\]/\\&/g
36981 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
36982 D["\1"]=" \3"/p
36983 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2"/p
36984 d
36985 :bsnl
36986 s/["\\]/\\&/g
36987 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
36988 D["\1"]=" \3\\\\\\n"\\/p
36989 t cont
36990 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
36991 t cont
36992 d
36993 :cont
36994 n
36995 s/.\{148\}/&'"$ac_delim"'/g
36996 t clear
36997 :clear
36998 s/\\$//
36999 t bsnlc
37000 s/["\\]/\\&/g; s/^/"/; s/$/"/p
37001 d
37002 :bsnlc
37003 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
37004 b cont
37005 ' <confdefs.h | sed '
37006 s/'"$ac_delim"'/"\\\
37007 "/g' >>$CONFIG_STATUS || ac_write_fail=1
37008
37009 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
37010   for (key in D) D_is_set[key] = 1
37011   FS = "\a"
37012 }
37013 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
37014   line = \$ 0
37015   split(line, arg, " ")
37016   if (arg[1] == "#") {
37017     defundef = arg[2]
37018     mac1 = arg[3]
37019   } else {
37020     defundef = substr(arg[1], 2)
37021     mac1 = arg[2]
37022   }
37023   split(mac1, mac2, "(") #)
37024   macro = mac2[1]
37025   prefix = substr(line, 1, index(line, defundef) - 1)
37026   if (D_is_set[macro]) {
37027     # Preserve the white space surrounding the "#".
37028     print prefix "define", macro P[macro] D[macro]
37029     next
37030   } else {
37031     # Replace #undef with comments.  This is necessary, for example,
37032     # in the case of _POSIX_SOURCE, which is predefined and required
37033     # on some systems where configure will not decide to define it.
37034     if (defundef == "undef") {
37035       print "/*", prefix defundef, macro, "*/"
37036       next
37037     }
37038   }
37039 }
37040 { print }
37041 _ACAWK
37042 _ACEOF
37043 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
37044   { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
37045 $as_echo "$as_me: error: could not setup config headers machinery" >&2;}
37046    { (exit 1); exit 1; }; }
37047 fi # test -n "$CONFIG_HEADERS"
37048
37049
37050 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
37051 shift
37052 for ac_tag
37053 do
37054   case $ac_tag in
37055   :[FHLC]) ac_mode=$ac_tag; continue;;
37056   esac
37057   case $ac_mode$ac_tag in
37058   :[FHL]*:*);;
37059   :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
37060 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
37061    { (exit 1); exit 1; }; };;
37062   :[FH]-) ac_tag=-:-;;
37063   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
37064   esac
37065   ac_save_IFS=$IFS
37066   IFS=:
37067   set x $ac_tag
37068   IFS=$ac_save_IFS
37069   shift
37070   ac_file=$1
37071   shift
37072
37073   case $ac_mode in
37074   :L) ac_source=$1;;
37075   :[FH])
37076     ac_file_inputs=
37077     for ac_f
37078     do
37079       case $ac_f in
37080       -) ac_f="$tmp/stdin";;
37081       *) # Look for the file first in the build tree, then in the source tree
37082          # (if the path is not absolute).  The absolute path cannot be DOS-style,
37083          # because $ac_f cannot contain `:'.
37084          test -f "$ac_f" ||
37085            case $ac_f in
37086            [\\/$]*) false;;
37087            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
37088            esac ||
37089            { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
37090 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
37091    { (exit 1); exit 1; }; };;
37092       esac
37093       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
37094       ac_file_inputs="$ac_file_inputs '$ac_f'"
37095     done
37096
37097     # Let's still pretend it is `configure' which instantiates (i.e., don't
37098     # use $as_me), people would be surprised to read:
37099     #    /* config.h.  Generated by config.status.  */
37100     configure_input='Generated from '`
37101           $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
37102         `' by configure.'
37103     if test x"$ac_file" != x-; then
37104       configure_input="$ac_file.  $configure_input"
37105       { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
37106 $as_echo "$as_me: creating $ac_file" >&6;}
37107     fi
37108     # Neutralize special characters interpreted by sed in replacement strings.
37109     case $configure_input in #(
37110     *\&* | *\|* | *\\* )
37111        ac_sed_conf_input=`$as_echo "$configure_input" |
37112        sed 's/[\\\\&|]/\\\\&/g'`;; #(
37113     *) ac_sed_conf_input=$configure_input;;
37114     esac
37115
37116     case $ac_tag in
37117     *:-:* | *:-) cat >"$tmp/stdin" \
37118       || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
37119 $as_echo "$as_me: error: could not create $ac_file" >&2;}
37120    { (exit 1); exit 1; }; } ;;
37121     esac
37122     ;;
37123   esac
37124
37125   ac_dir=`$as_dirname -- "$ac_file" ||
37126 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
37127          X"$ac_file" : 'X\(//\)[^/]' \| \
37128          X"$ac_file" : 'X\(//\)$' \| \
37129          X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
37130 $as_echo X"$ac_file" |
37131     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
37132             s//\1/
37133             q
37134           }
37135           /^X\(\/\/\)[^/].*/{
37136             s//\1/
37137             q
37138           }
37139           /^X\(\/\/\)$/{
37140             s//\1/
37141             q
37142           }
37143           /^X\(\/\).*/{
37144             s//\1/
37145             q
37146           }
37147           s/.*/./; q'`
37148   { as_dir="$ac_dir"
37149   case $as_dir in #(
37150   -*) as_dir=./$as_dir;;
37151   esac
37152   test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
37153     as_dirs=
37154     while :; do
37155       case $as_dir in #(
37156       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
37157       *) as_qdir=$as_dir;;
37158       esac
37159       as_dirs="'$as_qdir' $as_dirs"
37160       as_dir=`$as_dirname -- "$as_dir" ||
37161 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
37162          X"$as_dir" : 'X\(//\)[^/]' \| \
37163          X"$as_dir" : 'X\(//\)$' \| \
37164          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
37165 $as_echo X"$as_dir" |
37166     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
37167             s//\1/
37168             q
37169           }
37170           /^X\(\/\/\)[^/].*/{
37171             s//\1/
37172             q
37173           }
37174           /^X\(\/\/\)$/{
37175             s//\1/
37176             q
37177           }
37178           /^X\(\/\).*/{
37179             s//\1/
37180             q
37181           }
37182           s/.*/./; q'`
37183       test -d "$as_dir" && break
37184     done
37185     test -z "$as_dirs" || eval "mkdir $as_dirs"
37186   } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
37187 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
37188    { (exit 1); exit 1; }; }; }
37189   ac_builddir=.
37190
37191 case "$ac_dir" in
37192 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
37193 *)
37194   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
37195   # A ".." for each directory in $ac_dir_suffix.
37196   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
37197   case $ac_top_builddir_sub in
37198   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
37199   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
37200   esac ;;
37201 esac
37202 ac_abs_top_builddir=$ac_pwd
37203 ac_abs_builddir=$ac_pwd$ac_dir_suffix
37204 # for backward compatibility:
37205 ac_top_builddir=$ac_top_build_prefix
37206
37207 case $srcdir in
37208   .)  # We are building in place.
37209     ac_srcdir=.
37210     ac_top_srcdir=$ac_top_builddir_sub
37211     ac_abs_top_srcdir=$ac_pwd ;;
37212   [\\/]* | ?:[\\/]* )  # Absolute name.
37213     ac_srcdir=$srcdir$ac_dir_suffix;
37214     ac_top_srcdir=$srcdir
37215     ac_abs_top_srcdir=$srcdir ;;
37216   *) # Relative name.
37217     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
37218     ac_top_srcdir=$ac_top_build_prefix$srcdir
37219     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
37220 esac
37221 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
37222
37223
37224   case $ac_mode in
37225   :F)
37226   #
37227   # CONFIG_FILE
37228   #
37229
37230 _ACEOF
37231
37232 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
37233 # If the template does not know about datarootdir, expand it.
37234 # FIXME: This hack should be removed a few years after 2.60.
37235 ac_datarootdir_hack=; ac_datarootdir_seen=
37236
37237 ac_sed_dataroot='
37238 /datarootdir/ {
37239   p
37240   q
37241 }
37242 /@datadir@/p
37243 /@docdir@/p
37244 /@infodir@/p
37245 /@localedir@/p
37246 /@mandir@/p
37247 '
37248 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
37249 *datarootdir*) ac_datarootdir_seen=yes;;
37250 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
37251   { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
37252 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
37253 _ACEOF
37254 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
37255   ac_datarootdir_hack='
37256   s&@datadir@&$datadir&g
37257   s&@docdir@&$docdir&g
37258   s&@infodir@&$infodir&g
37259   s&@localedir@&$localedir&g
37260   s&@mandir@&$mandir&g
37261     s&\\\${datarootdir}&$datarootdir&g' ;;
37262 esac
37263 _ACEOF
37264
37265 # Neutralize VPATH when `$srcdir' = `.'.
37266 # Shell code in configure.ac might set extrasub.
37267 # FIXME: do we really want to maintain this feature?
37268 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
37269 ac_sed_extra="$ac_vpsub
37270 $extrasub
37271 _ACEOF
37272 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
37273 :t
37274 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
37275 s|@configure_input@|$ac_sed_conf_input|;t t
37276 s&@top_builddir@&$ac_top_builddir_sub&;t t
37277 s&@top_build_prefix@&$ac_top_build_prefix&;t t
37278 s&@srcdir@&$ac_srcdir&;t t
37279 s&@abs_srcdir@&$ac_abs_srcdir&;t t
37280 s&@top_srcdir@&$ac_top_srcdir&;t t
37281 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
37282 s&@builddir@&$ac_builddir&;t t
37283 s&@abs_builddir@&$ac_abs_builddir&;t t
37284 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
37285 $ac_datarootdir_hack
37286 "
37287 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
37288   || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
37289 $as_echo "$as_me: error: could not create $ac_file" >&2;}
37290    { (exit 1); exit 1; }; }
37291
37292 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
37293   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
37294   { ac_out=`sed -n '/^[  ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
37295   { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
37296 which seems to be undefined.  Please make sure it is defined." >&5
37297 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
37298 which seems to be undefined.  Please make sure it is defined." >&2;}
37299
37300   rm -f "$tmp/stdin"
37301   case $ac_file in
37302   -) cat "$tmp/out" && rm -f "$tmp/out";;
37303   *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
37304   esac \
37305   || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
37306 $as_echo "$as_me: error: could not create $ac_file" >&2;}
37307    { (exit 1); exit 1; }; }
37308  ;;
37309   :H)
37310   #
37311   # CONFIG_HEADER
37312   #
37313   if test x"$ac_file" != x-; then
37314     {
37315       $as_echo "/* $configure_input  */" \
37316       && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
37317     } >"$tmp/config.h" \
37318       || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
37319 $as_echo "$as_me: error: could not create $ac_file" >&2;}
37320    { (exit 1); exit 1; }; }
37321     if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
37322       { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
37323 $as_echo "$as_me: $ac_file is unchanged" >&6;}
37324     else
37325       rm -f "$ac_file"
37326       mv "$tmp/config.h" "$ac_file" \
37327         || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
37328 $as_echo "$as_me: error: could not create $ac_file" >&2;}
37329    { (exit 1); exit 1; }; }
37330     fi
37331   else
37332     $as_echo "/* $configure_input  */" \
37333       && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
37334       || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
37335 $as_echo "$as_me: error: could not create -" >&2;}
37336    { (exit 1); exit 1; }; }
37337   fi
37338  ;;
37339
37340   :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
37341 $as_echo "$as_me: executing $ac_file commands" >&6;}
37342  ;;
37343   esac
37344
37345
37346   case $ac_file$ac_mode in
37347     "default":C)
37348 chmod +x apu-config
37349  ;;
37350
37351   esac
37352 done # for ac_tag
37353
37354
37355 { (exit 0); exit 0; }
37356 _ACEOF
37357 chmod +x $CONFIG_STATUS
37358 ac_clean_files=$ac_clean_files_save
37359
37360 test $ac_write_fail = 0 ||
37361   { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
37362 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
37363    { (exit 1); exit 1; }; }
37364
37365
37366 # configure is writing to config.log, and then calls config.status.
37367 # config.status does its own redirection, appending to config.log.
37368 # Unfortunately, on DOS this fails, as config.log is still kept open
37369 # by configure, so config.status won't be able to write to it; its
37370 # output is simply discarded.  So we exec the FD to /dev/null,
37371 # effectively closing config.log, so it can be properly (re)opened and
37372 # appended to by config.status.  When coming back to configure, we
37373 # need to make the FD available again.
37374 if test "$no_create" != yes; then
37375   ac_cs_success=:
37376   ac_config_status_args=
37377   test "$silent" = yes &&
37378     ac_config_status_args="$ac_config_status_args --quiet"
37379   exec 5>/dev/null
37380   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
37381   exec 5>>config.log
37382   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
37383   # would make configure fail if this is the last instruction.
37384   $ac_cs_success || { (exit 1); exit 1; }
37385 fi
37386 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
37387   { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
37388 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
37389 fi
37390