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

jeremyhu at macports.org jeremyhu at macports.org
Thu May 17 00:04:47 PDT 2012


Revision: 93184
          https://trac.macports.org/changeset/93184
Author:   jeremyhu at macports.org
Date:     2012-05-17 00:04:46 -0700 (Thu, 17 May 2012)
Log Message:
-----------
apple-gcc42: Use MacPorts cctools and ld64 (with a bootstrap variant for Tiger)

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

Removed Paths:
-------------
    trunk/dports/lang/apple-gcc42/files/makeinfo.patch

Modified: trunk/dports/lang/apple-gcc42/Portfile
===================================================================
--- trunk/dports/lang/apple-gcc42/Portfile	2012-05-17 05:57:28 UTC (rev 93183)
+++ trunk/dports/lang/apple-gcc42/Portfile	2012-05-17 07:04:46 UTC (rev 93184)
@@ -6,7 +6,7 @@
 name			apple-gcc42
 version			5666.3
 set gcc_version		4.2.1
-revision		5
+revision		6
 categories		lang
 platforms		darwin
 license         GPL-2
@@ -48,9 +48,11 @@
 #files/other_langs.patch:
 #+  --with-gmp=$DEST_ROOT \
 #+  --with-mpfr=$DEST_ROOT \
-#depends_lib             port:gmp port:mpfr port:libiconv
+#depends_lib             port:gmp port:mpfr
 
-depends_run             port:gcc_select
+#depends_lib             port:libiconv
+depends_run             port:gcc_select port:ld64 port:cctools
+depends_skip_archcheck-append gcc_select ld64 cctools
 
 use_configure no
 variant universal {}
@@ -69,14 +71,12 @@
 set objroot ${workpath}/objroot
 set symroot ${workpath}/symroot
 
-# makeinfo.patch                 : Fix version detection for makeinfo in configure scripts
 # werror-*.patch                 : Fix compilation errors when building for x86_64
 # incpath.patch                  : Don't prepend the -isysroot option argument to the compiler's own search paths
 # driverdriver-num_infiles.patch : Fix linking with no input files (ie all static archives passed with -l...)
 # driverdriver-armcheck.patch    : Build fix for the driverdriver when arm support is not available (eg: Tiger)
 
 patchfiles \
-	makeinfo.patch \
 	werror-c-incpath.patch \
 	werror-local-alloc.patch \
 	incpath.patch \
@@ -99,63 +99,102 @@
 #}
 
 post-extract {
-	file copy -force ${filespath}/build_gcc ${worksrcpath}
+    file copy -force ${filespath}/build_gcc ${worksrcpath}
 }
 
 post-patch {
-	# Install documentation in a MacPorts location
-	reinplace "/^HTMLDIR=/ s:=.*$:=\"${prefix}/share/doc/${name}/html\":" ${worksrcpath}/build_gcc
+    # Install documentation in a MacPorts location
+    #reinplace "/^HTMLDIR=/ s:=.*$:=\"${prefix}/share/doc/${name}/html\":" ${worksrcpath}/build_gcc
 
-	# arch returns i386 even when we want x86_64
-	reinplace "/^BUILD=/ s:arch:echo ${build_arch}:" ${worksrcpath}/build_gcc
+    # arch returns i386 even when we want x86_64
+    reinplace "/^BUILD=/ s:arch:echo ${build_arch}:" ${worksrcpath}/build_gcc
 
-	# This is set to isysroot/Developer/SDKs/MacOSX10.5.sdk mmacosx-version-min=10.5
-	# which is not always right.  Our CFLAGS should take care of this instead
-	reinplace "/^MULTILIB_EXTRA_OPTS/d" ${worksrcpath}/gcc/config/rs6000/t-darwin
+    # This is set to isysroot/Developer/SDKs/MacOSX10.5.sdk mmacosx-version-min=10.5
+    # which is not always right.  Our CFLAGS should take care of this instead
+    reinplace "/^MULTILIB_EXTRA_OPTS/d" ${worksrcpath}/gcc/config/rs6000/t-darwin
 
-	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
-	}
+    # Brand our compiler
+    reinplace "/VERSUFFIX/s/)\"/) (MacPorts ${name} ${version}_${revision}${portvariants})\"/" \
+        ${worksrcpath}/gcc/version.c
+    reinplace "/bug_report_url/s|http:.*>|https://trac.macports.org/newticket>|" \
+        ${worksrcpath}/gcc/version.c
 
-        if {${os.major} < 9} {
-            reinplace "/vproc.h/d" ${worksrcpath}/gcc/libgcov.c
-        }
+    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
+    }
 
-	# Disable -Werror for our bootstrap gcc
-	if {${configure.compiler} == "clang" ||
-	    ${configure.compiler} == "macports-clang"} {
-		reinplace "s:--enable-werror : :" ${worksrcpath}/build_gcc
-	}
+    if {${os.major} < 9} {
+        reinplace "/vproc.h/d" ${worksrcpath}/gcc/libgcov.c
+    }
+
+    # Disable -Werror for our bootstrap gcc
+    if {[string match "*clang*" ${configure.compiler}]} {
+        reinplace "s:--enable-werror : :" ${worksrcpath}/build_gcc
+    }
 }
 
 compiler.cpath
 
