Andrew Randrianasulu <randrianasulu%gmail.com@localhost> writes:
> I have bunch of those line is Makefile:
>
> LIBS += `pkg-config --libs OpenEXR 2>/dev/null`
>
> this seems to work on Linux and when I directly run configure/gmake for
> package I am trying to create in pkgsrc-wip [cingg-netbsd]
Generally, one adds the buildlink3 and USE_TOOLS for pkg-config. You
should be able to find examples.
yes, I grepped around in pkgsrc tree and at least some patches show packages used similar scheme for detecting depends ....
Does it matter that I run make (on NetBSD) directly from directory with my package files and not from top of pkgsrc? Also, I run it as root.
> Not sure why this happen, I tried to add pkg-config to USE_TOOLS variable
> in Makefile (no change), and checked that configure.ac sees pkg-config. May
> be PKG_CONFIG_PATH is not set when building inside pkgsrc system ?
It is, but it is only going to find things in the buildlink tree. This
is a feature to prevent package builds from finding anything which is
not declared as a dependency.
Look at work/.buildlink*. Read the pgksrc guide (pkgsrc/doc/pkgsrc.txt)
about the buildlink3 scheme.
pkgsrc in general works very well with autoconf-using programs.
Yes, but for some reason for exactly those lines I added some time ago it does not. May be it assumes configure script calls autoconf machinery for this, and not use pkg-config directly?
I wonder if pkg-config from work/.tools confused by 2>/dev/null redirection?
It also does not print anything if I call it from outside with say -h option ...
in contrast with my symlink.
So, while I think adding pkg-config to USE_TOOLS variable in my package actually good idea (will do this) - I do not know how to debug this