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

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


Revision: 80247
          http://trac.macports.org/changeset/80247
Author:   jeremyhu at macports.org
Date:     2011-07-07 12:54:18 -0700 (Thu, 07 Jul 2011)
Log Message:
-----------
apple-gcc42: Updated to build the Apple gcc driver-driver (support for -arch XXXX), C++, and gcc_select

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

Added Paths:
-----------
    trunk/dports/lang/apple-gcc42/files/
    trunk/dports/lang/apple-gcc42/files/apple-gcc42
    trunk/dports/lang/apple-gcc42/files/makeinfo.patch
    trunk/dports/lang/apple-gcc42/files/no-rm-system.patch
    trunk/dports/lang/apple-gcc42/files/prefix.patch
    trunk/dports/lang/apple-gcc42/files/suffix.patch
    trunk/dports/lang/apple-gcc42/files/system-libstdc++.patch
    trunk/dports/lang/apple-gcc42/files/werror-c-incpath.patch
    trunk/dports/lang/apple-gcc42/files/werror-local-alloc.patch

Modified: trunk/dports/lang/apple-gcc42/Portfile
===================================================================
--- trunk/dports/lang/apple-gcc42/Portfile	2011-07-07 17:17:25 UTC (rev 80246)
+++ trunk/dports/lang/apple-gcc42/Portfile	2011-07-07 19:54:18 UTC (rev 80247)
@@ -1,15 +1,17 @@
 # $Id$
 
 PortSystem 1.0
+PortGroup select 1.0
 
 name			apple-gcc42
 version			5666.3
+revision		1
 categories		lang
 platforms		darwin
-maintainers		nomaintainer
+maintainers		jeremyhu openmaintainer
 description		Apple's version of gcc 4.2
 long_description	Apple's version of the GNU compiler collection, \
-			version 4.2. Supports C and Objective-C.
+			version 4.2. Supports C, Objective-C, anc C++
 
 homepage		http://opensource.apple.com/
 master_sites		http://opensource.apple.com/tarballs/gcc/
@@ -18,47 +20,100 @@
                         sha1    292a0cfcfdc061cb083658efd9a3812a120a1f50 \
                         rmd160  a01d000f89c0e89dd0079dcd202bba7629ba78dc
 
-post-extract { file mkdir ${workpath}/build }
+depends_run             port:gcc_select
 
-set nprefix ${prefix}/lib/${name}
+use_configure no
 
-# try to avoid non-Apple programs at all costs (rather volatile build)
-configure.dir		${workpath}/build
-configure.cmd		${worksrcpath}/configure
-configure.pre_args	--prefix=${nprefix}
-configure.ccache	no
-configure.distcc	no
-# C++ support breaks the build
-configure.args		--enable-languages=c,objc \
-			--program-suffix=-apple-4.2
-configure.cflags
-configure.ldflags
-configure.cppflags
-configure.cc_archflags
-configure.cxx_archflags
-configure.objc_archflags
-configure.ld_archflags
-configure.env		PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+select.group    gcc
+select.file     ${filespath}/${name}
 
-build.dir		${configure.dir}
+set srcroot ${worksrcpath}
+set objroot ${workpath}/objroot
+set symroot ${workpath}/symroot
 
-destroot.dir		${build.dir}
+# system-libstdc++.patch   : Adjust build system to use libstdc++ from / since we don't have it in MacPorts
+# 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
+# makeinfo.patch           : Fix version detection for makeinfo in configure scripts
+# werror-*.patch           : Fix compilation errors when building for x86_64
+patchfiles \
+	system-libstdc++.patch \
+	no-rm-system.patch \
+	prefix.patch \
+	suffix.patch \
+	makeinfo.patch \
+	werror-c-incpath.patch \
+	werror-local-alloc.patch
 
-# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
-# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
-# -std=gnu89 : for building with compilers that default to c99 (clang)
-# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
-#                       exposed in libc headers for fortified string functions.
-#                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
-#                       because STAGE1_CFLAGS is used with xgcc for libgcc
-build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
+post-patch {
+	# Install documentation in a MacPorts location
+	reinplace "/^HTMLDIR=/ s:=.*$:=\"${prefix}/share/doc/${name}/html\":" ${worksrcpath}/build_gcc
 
-post-destroot {
-	file delete -force \
-		${destroot}${nprefix}/man ${destroot}${nprefix}/info
-	system "cd ${destroot}${prefix}/bin && ln -sf ${nprefix}/bin/gcc-apple-4.2 && ln -sf ${nprefix}/bin/cpp-apple-4.2"
+	# 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
+	} elseif {[file exists ${developer_dir}/SDKs/MacOSX10.5.sdk]} {
+		reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.5.sdk:" ${worksrcpath}/build_gcc
+	} elseif {[file exists ${developer_dir}/SDKs/MacOSX10.4u.sdk]} {
+		reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.4u.sdk:" ${worksrcpath}/build_gcc
+	} elseif {[file exists ${developer_dir}/SDKs/MacOSX10.3.9.sdk]} {
+		reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.3.9.sdk:" ${worksrcpath}/build_gcc
+	}
 }
 
+# TODO: Use MacPorts dependencies
+build.env \
+	CC="${configure.cc}" \
+        LIBRARY_PATH="/usr/lib" \
+        CPATH="/usr/include" \
+	PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+
+#	MAKEINFO=${prefix}/bin/makeinfo
+
+build.args-append \
+	PREFIX="${prefix}" \
+	SRCROOT="${srcroot}" \
+	OBJROOT="${objroot}" \
+	SYMROOT="${symroot}" \
+	DSTROOT="${destroot}" \
+	RC_NONARCH_CFLAGS="-pipe -std=gnu89" \
+	RC_OS="macos"
+
+if {[variant_isset universal]} {
+	build.args-append \
+		RC_ARCHS="${universal_archs}"
+} else {
+	build.args-append \
+		RC_ARCHS="${build_arch}"
+}
+
+set build_targets {i386}
+
+if {[file exists ${developer_dir}/SDKs/MacOSX10.3.9.sdk] ||
+    [file exists ${developer_dir}/SDKs/MacOSX10.4u.sdk] ||
+    [file exists ${developer_dir}/SDKs/MacOSX10.5.sdk] ||
+    ${build_arch} == "ppc"} {
+	lappend build_targets ppc
+}
+
+# TODO: arm?
+
+build.args-append \
+	TARGETS="${build_targets}"
+
+# Yes, use "install" ... the build system does make/install in one go
+# TODO: split the build_gcc script into two to better match MacPorts
+build.target install
+destroot {}
+
 livecheck.type		regex
 livecheck.url		[lindex ${master_sites} 0]
 livecheck.regex		gcc-(\\d+(?:\\.\\d+)*)\\.tar

Added: trunk/dports/lang/apple-gcc42/files/apple-gcc42
===================================================================
--- trunk/dports/lang/apple-gcc42/files/apple-gcc42	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/apple-gcc42	2011-07-07 19:54:18 UTC (rev 80247)
@@ -0,0 +1,5 @@
+bin/gcc-apple-4.2
+bin/cpp-apple-4.2
+bin/c++-apple-4.2
+bin/g++-apple-4.2
+bin/gcov-apple-4.2

