[80294] trunk/dports/lang/apple-gcc42
jeremyhu at macports.org
jeremyhu at macports.org
Fri Jul 8 11:44:02 PDT 2011
Revision: 80294
http://trac.macports.org/changeset/80294
Author: jeremyhu at macports.org
Date: 2011-07-08 11:44:01 -0700 (Fri, 08 Jul 2011)
Log Message:
-----------
apple-gcc42: No effective change, but provides a starting point towards gcj and gfortran if anyone wants to continue the work
Modified Paths:
--------------
trunk/dports/lang/apple-gcc42/Portfile
trunk/dports/lang/apple-gcc42/files/suffix.patch
Added Paths:
-----------
trunk/dports/lang/apple-gcc42/files/other_langs.patch
Modified: trunk/dports/lang/apple-gcc42/Portfile
===================================================================
--- trunk/dports/lang/apple-gcc42/Portfile 2011-07-08 18:36:41 UTC (rev 80293)
+++ trunk/dports/lang/apple-gcc42/Portfile 2011-07-08 18:44:01 UTC (rev 80294)
@@ -5,6 +5,7 @@
name apple-gcc42
version 5666.3
+set gcc_version 4.2.1
revision 1
categories lang
platforms darwin
@@ -14,12 +15,37 @@
version 4.2. Supports C, Objective-C, anc C++
homepage http://opensource.apple.com/
-master_sites http://opensource.apple.com/tarballs/gcc/
+master_sites gnu:/gcc/gcc-4.2.1:gnu \
+ http://opensource.apple.com/tarballs/gcc/:apple
+
distname gcc-${version}
-checksums md5 188c7769db5c898922b0976fab148a63 \
- sha1 292a0cfcfdc061cb083658efd9a3812a120a1f50 \
- rmd160 a01d000f89c0e89dd0079dcd202bba7629ba78dc
+set dcore ${distname}.tar.gz
+set dfort gcc-fortran-${gcc_version}.tar.bz2
+set djava gcc-java-${gcc_version}.tar.bz2
+
+distfiles ${dcore}:apple
+# ${dfort}:gnu ${djava}:gnu
+
+checksums gcc-5666.3.tar.gz \
+ md5 188c7769db5c898922b0976fab148a63 \
+ sha1 292a0cfcfdc061cb083658efd9a3812a120a1f50 \
+ rmd160 a01d000f89c0e89dd0079dcd202bba7629ba78dc
+
+# gcc-fortran-4.2.1.tar.bz2 \
+# md5 2a91d467b50a404ca0cd3b10b413f9b2 \
+# sha1 37a0466b393ade9291dcec315c69c371e42db7f5 \
+# rmd160 2475594dad66277fd0c5fe42389fb8fa2665e5ce \
+# gcc-java-4.2.1.tar.bz2 \
+# md5 3fc64e96388b939fada65fe3bffb5924 \
+# sha1 4615c85ef9010304bf412adc2f2c33d256e177fd \
+# rmd160 bb4b256f7e7779361214593343821a127ee78d1a
+
+# Needed for gfortran:
+# gmp and mpfr are not universal
+#universal_variant no
+#depends_lib port:gmp port:mpfr port:libiconv
+
depends_run port:gcc_select
use_configure no
@@ -36,6 +62,7 @@
# 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
+# other_langs.patch : Add support for gcj and gfortran to build_gcc
# makeinfo.patch : Fix version detection for makeinfo in configure scripts
# werror-*.patch : Fix compilation errors when building for x86_64
patchfiles \
@@ -45,9 +72,25 @@
suffix.patch \
makeinfo.patch \
stage1-cc.patch \
+ other_langs.patch \
werror-c-incpath.patch \
werror-local-alloc.patch
+# gcj fails to build:
+# gcc/java/lang.c: In function 'java_init':
+# gcc/java/lang.c:378: error: 'force_align_functions_log' undeclared (first use in this function)
+# gcc/java/lang.c:378: error: (Each undeclared identifier is reported only once
+# gcc/java/lang.c:378: error: for each function it appears in.)
+#
+# gfortrain fails to link due to functionality moving around in core in a way the module doesn't expect
+
+#extract {
+# system "cd ${workpath} && tar xzf ${distpath}/${dfort}"
+# system "cd ${workpath} && tar xzf ${distpath}/${djava}"
+# file rename ${workpath}/gcc-${gcc_version} ${worksrcpath}
+# system "cd ${workpath} && tar xjf ${distpath}/${dcore}"
+#}
+
post-patch {
# Install documentation in a MacPorts location
reinplace "/^HTMLDIR=/ s:=.*$:=\"${prefix}/share/doc/${name}/html\":" ${worksrcpath}/build_gcc
@@ -77,7 +120,8 @@
build.env \
LIBRARY_PATH="/usr/lib" \
CPATH="/usr/include" \
- PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+ PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
+ LANGUAGES="c,c++,objc,obj-c++"
# MAKEINFO=${prefix}/bin/makeinfo
Added: trunk/dports/lang/apple-gcc42/files/other_langs.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/other_langs.patch (rev 0)
+++ trunk/dports/lang/apple-gcc42/files/other_langs.patch 2011-07-08 18:44:01 UTC (rev 80294)
@@ -0,0 +1,103 @@
+--- build_gcc.orig 2011-07-08 00:24:49.000000000 -0700
++++ build_gcc 2011-07-08 00:31:49.000000000 -0700
+@@ -178,9 +178,14 @@ CONFIGFLAGS="--disable-checking \
+ --libdir=\${prefix}/lib/apple-gcc42 \
+ --includedir=\${prefix}/include/apple-gcc42 \
+ --program-suffix=-apple-$MAJ_VERS \
++ --with-system-zlib \
++ --disable-nls \
++ --with-gmp=$DEST_ROOT \
++ --with-mpfr=$DEST_ROOT \
+ --with-slibdir=/usr/lib \
+ --build=$BUILD-apple-darwin$DARWIN_VERS"
+
++
+ # Figure out how many make processes to run.
+ SYSCTL=`sysctl -n hw.activecpu`
+
+@@ -207,6 +212,22 @@ for lang in `echo $LANGUAGES | sed 's/,/
+ fi
+ done
+
++BUILD_JAVA=0
++for lang in `echo $LANGUAGES | sed 's/,/ /g'`; do
++ if [ $lang = "java" ]; then
++ BUILD_JAVA=1
++ break
++ fi
++done
++
++BUILD_FORTRAN=0
++for lang in `echo $LANGUAGES | sed 's/,/ /g'`; do
++ if [ $lang = "fortran" ]; then
++ BUILD_FORTRAN=1
++ break
++ fi
++done
++
+ # Unset this, because GCC uses this variable in its makefiles
+ unset LANGUAGES
+
+@@ -546,6 +564,14 @@ for t in $TARGETS ; do
+ ln -f $MDIR/g++-apple-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-g++-apple-$VERS.1 \
+ || exit 1
+ fi
++ if [ $BUILD_JAVA -eq 1 ]; then
++ ln -f $MDIR/gcj-apple-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-gcj-apple-$VERS.1 \
++ || exit 1
++ fi
++ if [ $BUILD_FORTRAN -eq 1 ]; then
++ ln -f $MDIR/gfortran-apple-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-gfortran-apple-$VERS.1 \
++ || exit 1
++ fi
+ done
+
+ # Build driver-driver using fully-named drivers
+@@ -579,6 +605,28 @@ for h in $HOSTS ; do
+ -L$DIR/obj-$h-$BUILD/libiberty/ \
+ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-g++-$MAJ_VERS || exit 1
+ fi
++ if [ $BUILD_JAVA -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-gcj-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/ \
++ -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/ \
++ -L$DIR/obj-$h-$BUILD/libiberty/ \
++ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-gcj-$MAJ_VERS || exit 1
++ fi
++ if [ $BUILD_FORTRAN -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-gfortran-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/ \
++ -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/ \
++ -L$DIR/obj-$h-$BUILD/libiberty/ \
++ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-gfortran-$MAJ_VERS || exit 1
++ fi
+ done
+
+ lipo -output $DEST_DIR/$DEST_ROOT/bin/gcc-apple-$MAJ_VERS -create \
+@@ -598,6 +646,18 @@ if [ $BUILD_CXX -eq 1 ]; then
+ rm -rf $DEST_DIR/$DEST_ROOT/lib/apple-gcc42/gcc/*/*/include/c++
+ fi
+
++if [ $BUILD_JAVA -eq 1 ]; then
++ lipo -output $DEST_DIR/$DEST_ROOT/bin/gcj-apple-$MAJ_VERS -create \
++ $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcj-$MAJ_VERS || exit 1
++ rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcj-$MAJ_VERS || exit 1
++fi
++
++if [ $BUILD_FORTRAN -eq 1 ]; then
++ lipo -output $DEST_DIR/$DEST_ROOT/bin/gfortran-apple-$MAJ_VERS -create \
++ $DEST_DIR/$DEST_ROOT/bin/tmp-*-gfortran-$MAJ_VERS || exit 1
++ rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gfortran-$MAJ_VERS || exit 1
++fi
++
+
+ ########################################
+ # Create SYM_DIR with information required for debugging.
Modified: trunk/dports/lang/apple-gcc42/files/suffix.patch
===================================================================
--- trunk/dports/lang/apple-gcc42/files/suffix.patch 2011-07-08 18:36:41 UTC (rev 80293)
+++ trunk/dports/lang/apple-gcc42/files/suffix.patch 2011-07-08 18:44:01 UTC (rev 80294)
@@ -5,9 +5,9 @@
--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 \
++ --libexecdir=$DEST_ROOT/libexec/apple-gcc42 \
++ --libdir=$DEST_ROOT/lib/apple-gcc42 \
++ --includedir=$DEST_ROOT/include/apple-gcc42 \
+ --program-suffix=-apple-$MAJ_VERS \
--with-slibdir=/usr/lib \
--build=$BUILD-apple-darwin$DARWIN_VERS"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110708/eee6cd65/attachment-0001.html>
More information about the macports-changes
mailing list