gstein 2003/08/29 15:55:34
Modified: build dbm.m4
Log:
Fix a problem with BDB detection. There were conflicts across the
functions because of the variable names. Unfortunately, we don't have
actual scoping on these variables :-)
In the particular case that I saw, APU_CHECK_DB41() would set the $places
variable because it was unset. However, the APU_CHECK_ALL() would then
pass that *modified* $places value into APU_CHECK_DB4(). Thus, my BDB 4.0
check was looking in /usr/local/BerkeleyDB.4.1, even though I hadn't told
it to look anywhere (iow, wrong defaults for BDB 4.0).
The fix is simply to use different variable names for the "higher-level"
functions which call into the lower-level functions. The low-level funcs
can reuse the variable no problem since they initialize it from the
(empty) parameter which is passed to them.
Revision Changes Path
1.2 +19 -19 apr-util/build/dbm.m4
Index: dbm.m4
===================================================================
RCS file: /home/cvs/apr-util/build/dbm.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dbm.m4 28 Aug 2003 17:29:07 -0000 1.1
+++ dbm.m4 29 Aug 2003 22:55:34 -0000 1.2
@@ -382,53 +382,53 @@
AC_DEFUN(APU_CHECK_DB, [
requested=$1
- places=$2
+ check_places=$2
case "$requested" in
db)
- APU_CHECK_DB_ALL("$places")
+ APU_CHECK_DB_ALL("$check_places")
if test "$apu_have_db" = "0"; then
AC_MSG_ERROR(Berkeley db requested, but not found)
fi
;;
db1)
- APU_CHECK_DB1("$places")
+ APU_CHECK_DB1("$check_places")
if test "$apu_db_version" != "1"; then
AC_MSG_ERROR(Berkeley db1 not found)
fi
;;
db185)
- APU_CHECK_DB185("$places")
+ APU_CHECK_DB185("$check_places")
if test "$apu_db_version" != "185"; then
AC_MSG_ERROR(Berkeley db185 not found)
fi
;;
db2)
- APU_CHECK_DB2("$places")
+ APU_CHECK_DB2("$check_places")
if test "$apu_db_version" != "2"; then
AC_MSG_ERROR(Berkeley db2 not found)
fi
;;
db3)
- APU_CHECK_DB3("$places")
+ APU_CHECK_DB3("$check_places")
if test "$apu_db_version" != "3"; then
AC_MSG_ERROR(Berkeley db3 not found)
fi
;;
db4)
- APU_CHECK_DB4("$places")
+ APU_CHECK_DB4("$check_places")
if test "$apu_db_version" != "4"; then
AC_MSG_ERROR(Berkeley db4 not found)
fi
;;
db41)
- APU_CHECK_DB41("$places")
+ APU_CHECK_DB41("$check_places")
if test "$apu_db_version" != "4"; then
AC_MSG_ERROR(Berkeley db4 not found)
fi
;;
default)
- APU_CHECK_DB_ALL("$places")
+ APU_CHECK_DB_ALL("$check_places")
;;
esac
])
@@ -437,19 +437,19 @@
dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 4.1 to 1.
dnl
AC_DEFUN(APU_CHECK_DB_ALL, [
- places=$1
+ all_places=$1
- APU_CHECK_DB41("$places")
+ APU_CHECK_DB41("$all_places")
if test "$apu_db_version" != "4"; then
- APU_CHECK_DB4("$places")
+ APU_CHECK_DB4("$all_places")
if test "$apu_db_version" != "4"; then
- APU_CHECK_DB3("$places")
+ APU_CHECK_DB3("$all_places")
if test "$apu_db_version" != "3"; then
- APU_CHECK_DB2("$places")
+ APU_CHECK_DB2("$all_places")
if test "$apu_db_version" != "2"; then
- APU_CHECK_DB1("$places")
+ APU_CHECK_DB1("$all_places")
if test "$apu_db_version" != "1"; then
- APU_CHECK_DB185("$places")
+ APU_CHECK_DB185("$all_places")
fi
fi
fi
@@ -598,16 +598,16 @@
], [
if test "$withval" = "yes"; then
apu_want_db=1
- bdb_places=""
+ user_places=""
elif test "$withval" = "no"; then
apu_want_db=0
else
apu_want_db=1
- bdb_places="$withval"
+ user_places="$withval"
fi
if test "$apu_want_db" != "0"; then
- APU_CHECK_DB($requested, $bdb_places)
+ APU_CHECK_DB($requested, $user_places)
if test "$apu_have_db" = "0"; then
AC_ERROR(Berkeley DB not found.)
fi