Subject: Re: BUILDLINK_LDADD linker flags in db*/
To: grant beattie <>
From: Johnny Lam <>
List: tech-pkg
Date: 07/13/2005 11:50:45
grant beattie wrote:
> 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.

No, if you want to do this, then provide new variables BDB_CPPFLAGS and 
BDB_LDFLAGS in that has the appropriate -D, -I, -L and 
-R options.  Don't add to BUILDLINK_LDADD.* in this way because those 
variables should only contain library options.

However, I don't think we should even be providing those variables.  Why 
do mail/exim* even need those variables?  Why aren't they just using 
${CPPFLAGS} and ${LDFLAGS}, which provide all of the compiler  and 
linker options that they'll need?  The "dance" that's done in those 
packages strikes me as being completely unnecessary, especially since 
the exim packages don't use configure scripts -- the entire configure 
step consists of doing a sed replacement of some makefile in the 


	-- Johnny Lam <>