Added: trunk/dports/lang/apple-gcc42/files/makeinfo.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/makeinfo.patch	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/makeinfo.patch	2011-07-07 19:54:18 UTC (rev 80247)
@@ -0,0 +1,48 @@
+diff -Naurp gcc/configure.ac gcc/configure.ac
+--- gcc/configure.ac	2010-10-14 13:27:54.000000000 -0700
++++ gcc/configure.ac	2011-07-06 20:51:56.000000000 -0700
+@@ -882,7 +882,7 @@ MISSING="${CONFIG_SHELL-/bin/sh} $srcdir
+ # that we can use it.
+ gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
+   [GNU texinfo.* \([0-9][0-9.]*\)],
+-  [4.[4-9]*])
++  [4.[4-9]*|4.[1-9][0-9]*])
+ if test $gcc_cv_prog_makeinfo_modern = no; then
+   MAKEINFO="$MISSING makeinfo"
+   AC_MSG_WARN([
+diff -Naurp gcc/configure gcc/configure
+--- gcc/configure	2010-10-14 13:27:54.000000000 -0700
++++ gcc/configure	2011-07-06 20:51:56.000000000 -0700
+@@ -7807,7 +7807,7 @@ else
+   echo "configure:7807: version of makeinfo is $ac_prog_version" >&5
+   case $ac_prog_version in
+     '')     gcc_cv_prog_makeinfo_modern=no;;
+-    4.[4-9]*)
++    4.[4-9]*|4.[1-9][0-9]*)
+             gcc_cv_prog_makeinfo_modern=yes;;
+     *)      gcc_cv_prog_makeinfo_modern=no;;
+   esac
+diff -Naurp libgomp/configure.ac libgomp/configure.ac
+--- libgomp/configure.ac	2010-10-14 13:24:11.000000000 -0700
++++ libgomp/configure.ac	2011-07-06 20:52:02.000000000 -0700
+@@ -135,7 +135,7 @@ AC_PROG_INSTALL
+ # that we can use it.
+ ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
+                    [GNU texinfo.* \([0-9][0-9.]*\)],
+-                   [4.[4-9]*])
++                   [4.[4-9]*|4.[1-9][0-9]*])
+ AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes")
+ 
+ 
+diff -Naurp libgomp/configure libgomp/configure
+--- libgomp/configure	2010-10-14 13:24:11.000000000 -0700
++++ libgomp/configure	2011-07-06 20:52:02.000000000 -0700
+@@ -3527,7 +3527,7 @@ else
+ 
+                     case $ac_prog_version in
+                        '')  gcc_cv_prog_makeinfo_modern=no;;
+-                       4.[4-9]*)  gcc_cv_prog_makeinfo_modern=yes;;
++                       4.[4-9]*|4.[1-9][0-9]*)  gcc_cv_prog_makeinfo_modern=yes;;
+                        *)   gcc_cv_prog_makeinfo_modern=no;;
+                      esac
+                                                                                                                                                                                if test $gcc_cv_prog_makeinfo_modern = no; then

Added: trunk/dports/lang/apple-gcc42/files/no-rm-system.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/no-rm-system.patch	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/no-rm-system.patch	2011-07-07 19:54:18 UTC (rev 80247)
@@ -0,0 +1,11 @@
+--- build_gcc.orig	2011-07-06 18:19:15.000000000 -0700
++++ build_gcc	2011-07-06 18:20:56.000000000 -0700
+@@ -170,7 +170,7 @@ rm -rf $SRC_DIR/tcl $SRC_DIR/expect $SRC
+ # Also remove libstdc++ since it is built from a separate project.
+ # rm -rf $SRC_DIR/libstdc++-v3 || exit 1
+ # Clean out old specs files
+-rm -f /usr/lib/gcc/*/4.0.0/specs
++#rm -f /usr/lib/gcc/*/4.0.0/specs
+ 
+ # These are the configure and build flags that are used.
+ CONFIGFLAGS="--disable-checking --enable-werror \

Added: trunk/dports/lang/apple-gcc42/files/prefix.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/prefix.patch	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/prefix.patch	2011-07-07 19:54:18 UTC (rev 80247)
@@ -0,0 +1,32 @@
+--- build_gcc.orig	2011-07-06 18:21:31.000000000 -0700
++++ build_gcc	2011-07-06 18:25:00.000000000 -0700
+@@ -229,10 +229,10 @@ make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-
+   CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+ 
+ # Add the compiler we just built to the path, giving it appropriate names.
+-D=$DIR/dst-$BUILD-$BUILD/usr/bin
++D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin
+ ln -f $D/gcc-$MAJ_VERS $D/gcc || exit 1
+ ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
+-PATH=$DIR/dst-$BUILD-$BUILD/usr/bin:$PATH
++PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH
+ 
+ # The cross-tools' build process expects to find certain programs
+ # under names like 'i386-apple-darwin$DARWIN_VERS-ar'; so make them.
+@@ -313,14 +313,14 @@ for t in $CROSS_TARGETS ; do
+      CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+ 
+    # Add the compiler we just built to the path.
+-   PATH=$DIR/dst-$BUILD-$t/usr/bin:$PATH
++   PATH=$DIR/dst-$BUILD-$t$DEST_ROOT/bin:$PATH
+  fi
+ done
+ 
+ # Rearrange various libraries, for no really good reason.
+ for t in $CROSS_TARGETS ; do
+   DT=$DIR/dst-$BUILD-$t
+-  D=`echo $DT/usr/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
++  D=`echo $DT$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
+   mv $D/static/libgcc.a $D/libgcc_static.a || exit 1
+   mv $D/kext/libgcc.a $D/libcc_kext.a || exit 1
+   rm -r $D/static $D/kext || exit 1

