Subject: BUILDLINK_LDADD linker flags in db*/
To: None <>
From: grant beattie <>
List: tech-pkg
Date: 07/12/2005 15:31:13
I've noticed that packages which need a bdb implementation don't
know where to look for the library provided by mk/,
because BUILDLINK_LDADD in db*/ only has -ldb, -ldb3,
etc., but no linker flags.

this causes issues for packages which use these files,
eg. mail/exim3 which uses ${BDB_LIBS}:

.include "../../mk/"

the value of ${BDB_LIBS} is "-ldb3" in this case, so the executable is
unable to find libdb3 at runtime. mail/exim4 has a conditional dance
which adds the right -R argument, but this doesn't seem the best way
of handling this, the db*/ should provide everything
needed to link against the library.

the following patch addresses this.. any objections to committing it?
with this patch, any pkg which .include's and uses
${BDB_LIBS} will build correctly without any additional logic.

I'm unsure whether there are other packages affected by the same
issue, but given the nature of it, I suspect there are.


Index: db/
RCS file: /cvsroot/pkgsrc/databases/db/,v
retrieving revision 1.19
diff -u -r1.19
--- db/	15 Nov 2004 17:54:49 -0000	1.19
+++ db/	12 Jul 2005 05:26:08 -0000
@@ -17,7 +17,7 @@
 BUILDLINK_RECOMMENDED.db2+=	db>=2.7.7nb2
 BUILDLINK_PKGSRCDIR.db2?=	../../databases/db
 BUILDLINK_INCDIRS.db2?=		include/db2
-BUILDLINK_LDADD.db2=		-ldb2
 .  if defined(USE_DB185) && !empty(USE_DB185:M[yY][eE][sS])
Index: db3/
RCS file: /cvsroot/pkgsrc/databases/db3/,v
retrieving revision 1.16
diff -u -r1.16
--- db3/	15 Nov 2004 17:54:49 -0000	1.16
+++ db3/	12 Jul 2005 05:26:08 -0000
@@ -17,7 +17,7 @@
 BUILDLINK_RECOMMENDED.db3+=	db3>=3.11.2nb3
 BUILDLINK_PKGSRCDIR.db3?=	../../databases/db3
 BUILDLINK_INCDIRS.db3?=		include/db3
-BUILDLINK_LDADD.db3=		-ldb3
 .  if defined(USE_DB185) && !empty(USE_DB185:M[yY][eE][sS])
Index: db4/
RCS file: /cvsroot/pkgsrc/databases/db4/,v
retrieving revision 1.23
diff -u -r1.23
--- db4/	17 Nov 2004 18:47:19 -0000	1.23
+++ db4/	12 Jul 2005 05:26:08 -0000
@@ -17,7 +17,7 @@
 BUILDLINK_RECOMMENDED.db4+=	db4>=4.2.52nb7
 BUILDLINK_PKGSRCDIR.db4?=	../../databases/db4
 BUILDLINK_INCDIRS.db4?=		include/db4
-BUILDLINK_LDADD.db4=		-ldb4
 .  if defined(USE_DB185) && !empty(USE_DB185:M[yY][eE][sS])