Subject: devel/libiberty or how to add extra libraries?
To: None <tech-pkg@netbsd.org>
From: Georg Schwarz <georg.schwarz@freenet.de>
List: tech-pkg
Date: 10/23/2005 14:31:21
The is a devel/libiberty/application.mk which has:

# currently requires GCC for "-include"
.if empty(PKGSRC_COMPILER:Mgcc)
PKG_FAIL_REASON+=       "libiberty compatibility build requires gcc
compiler"
.endif

.include "../../devel/libiberty/buildlink3.mk"

CPPFLAGS+=              -include libiberty.h
LIBS+=                  -liberty


it is used for expample with archivers/rzip/Makefile.
Now IRIX 5 does not come with asprintf either, so it also needs
libiberty there, just like Interix.
However, I do not want to be restricted to use gcc just because auf the
-include syntax.
What would be a better solution?
For rzip the following code in devel/libiberty/application.mk works:

.include "../../devel/libiberty/buildlink3.mk"
.if !empty(PKGSRC_COMPILER:Mgcc)
CPPFLAGS+=              -include libiberty.h
.endif
LIBS+=                  -liberty

at least for rzip on IRIX 5.3 it seems to do nicely without the header
file. This would make things at least a tiny bit more compatible.

More generally, in the inclusion of a respective application.mk on a per
OS basis a viable way to deal with non-existing but required functions?
I am thinking of snprintf and vsnprintf where libnbcompat provides the
alternatives. These functions are needed by many packages but are
unavailable on IRIX 5.3. So far I am adding these manually, but this is
of course no long-term solution.

-- 
Georg Schwarz    http://home.pages.de/~schwarz/
 georg.schwarz@freenet.de  +49 178 8545053