Added: trunk/dports/lang/apple-gcc42/files/suffix.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/suffix.patch	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/suffix.patch	2011-07-07 19:54:18 UTC (rev 80247)
@@ -0,0 +1,226 @@
+--- build_gcc.orig	2011-07-07 11:07:47.000000000 -0700
++++ build_gcc	2011-07-07 11:24:41.000000000 -0700
+@@ -177,7 +177,10 @@ CONFIGFLAGS="--disable-checking --enable
+   --prefix=$DEST_ROOT \
+   --mandir=\${prefix}/share/man \
+   --enable-languages=$LANGUAGES \
+-  --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
++  --libexecdir=\${prefix}/libexec/apple-gcc42 \
++  --libdir=\${prefix}/lib/apple-gcc42 \
++  --includedir=\${prefix}/include/apple-gcc42 \
++  --program-suffix=-apple-$MAJ_VERS \
+   --with-slibdir=/usr/lib \
+   --build=$BUILD-apple-darwin$DARWIN_VERS"
+ 
+@@ -230,7 +233,7 @@ make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-
+ 
+ # Add the compiler we just built to the path, giving it appropriate names.
+ D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin
+-ln -f $D/gcc-$MAJ_VERS $D/gcc || exit 1
++ln -f $D/gcc-apple-$MAJ_VERS $D/gcc || exit 1
+ ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
+ PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH
+ 
+@@ -320,7 +323,7 @@ done
+ # Rearrange various libraries, for no really good reason.
+ for t in $CROSS_TARGETS ; do
+   DT=$DIR/dst-$BUILD-$t
+-  D=`echo $DT$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
++  D=`echo $DT$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
+   mv $D/static/libgcc.a $D/libgcc_static.a || exit 1
+   mv $D/kext/libgcc.a $D/libcc_kext.a || exit 1
+   rm -r $D/static $D/kext || exit 1
+@@ -408,13 +411,13 @@ cp -Rp $DIR/dst-$BUILD-$BUILD$DEST_ROOT/
+ rm -rf .$DEST_ROOT/share/man/man7
+ 
+ # libexec
+-cd $DIR/dst-$BUILD-$BUILD$DEST_ROOT/libexec/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS \
++cd $DIR/dst-$BUILD-$BUILD$DEST_ROOT/libexec/apple-gcc42/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS \
+   || exit 1
+ LIBEXEC_FILES=`find . -type f -print || exit 1`
+ LIBEXEC_DIRS=`find . -type d -print || exit 1`
+ cd $DEST_DIR || exit 1
+ for t in $TARGETS ; do
+-  DL=$DEST_ROOT/libexec/gcc/$t-apple-darwin$DARWIN_VERS/$VERS
++  DL=$DEST_ROOT/libexec/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS
+   for d in $LIBEXEC_DIRS ; do
+     mkdir -p .$DL/$d || exit 1
+   done
+@@ -431,7 +434,7 @@ done
+ 
+ # bin
+ # The native drivers ('native' is different in different architectures).
+-BIN_FILES=`ls $DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin | grep '^[^-]*-[0-9.]*$' \
++BIN_FILES=`ls $DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin | grep '^[^-]*-apple-[0-9.]*$' \
+   | grep -v gccbug | grep -v gcov || exit 1`
+ mkdir .$DEST_ROOT/bin
+ for f in $BIN_FILES ; do
+@@ -440,25 +443,25 @@ done
+ # gcov, which is special only because it gets built multiple times and lipo
+ # will complain if we try to add two architectures into the same output.
+ TARG0=`echo $TARGETS | cut -d ' ' -f 1`
+-lipo -output .$DEST_ROOT/bin/gcov-$MAJ_VERS -create \
++lipo -output .$DEST_ROOT/bin/gcov-apple-$MAJ_VERS -create \
+   $DIR/dst-*-$TARG0$DEST_ROOT/bin/*gcov* || exit 1
+ # The fully-named drivers, which have the same target on every host.
+ for t in $TARGETS ; do
+-  lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS -create \
++  lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-apple-$VERS -create \
+     $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS || exit 1
+-  lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-cpp-$VERS -create \
++  lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-cpp-apple-$VERS -create \
+     $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-cpp-$VERS || exit 1
+   if [ $BUILD_CXX -eq 1 ]; then
+-    lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++-$VERS -create \
++    lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++-apple-$VERS -create \
+     $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++* || exit 1
+   fi
+ done
+ 
+ # lib
+-mkdir -p .$DEST_ROOT/lib/gcc || exit 1
++mkdir -p .$DEST_ROOT/lib/apple-gcc42/gcc || exit 1
+ for t in $TARGETS ; do
+-  cp -Rp $DIR/dst-$BUILD-$t$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS \
+-    .$DEST_ROOT/lib/gcc || exit 1
++  cp -Rp $DIR/dst-$BUILD-$t$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS \
++    .$DEST_ROOT/lib/apple-gcc42/gcc || exit 1
+ done
+ 
+ # APPLE LOCAL begin native compiler support
+@@ -471,19 +474,19 @@ for t in $LIBGOMP_TARGETS ; do
+     for h in $LIBGOMP_HOSTS ; do
+ 	if [ $h = $t ] ; then
+ 	    cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/libgomp.a \
+-		.$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
++		.$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
+ 	    cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/libgomp.spec \
+-		.$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
++		.$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
+ 	    if [ $h = 'powerpc' ] ; then
+ 		cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/ppc64/libgomp.a \
+-		    .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/ || exit 1
++		    .$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/ || exit 1
+ 		cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/ppc64/libgomp.spec \
+-		    .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/ || exit 1
++		    .$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/ || exit 1
+ 	    elif [ $h = 'i686' ] ; then
+ 		cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/x86_64/libgomp.a \
+-		    .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
++		    .$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
+ 		cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/x86_64/libgomp.spec \
+-		    .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
++		    .$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
+ 	    fi
+ 	fi
+     done
+@@ -494,19 +497,19 @@ if [ $BUILD_CXX -eq 1 ]; then
+ for t in $TARGETS ; do
+   if [ "$t" == 'arm' ] ; then
+     cp -p $ARM_SYSROOT/usr/lib/libstdc++.6.dylib \
+-      .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \
++      .$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \
+       || exit 1
+   else
+     cp -p /usr/lib/libstdc++.6.dylib \
+-      .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \
++      .$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \
+       || exit 1
+   fi
+-  strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1
++  strip -x -c .$DEST_ROOT/lib/apple-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1
+ done
+ fi
+ 
+ # include
+-HEADERPATH=$DEST_ROOT/include/gcc/darwin/$MAJ_VERS
++HEADERPATH=$DEST_ROOT/include/gcc/darwin/apple-gcc42
+ mkdir -p .$HEADERPATH || exit 1
+ 
+ # Some headers are installed from more-hdrs/.  They all share
+@@ -521,9 +524,9 @@ for h in `echo *.h` ; do
+   if [ ! -f /usr/include/$h -o -L /usr/include/$h ] ; then
+     cp -R $h $DEST_DIR$HEADERPATH/$h || exit 1
+     for t in $TARGETS ; do
+-      THEADERPATH=$DEST_DIR$DEST_ROOT/lib/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include
++      THEADERPATH=$DEST_DIR$DEST_ROOT/lib/apple-gcc42/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include
+       [ -f $THEADERPATH/$h ] || \
+-        ln -s ../../../../../include/gcc/darwin/$MAJ_VERS/$h $THEADERPATH/$h || \
++        ln -s ../../../../../../include/gcc/darwin/apple-gcc42/$h $THEADERPATH/$h || \
+         exit 1
+     done
+   fi
+@@ -532,15 +535,15 @@ done
+ # Add extra man page symlinks for 'c++' and for arch-specific names.
+ MDIR=$DEST_DIR$DEST_ROOT/share/man/man1
+ if [ $BUILD_CXX -eq 1 ]; then
+-  ln -f $MDIR/g++-$MAJ_VERS.1 $MDIR/c++-$MAJ_VERS.1 || exit 1
++  ln -f $MDIR/g++-apple-$MAJ_VERS.1 $MDIR/c++-apple-$MAJ_VERS.1 || exit 1
+ fi
+ for t in $TARGETS ; do
+-  ln -f $MDIR/gcc-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-gcc-$VERS.1 \
++  ln -f $MDIR/gcc-apple-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-gcc-apple-$VERS.1 \
+       || exit 1
+-  ln -f $MDIR/cpp-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-cpp-$VERS.1 \
++  ln -f $MDIR/cpp-apple-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-cpp-apple-$VERS.1 \
+       || exit 1
+   if [ $BUILD_CXX -eq 1 ]; then
+-    ln -f $MDIR/g++-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-g++-$VERS.1 \
++    ln -f $MDIR/g++-apple-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-g++-apple-$VERS.1 \
+ 	|| exit 1
+   fi
+ done
+@@ -549,7 +552,7 @@ done
+ for h in $HOSTS ; do
+     $DIR/dst-$BUILD-$h$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS     \
+ 	$ORIG_SRC_DIR/driverdriver.c                               \
+-	-DPDN="\"-apple-darwin$DARWIN_VERS-gcc-$VERS\""                                    \
++	-DPDN="\"-apple-darwin$DARWIN_VERS-gcc-apple-$VERS\""                                    \
+ 	-DIL="\"$DEST_ROOT/bin/\"" -I  $ORIG_SRC_DIR/include                   \
+ 	-I  $ORIG_SRC_DIR/gcc -I  $ORIG_SRC_DIR/gcc/config                     \
+ 	-liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/                           \
+@@ -558,7 +561,7 @@ for h in $HOSTS ; do
+ 	-o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-gcc-$MAJ_VERS || exit 1
+     $DIR/dst-$BUILD-$h$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS     \
+ 	$ORIG_SRC_DIR/driverdriver.c                               \
+-	-DPDN="\"-apple-darwin$DARWIN_VERS-cpp-$VERS\""                                    \
++	-DPDN="\"-apple-darwin$DARWIN_VERS-cpp-apple-$VERS\""                                    \
+ 	-DIL="\"$DEST_ROOT/bin/\"" -I  $ORIG_SRC_DIR/include                   \
+ 	-I  $ORIG_SRC_DIR/gcc -I  $ORIG_SRC_DIR/gcc/config                     \
+ 	-liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/                           \
+@@ -568,7 +571,7 @@ for h in $HOSTS ; do
+     if [ $BUILD_CXX -eq 1 ]; then
+ 	$DIR/dst-$BUILD-$h$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS     \
+ 	    $ORIG_SRC_DIR/driverdriver.c                               \
+-	    -DPDN="\"-apple-darwin$DARWIN_VERS-g++-$VERS\""                                    \
++	    -DPDN="\"-apple-darwin$DARWIN_VERS-g++-apple-$VERS\""                                    \
+ 	    -DIL="\"$DEST_ROOT/bin/\"" -I  $ORIG_SRC_DIR/include                   \
+ 	    -I  $ORIG_SRC_DIR/gcc -I  $ORIG_SRC_DIR/gcc/config                     \
+ 	    -liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/                           \
+@@ -578,21 +581,21 @@ for h in $HOSTS ; do
+     fi
+ done
+ 
+-lipo -output $DEST_DIR/$DEST_ROOT/bin/gcc-$MAJ_VERS -create \
++lipo -output $DEST_DIR/$DEST_ROOT/bin/gcc-apple-$MAJ_VERS -create \
+   $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcc-$MAJ_VERS || exit 1
+ rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcc-$MAJ_VERS || exit 1
+-lipo -output $DEST_DIR/$DEST_ROOT/bin/cpp-$MAJ_VERS -create \
++lipo -output $DEST_DIR/$DEST_ROOT/bin/cpp-apple-$MAJ_VERS -create \
+   $DEST_DIR/$DEST_ROOT/bin/tmp-*-cpp-$MAJ_VERS || exit 1
+ rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-cpp-$MAJ_VERS || exit 1
+ 
+ if [ $BUILD_CXX -eq 1 ]; then
+-  lipo -output $DEST_DIR/$DEST_ROOT/bin/g++-$MAJ_VERS -create \
++  lipo -output $DEST_DIR/$DEST_ROOT/bin/g++-apple-$MAJ_VERS -create \
+        $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1
+-  ln -f $DEST_DIR/$DEST_ROOT/bin/g++-$MAJ_VERS $DEST_DIR/$DEST_ROOT/bin/c++-$MAJ_VERS || exit 1
++  ln -f $DEST_DIR/$DEST_ROOT/bin/g++-apple-$MAJ_VERS $DEST_DIR/$DEST_ROOT/bin/c++-apple-$MAJ_VERS || exit 1
+   rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1
+ 
+   # Remove extraneous stuff
+-  rm -rf $DEST_DIR/$DEST_ROOT/lib/gcc/*/*/include/c++
++  rm -rf $DEST_DIR/$DEST_ROOT/lib/apple-gcc42/gcc/*/*/include/c++
+ fi
+ 
+ 

Added: trunk/dports/lang/apple-gcc42/files/system-libstdc++.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/system-libstdc++.patch	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/system-libstdc++.patch	2011-07-07 19:54:18 UTC (rev 80247)
@@ -0,0 +1,15 @@
+--- build_gcc.orig	2011-07-06 17:54:57.000000000 -0700
++++ build_gcc	2011-07-06 17:55:55.000000000 -0700
+@@ -81,10 +81,10 @@ MAJ_VERS=`echo $VERS | sed 's/\([0-9]*\.
+ 
+ # This is the libstdc++ version to use.
+ LIBSTDCXX_VERSION=4.2.1
+-if [ ! -d "$DEST_ROOT/include/c++/$LIBSTDCXX_VERSION" ]; then
++if [ ! -d "/usr/include/c++/$LIBSTDCXX_VERSION" ]; then
+   LIBSTDCXX_VERSION=4.0.0
+ fi
+-NON_ARM_CONFIGFLAGS="--with-gxx-include-dir=\${prefix}/include/c++/$LIBSTDCXX_VERSION"
++NON_ARM_CONFIGFLAGS="--with-gxx-include-dir=/usr/include/c++/$LIBSTDCXX_VERSION"
+ 
+ # Build against the MacOSX10.5 SDK for PowerPC.
+ PPC_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk

