summaryrefslogtreecommitdiff
path: root/sys-libs/db/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-libs/db/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-libs/db/files')
-rw-r--r--sys-libs/db/files/db-1.85-gentoo-paths.patch29
-rw-r--r--sys-libs/db/files/db-3.2.9-fix-dep-link.patch26
-rw-r--r--sys-libs/db/files/db-3.2.9-gcc43.patch16
-rw-r--r--sys-libs/db/files/db-4.0.14-fix-dep-link.patch38
-rw-r--r--sys-libs/db/files/db-4.2-jni-check-prefix-first.patch30
-rw-r--r--sys-libs/db/files/db-4.2-libtool.patch20
-rw-r--r--sys-libs/db/files/db-4.2-listen-to-java-options.patch10
-rw-r--r--sys-libs/db/files/db-4.2.52_p2-TXN.patch68
-rw-r--r--sys-libs/db/files/db-4.3-jni-check-prefix-first.patch30
-rw-r--r--sys-libs/db/files/db-4.3-libtool.patch47
-rw-r--r--sys-libs/db/files/db-4.3-listen-to-java-options.patch10
-rw-r--r--sys-libs/db/files/db-4.3.27-fix-dep-link.patch38
-rw-r--r--sys-libs/db/files/db-4.4-libtool.patch47
-rw-r--r--sys-libs/db/files/db-4.5-libtool.patch47
-rw-r--r--sys-libs/db/files/db-4.6-jni-check-prefix-first.patch30
-rw-r--r--sys-libs/db/files/db-4.6-libtool.patch47
-rw-r--r--sys-libs/db/files/db-4.8-libtool.patch65
-rw-r--r--sys-libs/db/files/db-4.8.24-java-manifest-location.patch12
-rw-r--r--sys-libs/db/files/db-4.8.30-rename-atomic-compare-exchange.patch22
-rw-r--r--sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch22
-rw-r--r--sys-libs/db/files/db-5.2.28-sqlite-configure-path.patch12
-rw-r--r--sys-libs/db/files/db-6.0.20-test-link.patch38
-rw-r--r--sys-libs/db/files/db-6.0.35-sqlite-configure-path.patch11
-rw-r--r--sys-libs/db/files/db-6.1.19-sqlite-configure-path.patch10
-rw-r--r--sys-libs/db/files/db-6.2-jni-check-prefix-first.patch38
-rw-r--r--sys-libs/db/files/db-6.2.32-jni-check-prefix-first.patch44
26 files changed, 807 insertions, 0 deletions
diff --git a/sys-libs/db/files/db-1.85-gentoo-paths.patch b/sys-libs/db/files/db-1.85-gentoo-paths.patch
new file mode 100644
index 000000000000..4a65106bdc70
--- /dev/null
+++ b/sys-libs/db/files/db-1.85-gentoo-paths.patch
@@ -0,0 +1,29 @@
+--- PORT/linux/Makefile
++++ PORT/linux/Makefile
+@@ -1,12 +1,12 @@
+ # @(#)Makefile 8.9 (Berkeley) 7/14/94
+
+-LIBDB= libdb.a
+-LIBDBSO=libdb.so
++LIBDB= libdb1.a
++LIBDBSO=libdb1.so
+ SOVER=2
+ SONAME=$(LIBDBSO).$(SOVER)
+ LIBNDBM=libndbm.a
+ LIBNDBMSO=libndbm.so
+-PROG= db_dump185
++PROG= db1_dump185
+ OBJ1= hash.o hash_bigkey.o hash_buf.o hash_func.o hash_log2.o hash_page.o \
+ ndbm.o
+ OBJ2= bt_close.o bt_conv.o bt_debug.o bt_delete.o bt_get.o bt_open.o \
+@@ -27,8 +27,8 @@
+ DESTDIR =
+ prefix = /usr
+ bindir = $(prefix)/bin
+-libdir = $(prefix)/lib
+-includedir = $(prefix)/include
++libdir = $(prefix)/@GENTOO_LIBDIR@
++includedir = $(prefix)/include/db1
+
+ all: $(LIBDB) $(LIBDBSO) $(PROG)
+
diff --git a/sys-libs/db/files/db-3.2.9-fix-dep-link.patch b/sys-libs/db/files/db-3.2.9-fix-dep-link.patch
new file mode 100644
index 000000000000..cdf6599b0d55
--- /dev/null
+++ b/sys-libs/db/files/db-3.2.9-fix-dep-link.patch
@@ -0,0 +1,26 @@
+--- db-3.2.9/dist/Makefile.in.orig 2003-02-23 23:41:13.000000000 +0200
++++ db-3.2.9/dist/Makefile.in 2003-02-23 23:42:07.000000000 +0200
+@@ -240,19 +240,19 @@
+
+ $(libso_target): $(OBJS)
+ $(SOLINK) $(SOFLAGS) -o $(libso_target) \
+- $(OBJS) $(LDFLAGS) $(LIBSO_LIBS)
++ $(OBJS) $(LDFLAGS) $(LIBS) $(LIBSO_LIBS)
+
+ $(libxso_target): $(COBJS) $(OBJS)
+ $(SOLINK) $(SOFLAGS) -o $(libxso_target) \
+- $(COBJS) $(OBJS) $(LDFLAGS) $(LIBXSO_LIBS)
++ $(COBJS) $(OBJS) $(LDFLAGS) $(LIBS) $(LIBXSO_LIBS)
+
+ $(libjso_target): $(JOBJS) $(OBJS)
+ $(SOLINK) $(SOFLAGS) -o $(libjso_target) \
+- $(JOBJS) $(OBJS) $(LDFLAGS) $(LIBJSO_LIBS)
++ $(JOBJS) $(OBJS) $(LDFLAGS) $(LIBS) $(LIBJSO_LIBS)
+
+ $(libtso_target): $(TOBJS) $(OBJS)
+ $(SOLINK) $(SOFLAGS) -o $(libtso_target) \
+- $(TOBJS) $(OBJS) $(LDFLAGS) $(LIBTSO_LIBS)
++ $(TOBJS) $(OBJS) $(LDFLAGS) $(LIBS) $(LIBTSO_LIBS)
+
+ ##################################################
+ # Creating individual dependencies and actions for building class
diff --git a/sys-libs/db/files/db-3.2.9-gcc43.patch b/sys-libs/db/files/db-3.2.9-gcc43.patch
new file mode 100644
index 000000000000..f032da85296a
--- /dev/null
+++ b/sys-libs/db/files/db-3.2.9-gcc43.patch
@@ -0,0 +1,16 @@
+diff -Nuar db-3.2.9.orig/include/db_cxx.h db-3.2.9/include/db_cxx.h
+--- db-3.2.9.orig/include/db_cxx.h 2001-01-11 10:28:55.000000000 -0800
++++ db-3.2.9/include/db_cxx.h 2008-08-16 16:10:48.474699646 -0700
+@@ -49,7 +49,12 @@
+ // Forward declarations
+ //
+
++#if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
++using namespace std;
++#include <iostream>
++#else
+ #include <iostream.h>
++#endif
+ #include <stdarg.h>
+ #include "db.h"
+
diff --git a/sys-libs/db/files/db-4.0.14-fix-dep-link.patch b/sys-libs/db/files/db-4.0.14-fix-dep-link.patch
new file mode 100644
index 000000000000..f54f064640e6
--- /dev/null
+++ b/sys-libs/db/files/db-4.0.14-fix-dep-link.patch
@@ -0,0 +1,38 @@
+--- db-4.0.14/dist/Makefile.in.orig 2003-08-16 06:21:53.763400112 +0200
++++ db-4.0.14/dist/Makefile.in 2003-08-16 06:23:16.036892640 +0200
+@@ -58,7 +58,7 @@
+
+ LDFLAGS= @LDFLAGS@
+ LIBS= @LIBS@
+-LIBSO_LIBS= @LIBSO_LIBS@
++LIBSO_LIBS= @LIBSO_LIBS@ $(LIBS)
+
+ libdb= libdb.a
+ libso_base= libdb
+@@ -77,7 +77,7 @@
+ CXX= @MAKEFILE_CXX@
+ CXXLINK= @MAKEFILE_CXXLINK@
+ XSOLINK= @MAKEFILE_XSOLINK@
+-LIBXSO_LIBS= @LIBXSO_LIBS@
++LIBXSO_LIBS= @LIBXSO_LIBS@ $(LIBS)
+
+ libcxx= libdb_cxx.a
+ libxso_base= libdb_cxx
+@@ -93,7 +93,7 @@
+ # Java support is optional and requires shared librarires.
+ ##################################################
+ CLASSPATH= $(JAVA_CLASSTOP)
+-LIBJSO_LIBS= @LIBJSO_LIBS@
++LIBJSO_LIBS= @LIBJSO_LIBS@ $(LIBS)
+
+ JAR= @JAR@
+ JAVAC= env CLASSPATH="$(CLASSPATH)" @JAVAC@
+@@ -121,7 +121,7 @@
+ # Tcl support is optional and requires shared libraries.
+ ##################################################
+ TCFLAGS= @TCFLAGS@
+-LIBTSO_LIBS= @LIBTSO_LIBS@
++LIBTSO_LIBS= @LIBTSO_LIBS@ $(LIBS)
+ libtso_base= libdb_tcl
+ libtso= $(libtso_base)-$(SOVERSION).@SOSUFFIX@
+ libtso_static= $(libtso_base)-$(SOVERSION).a
diff --git a/sys-libs/db/files/db-4.2-jni-check-prefix-first.patch b/sys-libs/db/files/db-4.2-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..17f80e1bcfef
--- /dev/null
+++ b/sys-libs/db/files/db-4.2-jni-check-prefix-first.patch
@@ -0,0 +1,30 @@
+--- dist/aclocal_java/ac_jni_include_dirs.ac 2003-10-06 20:41:38.000000000 +0200
++++ dist/aclocal_java/ac_jni_include_dirs.ac 2005-09-23 21:31:26.000000000 +0200
+@@ -43,14 +43,19 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- _JINC="$_JTOPDIR/Headers";;
+- *) _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ _JINC="$_JTOPDIR/Headers";;
++ *) _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/files/db-4.2-libtool.patch b/sys-libs/db/files/db-4.2-libtool.patch
new file mode 100644
index 000000000000..a4a9db7f4557
--- /dev/null
+++ b/sys-libs/db/files/db-4.2-libtool.patch
@@ -0,0 +1,20 @@
+--- ./dist/configure.orig 2004-09-22 22:58:48.421632944 -0700
++++ ./dist/configure 2004-09-22 23:02:55.068136976 -0700
+@@ -5657,7 +5657,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-case `"$LD" -v 2>&1 </dev/null` in
++case `$LD -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -11135,7 +11135,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-case `"$LD" -v 2>&1 </dev/null` in
++case `$LD -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
diff --git a/sys-libs/db/files/db-4.2-listen-to-java-options.patch b/sys-libs/db/files/db-4.2-listen-to-java-options.patch
new file mode 100644
index 000000000000..8ddb46b70261
--- /dev/null
+++ b/sys-libs/db/files/db-4.2-listen-to-java-options.patch
@@ -0,0 +1,10 @@
+--- dist/configure.ac 2005-09-23 21:01:26.000000000 +0200
++++ dist/configure.ac 2005-09-23 20:59:20.000000000 +0200
+@@ -385,6 +385,7 @@
+ # A classpath that includes . is needed to check for Java
+ CLASSPATH=".:$CLASSPATH"
+ export CLASSPATH
++ AC_JAVA_OPTIONS
+ AC_PROG_JAVAC
+ AC_PROG_JAR
+ AC_PROG_JAVA
diff --git a/sys-libs/db/files/db-4.2.52_p2-TXN.patch b/sys-libs/db/files/db-4.2.52_p2-TXN.patch
new file mode 100644
index 000000000000..7ff8874c0ca8
--- /dev/null
+++ b/sys-libs/db/files/db-4.2.52_p2-TXN.patch
@@ -0,0 +1,68 @@
+This patch is intended to be applied to Berkeley DB 4.2.52 and,
+if applied, will automatically be used by slapd(8) back-bdb/hdb.
+Without this patch the BDB DB_LOG_AUTOREMOVE option will not work,
+nor will db_archive allow any transaction log files to be removed
+while slapd is running.
+
+The patch can be applied to the BDB source using patch(1) as follows
+ cd db-4.2.52
+ patch -p0 < openldap-src/build/BerkeleyDB42.patch
+
+(modify directory paths as necessary), then recompile and reinstall
+the BerkeleyDB 4.2 library, and then build and install OpenLDAP
+Software.
+
+The patch should not be applied to Berkeley DB 4.3.
+
+
+Index: dbinc/db.in
+===================================================================
+RCS file: /var/CVSROOT/bdb42/dbinc/db.in,v
+retrieving revision 1.1.1.1
+retrieving revision 1.2
+diff -u -r1.1.1.1 -r1.2
+--- dbinc/db.in 25 Nov 2003 21:58:02 -0000 1.1.1.1
++++ dbinc/db.in 17 Jul 2004 16:07:23 -0000 1.2
+@@ -839,6 +839,7 @@
+ #define TXN_NOWAIT 0x040 /* Do not wait on locks. */
+ #define TXN_RESTORED 0x080 /* Transaction has been restored. */
+ #define TXN_SYNC 0x100 /* Sync on prepare and commit. */
++#define TXN_NOLOG 0x200 /* Do not log this transaction. */
+ u_int32_t flags;
+ };
+
+Index: txn/txn.c
+===================================================================
+RCS file: /var/CVSROOT/bdb42/txn/txn.c,v
+retrieving revision 1.1.1.2
+retrieving revision 1.2
+diff -u -r1.1.1.2 -r1.2
+--- txn/txn.c 17 Dec 2003 21:43:53 -0000 1.1.1.2
++++ txn/txn.c 17 Jul 2004 16:07:27 -0000 1.2
+@@ -127,7 +127,7 @@
+ if ((ret = __db_fchk(dbenv,
+ "txn_begin", flags,
+ DB_DIRTY_READ | DB_TXN_NOWAIT |
+- DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
++ DB_TXN_NOSYNC | DB_TXN_SYNC | DB_TXN_NOT_DURABLE)) != 0)
+ return (ret);
+ if ((ret = __db_fcchk(dbenv,
+ "txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
+@@ -193,6 +193,8 @@
+ F_SET(txn, TXN_SYNC);
+ if (LF_ISSET(DB_TXN_NOWAIT))
+ F_SET(txn, TXN_NOWAIT);
++ if (LF_ISSET(DB_TXN_NOT_DURABLE))
++ F_SET(txn, TXN_NOLOG);
+
+ if ((ret = __txn_begin_int(txn, 0)) != 0)
+ goto err;
+@@ -328,7 +330,7 @@
+ * We should set this value when we write the first log record, not
+ * here.
+ */
+- if (DBENV_LOGGING(dbenv))
++ if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
+ __log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
+ else
+ ZERO_LSN(begin_lsn);
diff --git a/sys-libs/db/files/db-4.3-jni-check-prefix-first.patch b/sys-libs/db/files/db-4.3-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..17f80e1bcfef
--- /dev/null
+++ b/sys-libs/db/files/db-4.3-jni-check-prefix-first.patch
@@ -0,0 +1,30 @@
+--- dist/aclocal_java/ac_jni_include_dirs.ac 2003-10-06 20:41:38.000000000 +0200
++++ dist/aclocal_java/ac_jni_include_dirs.ac 2005-09-23 21:31:26.000000000 +0200
+@@ -43,14 +43,19 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- _JINC="$_JTOPDIR/Headers";;
+- *) _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ _JINC="$_JTOPDIR/Headers";;
++ *) _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/files/db-4.3-libtool.patch b/sys-libs/db/files/db-4.3-libtool.patch
new file mode 100644
index 000000000000..426fd519f714
--- /dev/null
+++ b/sys-libs/db/files/db-4.3-libtool.patch
@@ -0,0 +1,47 @@
+--- dist/configure.orig 2005-02-02 11:22:49.596096072 +0100
++++ dist/configure 2005-02-02 11:23:46.749407448 +0100
+@@ -5684,7 +5684,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -8461,7 +8461,7 @@
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds="$tmp_archive_cmds"
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -11383,7 +11383,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15353,7 +15353,7 @@
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds_F77="$tmp_archive_cmds"
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -17695,7 +17695,7 @@
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds_GCJ="$tmp_archive_cmds"
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
diff --git a/sys-libs/db/files/db-4.3-listen-to-java-options.patch b/sys-libs/db/files/db-4.3-listen-to-java-options.patch
new file mode 100644
index 000000000000..8ddb46b70261
--- /dev/null
+++ b/sys-libs/db/files/db-4.3-listen-to-java-options.patch
@@ -0,0 +1,10 @@
+--- dist/configure.ac 2005-09-23 21:01:26.000000000 +0200
++++ dist/configure.ac 2005-09-23 20:59:20.000000000 +0200
+@@ -385,6 +385,7 @@
+ # A classpath that includes . is needed to check for Java
+ CLASSPATH=".:$CLASSPATH"
+ export CLASSPATH
++ AC_JAVA_OPTIONS
+ AC_PROG_JAVAC
+ AC_PROG_JAR
+ AC_PROG_JAVA
diff --git a/sys-libs/db/files/db-4.3.27-fix-dep-link.patch b/sys-libs/db/files/db-4.3.27-fix-dep-link.patch
new file mode 100644
index 000000000000..1d14e83d078c
--- /dev/null
+++ b/sys-libs/db/files/db-4.3.27-fix-dep-link.patch
@@ -0,0 +1,38 @@
+--- db-4.3.27/dist/Makefile.in.chris 2005-02-01 23:40:34.447945464 +0100
++++ db-4.3.27/dist/Makefile.in 2005-02-01 23:42:21.635650456 +0100
+@@ -58,7 +58,7 @@
+ LDFLAGS= @LDFLAGS@
+ LIBS= @LIBS@
+ TEST_LIBS= @TEST_LIBS@
+-LIBSO_LIBS= @LIBSO_LIBS@
++LIBSO_LIBS= @LIBSO_LIBS@ $(LIBS)
+
+ libdb_base= libdb
+ libdb= $(libdb_base).a
+@@ -77,7 +77,7 @@
+ CXX= @MAKEFILE_CXX@
+ CXXLINK= @MAKEFILE_CXXLINK@ @CXXFLAGS@
+ XSOLINK= @MAKEFILE_XSOLINK@ @CXXFLAGS@
+-LIBXSO_LIBS= @LIBXSO_LIBS@
++LIBXSO_LIBS= @LIBXSO_LIBS@ $(LIBS)
+
+ libcxx_base= libdb_cxx
+ libcxx= $(libcxx_base).a
+@@ -93,7 +93,7 @@
+ # Java support is optional and requires shared librarires.
+ ##################################################
+ CLASSPATH= $(JAVA_CLASSTOP)
+-LIBJSO_LIBS= @LIBJSO_LIBS@
++LIBJSO_LIBS= @LIBJSO_LIBS@ $(LIBS)
+
+ JAR= @JAR@
+ JAVAC= env CLASSPATH="$(CLASSPATH)" @JAVAC@
+@@ -126,7 +126,7 @@
+ # Tcl support is optional and requires shared libraries.
+ ##################################################
+ TCFLAGS= @TCFLAGS@
+-LIBTSO_LIBS= @LIBTSO_LIBS@
++LIBTSO_LIBS= @LIBTSO_LIBS@ $(LIBS)
+ libtso_base= libdb_tcl
+ libtso= $(libtso_base)-$(LIBVERSION)@MODSUFFIX@
+ libtso_static= $(libtso_base)-$(LIBVERSION).a
diff --git a/sys-libs/db/files/db-4.4-libtool.patch b/sys-libs/db/files/db-4.4-libtool.patch
new file mode 100644
index 000000000000..3d86b88f86b3
--- /dev/null
+++ b/sys-libs/db/files/db-4.4-libtool.patch
@@ -0,0 +1,47 @@
+--- dist/configure.orig 2006-01-31 10:23:58.000000000 +0100
++++ dist/configure 2006-01-31 10:26:43.000000000 +0100
+@@ -5765,7 +5765,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -8753,7 +8753,7 @@
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -11855,7 +11855,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15842,7 +15842,7 @@
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -18300,7 +18300,7 @@
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
diff --git a/sys-libs/db/files/db-4.5-libtool.patch b/sys-libs/db/files/db-4.5-libtool.patch
new file mode 100644
index 000000000000..3d86b88f86b3
--- /dev/null
+++ b/sys-libs/db/files/db-4.5-libtool.patch
@@ -0,0 +1,47 @@
+--- dist/configure.orig 2006-01-31 10:23:58.000000000 +0100
++++ dist/configure 2006-01-31 10:26:43.000000000 +0100
+@@ -5765,7 +5765,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -8753,7 +8753,7 @@
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -11855,7 +11855,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15842,7 +15842,7 @@
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -18300,7 +18300,7 @@
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
diff --git a/sys-libs/db/files/db-4.6-jni-check-prefix-first.patch b/sys-libs/db/files/db-4.6-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..63735e62469f
--- /dev/null
+++ b/sys-libs/db/files/db-4.6-jni-check-prefix-first.patch
@@ -0,0 +1,30 @@
+--- dist/aclocal_java/ac_jni_include_dirs.m4 2003-10-06 20:41:38.000000000 +0200
++++ dist/aclocal_java/ac_jni_include_dirs.m4 2005-09-23 21:31:26.000000000 +0200
+@@ -43,14 +43,19 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- _JINC="$_JTOPDIR/Headers";;
+- *) _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ _JINC="$_JTOPDIR/Headers";;
++ *) _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/files/db-4.6-libtool.patch b/sys-libs/db/files/db-4.6-libtool.patch
new file mode 100644
index 000000000000..3d86b88f86b3
--- /dev/null
+++ b/sys-libs/db/files/db-4.6-libtool.patch
@@ -0,0 +1,47 @@
+--- dist/configure.orig 2006-01-31 10:23:58.000000000 +0100
++++ dist/configure 2006-01-31 10:26:43.000000000 +0100
+@@ -5765,7 +5765,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -8753,7 +8753,7 @@
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -11855,7 +11855,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15842,7 +15842,7 @@
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -18300,7 +18300,7 @@
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
diff --git a/sys-libs/db/files/db-4.8-libtool.patch b/sys-libs/db/files/db-4.8-libtool.patch
new file mode 100644
index 000000000000..f5d985b2f209
--- /dev/null
+++ b/sys-libs/db/files/db-4.8-libtool.patch
@@ -0,0 +1,65 @@
+--- dist/configure
++++ dist/configure
+@@ -6691,7 +6691,7 @@
+ $as_echo_n "(cached) " >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -7348,7 +7348,7 @@
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+- case $LD in
++ case "$LD" in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+@@ -10664,7 +10664,7 @@
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>&1` in
++ case `"$LD" -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -10858,7 +10858,7 @@
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+- case `$LD -v 2>&1` in
++ case `"$LD" -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+@@ -12206,7 +12206,7 @@
+ libsuff= shlibsuff=
+ ;;
+ *)
+- case $LD in # libtool.m4 will add one of these switches to LD
++ case "$LD" in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+@@ -13423,7 +13423,7 @@
+ $as_echo_n "(cached) " >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15672,7 +15672,7 @@
+ libsuff= shlibsuff=
+ ;;
+ *)
+- case $LD in # libtool.m4 will add one of these switches to LD
++ case "$LD" in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
diff --git a/sys-libs/db/files/db-4.8.24-java-manifest-location.patch b/sys-libs/db/files/db-4.8.24-java-manifest-location.patch
new file mode 100644
index 000000000000..9cebadc52064
--- /dev/null
+++ b/sys-libs/db/files/db-4.8.24-java-manifest-location.patch
@@ -0,0 +1,12 @@
+diff -Nuar db-4.8.24.orig/dist/Makefile.in db-4.8.24/dist/Makefile.in
+--- db-4.8.24.orig/dist/Makefile.in 2009-09-19 23:39:45.286001896 +0000
++++ db-4.8.24/dist/Makefile.in 2009-09-19 23:41:13.079326882 +0000
+@@ -830,7 +830,7 @@
+ $(JAVA) -classpath $(JAVA_CLASSTOP) \
+ com.sleepycat.persist.model.ClassEnhancer $(JAVA_CLASSTOP)
+ cd $(JAVA_CLASSTOP) && \
+- $(JAR) cfm ../$(libj_jarfile) ../$(JAVA_MANIFEST) ./com/sleepycat
++ $(JAR) cfm ../$(libj_jarfile) $(JAVA_MANIFEST) ./com/sleepycat
+
+ $(libj_exjarfile): $(libj_jarfile) $(JAVA_EXSRCS)
+ @test -d $(JAVA_EXCLASSTOP) || \
diff --git a/sys-libs/db/files/db-4.8.30-rename-atomic-compare-exchange.patch b/sys-libs/db/files/db-4.8.30-rename-atomic-compare-exchange.patch
new file mode 100644
index 000000000000..c53160a82970
--- /dev/null
+++ b/sys-libs/db/files/db-4.8.30-rename-atomic-compare-exchange.patch
@@ -0,0 +1,22 @@
+diff --git a/dbinc/atomic.h b/dbinc/atomic.h
+index 0034dcc..fa7ba93 100644
+--- a/dbinc/atomic.h
++++ b/dbinc/atomic.h
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define atomic_inc(env, p) __atomic_inc(p)
+ #define atomic_dec(env, p) __atomic_dec(p)
+ #define atomic_compare_exchange(env, p, o, n) \
+- __atomic_compare_exchange((p), (o), (n))
++ __db_atomic_compare_exchange((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ int temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+ * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+ * which configure could be changed to use.
+ */
+-static inline int __atomic_compare_exchange(
++static inline int __db_atomic_compare_exchange(
+ db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ atomic_value_t was;
diff --git a/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch b/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch
new file mode 100644
index 000000000000..ad3da2786c88
--- /dev/null
+++ b/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch
@@ -0,0 +1,22 @@
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index 0034dcc..fa7ba93 100644
+--- a/src/dbinc/atomic.h
++++ b/src/dbinc/atomic.h
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define atomic_inc(env, p) __atomic_inc(p)
+ #define atomic_dec(env, p) __atomic_dec(p)
+ #define atomic_compare_exchange(env, p, o, n) \
+- __atomic_compare_exchange((p), (o), (n))
++ __db_atomic_compare_exchange((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ int temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+ * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+ * which configure could be changed to use.
+ */
+-static inline int __atomic_compare_exchange(
++static inline int __db_atomic_compare_exchange(
+ db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ atomic_value_t was;
diff --git a/sys-libs/db/files/db-5.2.28-sqlite-configure-path.patch b/sys-libs/db/files/db-5.2.28-sqlite-configure-path.patch
new file mode 100644
index 000000000000..ff7abbe1fd79
--- /dev/null
+++ b/sys-libs/db/files/db-5.2.28-sqlite-configure-path.patch
@@ -0,0 +1,12 @@
+diff -Nuar db-5.2.28.orig//dist/aclocal/sql.m4 db-5.2.28//dist/aclocal/sql.m4
+--- db-5.2.28.orig//dist/aclocal/sql.m4 2011-06-10 09:50:45.000000000 -0700
++++ db-5.2.28//dist/aclocal/sql.m4 2011-07-15 17:02:54.646521189 -0700
+@@ -91,7 +91,7 @@
+ # !!! END COPIED from autoconf distribution
+
+ sqlite_dir=$srcdir/../lang/sql/sqlite
+-(cd sql && eval "\$SHELL ../$sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline" && cat build_config.h >> config.h) || exit 1
++(cd sql && eval "\$SHELL $sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline" && cat build_config.h >> config.h) || exit 1
+
+ # Configure JDBC if --enable-jdbc
+ if test "$db_cv_jdbc" != "no"; then
diff --git a/sys-libs/db/files/db-6.0.20-test-link.patch b/sys-libs/db/files/db-6.0.20-test-link.patch
new file mode 100644
index 000000000000..8aceaa4d6f8c
--- /dev/null
+++ b/sys-libs/db/files/db-6.0.20-test-link.patch
@@ -0,0 +1,38 @@
+diff -Nuar db-6.0.20.orig/test/tcl/parallel.tcl db-6.0.20/test/tcl/parallel.tcl
+--- db-6.0.20.orig/test/tcl/parallel.tcl 2013-07-04 15:49:43.408348040 +0000
++++ db-6.0.20/test/tcl/parallel.tcl 2013-07-04 17:40:07.147943377 +0000
+@@ -289,16 +289,26 @@
+ [eval glob -nocomplain {$dir/$buildpath/db_{reptest,repsite,replicate}$EXE}] \
+ $destdir/$buildpath}
+ }
++ catch {
++ set l [eval glob {$dir/.libs} {$dir/db_{checkpoint,deadlock}$EXE} \
++ {$dir/db_{dump,load,printlog,recover,stat,upgrade}$EXE} \
++ {$dir/db_{archive,verify,hotbackup,log_verify}$EXE}]
++ foreach fn $l {
++ set fbasename [file tail $fn]
++ eval file link {$destdir/$fbasename} $fn
++ }
++ }
++ # we will be modifying this file, so we must copy, not link
+ catch {eval file copy \
+- [eval glob {$dir/{.libs,include.tcl}}] $destdir}
++ [eval glob {$dir/include.tcl}] $destdir}
+ # catch {eval file copy $dir/$queuedir $destdir}
+- catch {eval file copy \
+- [eval glob {$dir/db_{checkpoint,deadlock}$EXE} \
+- {$dir/db_{dump,load,printlog,recover,stat,upgrade}$EXE} \
+- {$dir/db_{archive,verify,hotbackup,log_verify}$EXE}] \
+- $destdir}
+- catch {eval file copy \
+- [eval glob -nocomplain {$dir/db_{reptest,repsite,replicate}$EXE}] $destdir}
++ catch {
++ set l [eval glob -nocomplain {$dir/db_{reptest,repsite,replicate}$EXE}]
++ foreach fn $l {
++ set fbasename [file tail $fn]
++ eval file link {$destdir/$fbasename} $fn
++ }
++ }
+
+ # Create modified copies of include.tcl in parallel
+ # directories so paths still work.
diff --git a/sys-libs/db/files/db-6.0.35-sqlite-configure-path.patch b/sys-libs/db/files/db-6.0.35-sqlite-configure-path.patch
new file mode 100644
index 000000000000..c239bb118a82
--- /dev/null
+++ b/sys-libs/db/files/db-6.0.35-sqlite-configure-path.patch
@@ -0,0 +1,11 @@
+--- db-6.0.35/dist/aclocal/sql.m4
++++ db-6.0.35/dist/aclocal/sql.m4
+@@ -96,7 +96,7 @@
+ if test "$db_cv_build_cryptography" = "yes"; then
+ CPPFLAGS="$CPPFLAGS -DSQLITE_HAS_CODEC=1"
+ fi
+-(cd sql && eval "\$SHELL ../$sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline " && cat build_config.h >> config.h) || exit 1
++(cd sql && eval "\$SHELL $sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline " && cat build_config.h >> config.h) || exit 1
+
+ # Configure JDBC if --enable-jdbc
+ if test "$db_cv_jdbc" != "no"; then
diff --git a/sys-libs/db/files/db-6.1.19-sqlite-configure-path.patch b/sys-libs/db/files/db-6.1.19-sqlite-configure-path.patch
new file mode 100644
index 000000000000..25854c53e160
--- /dev/null
+++ b/sys-libs/db/files/db-6.1.19-sqlite-configure-path.patch
@@ -0,0 +1,10 @@
+--- db-6.1.19/dist/aclocal/sql.m4
++++ db-6.1.19/dist/aclocal/sql.m4
+@@ -96,6 +96,6 @@
+ if test "$db_cv_build_cryptography" = "yes"; then
+ CPPFLAGS="$CPPFLAGS -DSQLITE_HAS_CODEC=1"
+ fi
+-(cd sql && eval "\$SHELL ../$sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline " && cat build_config.h >> config.h) || exit 1
++(cd sql && eval "\$SHELL $sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline " && cat build_config.h >> config.h) || exit 1
+
+ # Configure JDBC if --enable-jdbc
diff --git a/sys-libs/db/files/db-6.2-jni-check-prefix-first.patch b/sys-libs/db/files/db-6.2-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..963b01380c23
--- /dev/null
+++ b/sys-libs/db/files/db-6.2-jni-check-prefix-first.patch
@@ -0,0 +1,38 @@
+--- db-6.2.23/dist/aclocal_java/ac_jni_include_dirs.m4
++++ db-6.2.23/dist/aclocal_java/ac_jni_include_dirs.m4
+@@ -43,18 +43,23 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- if test -d "$_JTOPDIR/include"; then
+- _JINC="$_JTOPDIR/include"
+- else
+- _JINC="$_JTOPDIR/Headers"
+- fi;;
+- *) _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ if test -d "$_JTOPDIR/include"; then
++ _JINC="$_JTOPDIR/include"
++ else
++ _JINC="$_JTOPDIR/Headers"
++ fi;;
++ *) _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/files/db-6.2.32-jni-check-prefix-first.patch b/sys-libs/db/files/db-6.2.32-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..0a320d7f9336
--- /dev/null
+++ b/sys-libs/db/files/db-6.2.32-jni-check-prefix-first.patch
@@ -0,0 +1,44 @@
+--- db-6.2.32/dist/aclocal_java/ac_jni_include_dirs.m4
++++ db-6.2.32/dist/aclocal_java/ac_jni_include_dirs.m4
+@@ -43,21 +43,26 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- if test -d "$_JTOPDIR/include"; then
+- _JINC="$_JTOPDIR/include"
+- else
+- _JINC="`$_JTOPDIR/Commands/java_home`/include"
+- fi;;
+- *) if test ! -r "$_JTOPDIR/include/jni.h"; then
+- _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- fi
+- _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ if test -d "$_JTOPDIR/include"; then
++ _JINC="$_JTOPDIR/include"
++ else
++ _JINC="`$_JTOPDIR/Commands/java_home`/include"
++ fi;;
++ *) if test ! -r "$_JTOPDIR/include/jni.h"; then
++ _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ fi
++ _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.