-# TODO: Use MacPorts dependencies
+# TODO: Better use of MacPorts dependencies
 build.env \
-	LIBRARY_PATH="/usr/lib" \
-	CPATH="/usr/include" \
-	PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
-	LANGUAGES="c,c++,objc,obj-c++"
+    LANGUAGES="c,c++,objc,obj-c++" \
+    LIBRARY_PATH="/usr/lib" \
+    CPATH="/usr/include" \
+    PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
+    LANGUAGES="c,c++,objc,obj-c++" \
+    AR_FOR_TARGET=${prefix}/bin/ar \
+    AS_FOR_TARGET=${prefix}/bin/as \
+    LD_FOR_TARGET=${prefix}/bin/ld \
+    NM_FOR_TARGET=${prefix}/bin/nm \
+    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
+    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
+    STRIP_FOR_TARGET=${prefix}/bin/strip \
+    OTOOL=${prefix}/bin/otool \
+    OTOOL64=${prefix}/bin/otool
 
-#	MAKEINFO=${prefix}/bin/makeinfo
-
 build.args-append \
-	CC="${configure.cc} -std=gnu89" \
-	PREFIX="${prefix}" \
-	SRCROOT="${srcroot}" \
-	OBJROOT="${objroot}" \
-	SYMROOT="${symroot}" \
-	DSTROOT="${destroot}" \
-	RC_NONARCH_CFLAGS="-pipe -std=gnu89" \
-	RC_OS="macos" \
-	RC_ARCHS="[get_canonical_archs]"
+    CC="${configure.cc} -std=gnu89" \
+    PREFIX="${prefix}" \
+    SRCROOT="${srcroot}" \
+    OBJROOT="${objroot}" \
+    SYMROOT="${symroot}" \
+    DSTROOT="${destroot}" \
+    RC_NONARCH_CFLAGS="-pipe -std=gnu89" \
+    RC_OS="macos" \
+    RC_ARCHS="[get_canonical_archs]"
 
+# On Tiger, we need apple-gcc42 to build llvm, which is needed for cctools
+variant bootstrap description {Variant to break a dependency cycle on Tiger by first building an apple-gcc42 using host ld and cctools} {
+#    depends_lib-delete      port:libiconv
+    depends_run-delete      port:ld64 port:cctools
+
+    build.env \
+        LIBRARY_PATH="/usr/lib" \
+        CPATH="/usr/include" \
+        PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
+        LANGUAGES="c,c++,objc,obj-c++"
+
+    pre-fetch {
+        if {([file exists ${prefix}/bin/ld] && [file exists ${prefix}/bin/as]) || ${os.major} > 8} {
+            ui_error "Please install this port without the bootstrap variant."
+            error "Please install this port without the bootstrap variant."
+        }
+    }
+}
+
+platform darwin 8 {
+    if {![file exists ${prefix}/bin/gcc-apple-4.2] &&
+        (![file exists ${prefix}/bin/ld] || ![file exists ${prefix}/bin/as])} {
+        default_variants +bootstrap
+    }
+}
+
 set build_targets {}
 
 if {${os.major} > 8 || ${os.arch} == "i386"} {
@@ -175,7 +214,7 @@
 # TODO: arm?
 
 build.args-append \
-	TARGETS="${build_targets}"
+    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

Modified: trunk/dports/lang/apple-gcc42/files/build_gcc
===================================================================
--- trunk/dports/lang/apple-gcc42/files/build_gcc	2012-05-17 05:57:28 UTC (rev 93183)
+++ trunk/dports/lang/apple-gcc42/files/build_gcc	2012-05-17 07:04:46 UTC (rev 93184)
@@ -243,7 +243,10 @@
 # comparable to the native built libraries.
 unset RC_DEBUG_OPTIONS
 make $MAKEFLAGS CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
-make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+# The version check for makeinfo is broken in all the configure scripts,
+# and building documentation which is already available online isn't worth
+# the effort in fixing it
+#make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
 make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install-target \
   CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
 
@@ -423,9 +426,9 @@
 rm -rf * || exit 1
 
 # HTML documentation
-HTMLDIR="/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools"
-mkdir -p ".$HTMLDIR" || exit 1
-cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* ".$HTMLDIR/" || exit 1
+#HTMLDIR="/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools"
+#mkdir -p ".$HTMLDIR" || exit 1
+#cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* ".$HTMLDIR/" || exit 1
 
 # Manual pages
 mkdir -p .$DEST_ROOT/share || exit 1

Deleted: trunk/dports/lang/apple-gcc42/files/makeinfo.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/makeinfo.patch	2012-05-17 05:57:28 UTC (rev 93183)
+++ trunk/dports/lang/apple-gcc42/files/makeinfo.patch	2012-05-17 07:04:46 UTC (rev 93184)
@@ -1,48 +0,0 @@
-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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120517/a6ce48ee/attachment-0001.html>


More information about the macports-changes mailing list