<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The -I/opt/local/include is going into the compiler arguments too early which leads to at least two problems:<div class="">1) finds includes for the system version of certain libraries which may differ from the version bundled with MythTV.  For example, MythTV has a customized version of FFmpeg but the early include finds the general MacPorts version.  The MacPorts version lacks Myth’s customizations and therefore lacks certain symbols.  Build fails.</div><div class="">2) finds the previous installed version of MythTV; ie building 0.27.5 finds previously installed 0.27.4.  Changed functions lead to the wrong symbols being included.  Build fails.</div><div class=""><br class=""></div><div class="">These problems don’t occur on Linux because pkg-config never returns (the system default) ‘-I/usr/include’, just an empty string.  When ‘-I/opt/local/include’ is my system default, it would be nice if it were treated the same way.</div><div class=""><br class=""></div><div class="">Craig</div><div class="">(Yes, I know that MythTV’s configure is basically broken.  It is a huge hairy beast (based on FFmpeg’s configure) and it works fine for all the Linux folk.  I can’t get much interest in a “Mac” problem.  Even though they are really relying on a quirk of pkg-config.)<br class=""><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 12, 2016, at 9:24 AM, Dan Kegel <<a href="mailto:dank@kegel.com" class="">dank@kegel.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">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.</p>
<div class="gmail_quote">On Jan 12, 2016 6:04 AM, "Craig Treleaven" <<a href="mailto:ctreleaven@cogeco.ca" class="">ctreleaven@cogeco.ca</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br class="">
<br class="">
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.<br class="">
<br class="">
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.<br class="">
<br class="">
Eg, with MacPorts:<br class="">
$ pkg-config --cflags x264<br class="">
-I/opt/local/include                     ## want to make this disappear since it is the ‘system include'<br class="">
<br class="">
<br class="">
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’.)<br class="">
<br class="">
Thanks,<br class="">
<br class="">
Craig<br class="">
_______________________________________________<br class="">
pkg-config mailing list<br class="">
<a href="mailto:pkg-config@lists.freedesktop.org" class="">pkg-config@lists.freedesktop.org</a><br class="">
<a href="http://lists.freedesktop.org/mailman/listinfo/pkg-config" rel="noreferrer" target="_blank" class="">http://lists.freedesktop.org/mailman/listinfo/pkg-config</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></body></html>