Subject: Re: How to best add libnbcompat?
To: Georg Schwarz <geos@epost.de>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 08/29/2004 16:45:47
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?  

Using libnbcompat is more than simply just linking in the library.
You have to also convert the sources to use the <nbcompat.h> header.
There's no good way to do this automatically, yet, although I have
some ideas that I plan on implementing after the next pkgsrc branch
is cut.

> BTW, pkgsrc/comms/pilot-link uses strptime(), which does not exist on
> IRIX 5.3. Judging from http://xinvest.sunsite.dk/ChangeLog.xinvest IRIX
> 6 does not suffer from that problem. Maybe other OSes do, though.
> Therefore it might be a good idea to have that fuction in some
> compatibility lib for pkgsrc. There seem to be some free implementations
> available.

I will consider adding this in the future, but for now, libnbcompat's
purpose is primarily to aid in bootstrapping pkgsrc, which means it
only has just enough code to help build the bootstrap utilities on
various non-NetBSD platforms.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>