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

jeremyhu at macports.org jeremyhu at macports.org
Thu Jul 7 23:54:54 PDT 2011


Revision: 80265
          http://trac.macports.org/changeset/80265
Author:   jeremyhu at macports.org
Date:     2011-07-07 23:54:53 -0700 (Thu, 07 Jul 2011)
Log Message:
-----------
apple-gcc42: Use our preferred compiler to build our stage1 compiler

Modified Paths:
--------------
    trunk/dports/lang/apple-gcc42/Portfile

Added Paths:
-----------
    trunk/dports/lang/apple-gcc42/files/stage1-cc.patch

Modified: trunk/dports/lang/apple-gcc42/Portfile
===================================================================
--- trunk/dports/lang/apple-gcc42/Portfile	2011-07-08 04:34:06 UTC (rev 80264)
+++ trunk/dports/lang/apple-gcc42/Portfile	2011-07-08 06:54:53 UTC (rev 80265)
@@ -35,6 +35,7 @@
 # no-rm-system.patch       : Comment out a rogue rm /usr/... in the build script
 # prefix.patch             : Fix hardcoded instances of /usr
 # suffix.patch             : Make binaries end in -apple-4.2
+# stage1-cc.patch          : Use $CC for our stage1 compiler
 # makeinfo.patch           : Fix version detection for makeinfo in configure scripts
 # werror-*.patch           : Fix compilation errors when building for x86_64
 patchfiles \
@@ -43,6 +44,7 @@
 	prefix.patch \
 	suffix.patch \
 	makeinfo.patch \
+	stage1-cc.patch \
 	werror-c-incpath.patch \
 	werror-local-alloc.patch
 
@@ -53,10 +55,6 @@
 	# arch returns i386 even when we want x86_64
 	reinplace "/^BUILD=/ s:arch:echo ${build_arch}:" ${worksrcpath}/build_gcc
 
-	# Use our CC
-	# TODO: This seems insufficient as "gcc" is still being used
-	reinplace "/^unset CC/ s:^:#:" ${worksrcpath}/build_gcc
-
 	# ppc not tested, but it should hopefully work...
 	if {${build_arch} == "ppc"} {
 		reinplace "/^PPC_SYSROOT=/ s:=.*$:=/:" ${worksrcpath}/build_gcc
@@ -67,18 +65,24 @@
 	} elseif {[file exists ${developer_dir}/SDKs/MacOSX10.3.9.sdk]} {
 		reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.3.9.sdk:" ${worksrcpath}/build_gcc
 	}
+
+	# Disable -Werror for our bootstrap gcc
+	if {${configure.compiler} == "clang" ||
+	    ${configure.compiler} == "macports-clang"} {
+		reinplace "s:--enable-werror : :" ${worksrcpath}/build_gcc
+	}
 }
 
 # TODO: Use MacPorts dependencies
 build.env \
-	CC="${configure.cc}" \
-        LIBRARY_PATH="/usr/lib" \
-        CPATH="/usr/include" \
+	LIBRARY_PATH="/usr/lib" \
+	CPATH="/usr/include" \
 	PATH="/bin:/usr/bin:/sbin:/usr/sbin"
 
 #	MAKEINFO=${prefix}/bin/makeinfo
 
 build.args-append \
+	CC="${configure.cc} -std=gnu89" \
 	PREFIX="${prefix}" \
 	SRCROOT="${srcroot}" \
 	OBJROOT="${objroot}" \

Added: trunk/dports/lang/apple-gcc42/files/stage1-cc.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/stage1-cc.patch	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/stage1-cc.patch	2011-07-08 06:54:53 UTC (rev 80265)
@@ -0,0 +1,22 @@
+--- build_gcc.orig	2011-07-07 23:35:07.000000000 -0700
++++ build_gcc	2011-07-07 23:36:38.000000000 -0700
+@@ -153,9 +153,6 @@ if echo $TARGETS | grep arm; then
+ fi
+ # APPLE LOCAL end ARM
+ 
+-# If the user has CC set in their environment unset it now
+-unset CC
+-
+ ########################################
+ # Run the build.
+ 
+@@ -237,6 +234,9 @@ ln -f $D/gcc-apple-$MAJ_VERS $D/gcc || e
+ ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
+ PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH
+ 
++# Set CC to our bootstrap CC
++export CC=$D/gcc
++
+ # The cross-tools' build process expects to find certain programs
+ # under names like 'i386-apple-darwin$DARWIN_VERS-ar'; so make them.
+ # Annoyingly, ranlib changes behaviour depending on what you call it,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110707/e9f423d7/attachment-0001.html>


More information about the macports-changes mailing list