'system cflags' with other prefix

Dan Kegel dank at kegel.com
Tue Jan 12 08:04:01 PST 2016

This is the kind of thing I run into all the time.  It's what makes
life as a build engineer fun.

Does MythTV come with its own .pc files for its bundled libraries?  If
so, you could
point even macports' pkg-config at them with PKG_CONFIG_PATH.
That's the best way.

You could write a wrapper script called pkg-config and put it ahead of
the real pkg-config on the PATH,
and have the wrapper strip out the -I.
But then you're cheating and using system .pc files for libraries
bundled in MythTV.

Alternately, you can build your own copy of pkg-config (I do this!); the easiest
one to build is the clone pkgconf,
Then you can configure it to your hearts' content, in particular, you
can tell it to never search /usr/local.
- Dan

On Tue, Jan 12, 2016 at 7:49 AM, Craig Treleaven <ctreleaven at cogeco.ca> wrote:
>> On Jan 12, 2016, at 10:41 AM, Tollef Fog Heen <tfheen at err.no> wrote:
>> ]] Craig Treleaven
>>> Eg, with MacPorts:
>>> $ pkg-config --cflags x264
>>> -I/opt/local/include                     ## want to make this disappear since it is the ‘system include'
>> If /opt/local/include is already on the compiler search path, pkg-config
>> should be compiled with that knowledge, at which point it'll strip it
>> out, like /usr/include on Linux.
> I think pkg-config was built the way you suggest.  Following are the args supplied to pkg-config’s configure through the MacPorts build:
> configure.args      --disable-silent-rules \
>                     --disable-host-tool \
>                     --with-pc-path=${prefix}/lib/pkgconfig:${prefix}/share/pkgconfig \
>                     --with-internal-glib \
>                     --docdir=${docdir}
> https://trac.macports.org/browser/trunk/dports/devel/pkgconfig/Portfile#L34
> ${prefix} is /opt/local for a default install.
> Should we be using some other configure arguments?
> Craig
> _______________________________________________
> pkg-config mailing list
> pkg-config at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pkg-config

More information about the pkg-config mailing list