Added: trunk/dports/lang/apple-gcc42/files/werror-c-incpath.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/werror-c-incpath.patch	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/werror-c-incpath.patch	2011-07-07 19:54:18 UTC (rev 80247)
@@ -0,0 +1,11 @@
+--- gcc/c-incpath.c.orig	2011-07-06 23:13:30.000000000 -0700
++++ gcc/c-incpath.c	2011-07-06 23:14:34.000000000 -0700
+@@ -236,7 +236,7 @@ hmap_load_header_map (const char *filepa
+ 	  /* If it is a regular file and if it is large enough to be a header-
+ 	     map, see if it really is one. */
+ 	  if (fstat (fileno (f), &f_info) == 0 && S_ISREG(f_info.st_mode)
+-	    && f_info.st_size >= sizeof(struct hmap_header_map))
++	    && f_info.st_size >= (off_t)sizeof(struct hmap_header_map))
+ 	    {
+ 	      unsigned   headermap_size = f_info.st_size;
+ 

Added: trunk/dports/lang/apple-gcc42/files/werror-local-alloc.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/werror-local-alloc.patch	                        (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/werror-local-alloc.patch	2011-07-07 19:54:18 UTC (rev 80247)
@@ -0,0 +1,23 @@
+--- gcc/local-alloc.c.orig	2011-07-06 23:23:50.000000000 -0700
++++ gcc/local-alloc.c	2011-07-06 23:25:17.000000000 -0700
+@@ -901,7 +901,7 @@ update_equiv_regs (void)
+ 	  /* APPLE LOCAL begin 5695218 */
+ 	  if (reg_inheritance_matrix)
+ 	    {
+-	      int dstregno;
++	      long dstregno;
+ 		if (REG_P (dest))
+ 		{
+ 		  dstregno = REGNO (dest);
+@@ -2693,9 +2693,9 @@ static int
+ reg_inheritance_1 (rtx *px, void *data)
+ {
+   rtx x = *px;
+-  unsigned int srcregno, dstregno;
++  unsigned long srcregno, dstregno;
+ 
+-  dstregno = (int)data;
++  dstregno = (long)data;
+ #ifdef TARGET_386
+   /*
+     Ugly special case: When moving a DI/SI/mode constant into an FP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110707/8c793131/attachment-0001.html>


More information about the macports-changes mailing list