Subject: Re: How to best add libnbcompat?
To: Georg Schwarz <geos@epost.de>
From: Ben Collver <ben@NetBSD.org>
List: tech-pkg
Date: 08/29/2004 07:06:37
On Sun, Aug 29, 2004 at 03:06:44PM +0200, Georg Schwarz wrote:
> pkgsrc/comms/pilot-link (as an example) requires snprintf, which is not
> available on IRIX 5.3, but which is provided by libnbcompat.
> Linking in
> pkgsrc/comms/pilot-link/work/pilot-link-0.11.7/src/pilot-datebook fails:
> ld:
> Unresolved:
> snprintf
> 
> Manually adding -L/usr/local/pkg/lib -lnbcompat to the link command
> solves this problem.
> What would be the best way to have that added automatically?  

The first match that caught my eye in pkgsrc is archivers/pax/Makefile.
Something like:

.include "../../mk/bsd.prefs.mk"
.if defined(LIBNBCOMPAT_STYLE) && (${LIBNBCOMPAT_STYLE} == "inplace")
.  include "../../pkgtools/libnbcompat/inplace.mk"
.else
.  include "../../pkgtools/libnbcompat/buildlink3.mk"
.endif

The buildlink3.mk will add -lnbcompat to LIBS, and since GNU_CONFIGURE
is defined in Makefile.common, there will be an automatic
CONFIGURE_ENV+=	LIBS="${LIBS}".

I did not test any of this.

Ben