- disable DBM-drivers-as-DSO support

- backport r783046 from upstream
This commit is contained in:
jorton 2009-06-09 16:01:21 +00:00
parent 1a525b0607
commit 0039045912
2 changed files with 88 additions and 5 deletions

View File

@ -0,0 +1,81 @@
--- apr-util-1.3.7/build/dso.m4.nodbmdso
+++ apr-util-1.3.7/build/dso.m4
@@ -27,10 +27,33 @@ AC_DEFUN([APU_CHECK_UTIL_DSO], [
if test "$enable_util_dso" = "no"; then
apu_dso_build="0"
else
- apr_h="`$apr_config --includedir`/apr.h"
- apu_dso_build="`awk '/^#define APR_HAS_DSO/ { print @S|@3; }' $apr_h`"
+ AC_CACHE_CHECK([whether APR has DSO support], [apu_cv_aprdso],
+ [apu_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $APR_INCLUDES"
+ AC_EGREP_CPP([yes], [#include "apr.h"
+#if APR_HAS_DSO
+yes
+#endif
+], [apu_cv_aprdso=yes], [apu_cv_aprdso=no])
+ CPPFLAGS=$apu_save_CPPFLAGS])
+
+ if test $apu_cv_aprdso = yes; then
+ apu_dso_build=1
+ else
+ apu_dso_build=0
+ fi
fi
+
+ ### Hack: force static linking of DBM code.
+ objs=
+ test $apu_have_db = 1 && objs="$objs dbm/apr_dbm_berkeleydb.lo"
+ test $apu_have_gdbm = 1 && objs="$objs dbm/apr_dbm_gdbm.lo"
+ test $apu_have_ndbm = 1 && objs="$objs dbm/apr_dbm_ndbm.lo"
+ EXTRA_OBJECTS="$EXTRA_OBJECTS $objs"
+ APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm"
+ APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm"
+
if test "$apu_dso_build" = "0"; then
# Statically link the drivers:
@@ -42,9 +65,6 @@ AC_DEFUN([APU_CHECK_UTIL_DSO], [
test $apu_have_sqlite3 = 1 && objs="$objs dbd/apr_dbd_sqlite3.lo"
test $apu_have_freetds = 1 && objs="$objs dbd/apr_dbd_freetds.lo"
test $apu_have_odbc = 1 && objs="$objs dbd/apr_dbd_odbc.lo"
- test $apu_have_db = 1 && objs="$objs dbm/apr_dbm_berkeleydb.lo"
- test $apu_have_gdbm = 1 && objs="$objs dbm/apr_dbm_gdbm.lo"
- test $apu_have_ndbm = 1 && objs="$objs dbm/apr_dbm_ndbm.lo"
test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_init.lo"
test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_option.lo"
test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_rebind.lo"
@@ -65,10 +85,8 @@ AC_DEFUN([APU_CHECK_UTIL_DSO], [
fi
APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc"
- APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm"
APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_ldap"
APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc"
- APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm"
APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_ldap"
else
@@ -82,9 +100,6 @@ AC_DEFUN([APU_CHECK_UTIL_DSO], [
test $apu_have_sqlite3 = 1 && dsos="$dsos dbd/apr_dbd_sqlite3.la"
test $apu_have_freetds = 1 && dsos="$dsos dbd/apr_dbd_freetds.la"
test $apu_have_odbc = 1 && dsos="$dsos dbd/apr_dbd_odbc.la"
- test $apu_have_db = 1 && dsos="$dsos dbm/apr_dbm_db.la"
- test $apu_have_gdbm = 1 && dsos="$dsos dbm/apr_dbm_gdbm.la"
- test $apu_have_ndbm = 1 && dsos="$dsos dbm/apr_dbm_ndbm.la"
test $apu_has_ldap = 1 && dsos="$dsos ldap/apr_ldap.la"
if test -n "$dsos"; then
--- apr-util-1.3.7/dbm/apr_dbm.c.nodbmdso
+++ apr-util-1.3.7/dbm/apr_dbm.c
@@ -56,6 +56,9 @@
#error a DBM implementation was not specified
#endif
+#undef APU_DSO_BUILD
+#define APU_DSO_BUILD 0
+
#if APU_DSO_BUILD
static apr_hash_t *drivers = NULL;

View File

@ -4,12 +4,13 @@
Summary: Apache Portable Runtime Utility library
Name: apr-util
Version: 1.3.7
Release: 3%{?dist}
Release: 4%{?dist}
License: ASL 2.0
Group: System Environment/Libraries
URL: http://apr.apache.org/
Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2
Patch1: apr-util-1.2.7-pkgconf.patch
Patch2: apr-util-1.3.7-nodbmdso.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: autoconf, apr-devel >= 1.3.0
BuildRequires: db4-devel, expat-devel, e2fsprogs-devel
@ -94,9 +95,7 @@ This package provides the LDAP support for the apr-util.
%prep
%setup -q
%patch1 -p1 -b .pkgconf
# Our apr.h file is arch specific
sed -i -e 's,apr_h=\(.*\)/apr.h",apr_h=\1/apr-%{_arch}.h",' build/dso.m4
%patch2 -p1 -b .nodbmdso
%build
autoheader && autoconf
@ -153,7 +152,6 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%doc CHANGES LICENSE NOTICE
%{_libdir}/libaprutil-%{apuver}.so.*
%{_libdir}/apr-util-%{apuver}/apr_dbm*
%dir %{_libdir}/apr-util-%{apuver}
%files pgsql
@ -190,6 +188,10 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/aclocal/*.m4
%changelog
* Tue Jun 9 2009 Joe Orton <jorton@redhat.com> 1.3.7-4
- disable DBM-drivers-as-DSO support
- backport r783046 from upstream
* Mon Jun 8 2009 Bojan Smojver <bojan@rexursive.com> - 1.3.7-3
- make export of LD_LIBRARY_PATH simpler