'system cflags' with other prefix

Dan Kegel dank at kegel.com
Tue Jan 12 06:24:34 PST 2016


It's behaving as intended.  Why are the macports include files causing
problems?  If you don't want them, don't use macports' pkg-config, it's
giving that -I flag for good reason.
On Jan 12, 2016 6:04 AM, "Craig Treleaven" <ctreleaven at cogeco.ca> wrote:

> I’m trying to port a Linux-based application to OS X via the MacPorts
> packaging system and having buiild failures due to includes pointing to
> old/other headers installed in /opt/local/include.  ‘/opt/local’ is the
> default prefix for everything MacPorts installs.
>
> As I understand it, under Linux, 'pig-config —cflags’ returns an empty
> string when a header is installed in /usr/include.  The port I’m working
> on, MythTV 0.28-pre, uses pkg-config to check for several dependencies.
> Under MacPorts, I end up with '-I/opt/local/include’ early in the compiler
> arguments and thus it picks up old or unintended versions of headers.
> Under Linux, no problem.
>
> Is there some way I can coerce pkg-config to treat /opt/local/include like
> it does /usr/include?  I’ve looked at the man page for pkg-config and tried
> using some of the environment variables but without success.
>
> Eg, with MacPorts:
> $ pkg-config --cflags x264
> -I/opt/local/include                     ## want to make this disappear
> since it is the ‘system include'
>
>
> Is there a magic recipe?  (Changing the build system would be…difficult!
> I think I have a workaround with a simple script wrapper for pkg-config
> that uses sed to strip out '-I/opt/local/include’.)
>
> Thanks,
>
> Craig
> _______________________________________________
> pkg-config mailing list
> pkg-config at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pkg-config
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pkg-config/attachments/20160112/0bbb2c11/attachment.html>


More information about the pkg-config mailing list