@TheBlueMatt This is from the irc.freenode.net#netbsd channel regarding your question about auto-detecting the "/usr/pkg/" directory...
-----BEGIN-----
[22:07:50] <Riastradh> Randolf: Hmm... Re your bitcoin pull request: software should not look in /usr/pkg by default. Anything built by pkgsrc will automatically add -I/usr/pkg/include -- or -I${PREFIX}/include, when PREFIX may not actually be /usr/pkg.
[22:08:39] <Riastradh> Part of the point of /usr/pkg is that nothing else uses it by default, unlike /usr/local which has all sorts of variegated cultural associations and random behaviour.
-----END-----
So, perhaps it would be better to not attempt to automatically detect NetBSD's pkgsrc/pkgin systems, but instead either leave the the ./configure parameters as documented with CPPFLAGS, etc., or provide an alternative such as a special parameter called PKG_PATH="/usr/pkg" that helps to make it all work automatically behind-the-scenes (assuming this is even possible).