[93183] trunk/dports/lang/apple-gcc42

royliu at macports.org royliu at macports.org
Wed May 16 22:57:31 PDT 2012


Revision: 93183
          https://trac.macports.org/changeset/93183
Author:   royliu at macports.org
Date:     2012-05-16 22:57:28 -0700 (Wed, 16 May 2012)
Log Message:
-----------
apple-gcc42: fix include path search behavior when the "-isysroot" option is given

Modified Paths:
--------------
    trunk/dports/lang/apple-gcc42/Portfile
    trunk/dports/lang/apple-gcc42/files/incpath.patch

Modified: trunk/dports/lang/apple-gcc42/Portfile
===================================================================
--- trunk/dports/lang/apple-gcc42/Portfile	2012-05-17 03:58:42 UTC (rev 93182)
+++ trunk/dports/lang/apple-gcc42/Portfile	2012-05-17 05:57:28 UTC (rev 93183)
@@ -6,7 +6,7 @@
 name			apple-gcc42
 version			5666.3
 set gcc_version		4.2.1
-revision		4
+revision		5
 categories		lang
 platforms		darwin
 license         GPL-2

Modified: trunk/dports/lang/apple-gcc42/files/incpath.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/incpath.patch	2012-05-17 03:58:42 UTC (rev 93182)
+++ trunk/dports/lang/apple-gcc42/files/incpath.patch	2012-05-17 05:57:28 UTC (rev 93183)
@@ -1,14 +1,31 @@
 --- gcc/c-incpath.c.orig	2011-11-06 23:49:39.000000000 -0500
 +++ gcc/c-incpath.c	2011-11-06 23:49:39.000000000 -0500
-@@ -164,10 +164,7 @@
+@@ -164,10 +164,25 @@
  	  char *str;
  
  	  /* Should this directory start with the sysroot?  */
 -	  if (sysroot && p->add_sysroot)
 -	    str = concat (sysroot, p->fname, NULL);
 -	  else
--	    str = update_path (p->fname, p->component);
-+	  str = update_path (p->fname, p->component);
++	  if (sysroot && p->add_sysroot) {
++        /* Don't append the MacPorts prefix to the sysroot, and instead use
++           "/usr/include". This is because the "-isysroot" option almost always
++           refers to an Mac OS X SDK which is structured that way. */
++        const char *fname;
++
++        #ifdef PREFIX_INCLUDE_DIR
++        if (!strcmp(p->fname, PREFIX_INCLUDE_DIR)) {
++          fname = "/usr/include";
++        } else {
++        #endif
++          fname = p->fname;
++        #ifdef PREFIX_INCLUDE_DIR
++        }
++        #endif
++	    str = concat (sysroot, fname, NULL);
++      } else {
+ 	    str = update_path (p->fname, p->component);
++      }
  
  	  if (p->multilib && imultilib)
  	    str = concat (str, dir_separator_str, imultilib, NULL);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120516/1b0e9480/attachment.html>


More information about the macports-changes mailing list