a project to simplify installation of open source software
on Mac OS X and Darwin
# $Id: Portfile 22786 2007-03-14 10:55:53Z mww@macports.org $
PortSystem 1.0
name gcc42
version 4.2-20070307
platforms darwin
categories lang
maintainers mww@macports.org
description The GNU compiler collection, prerelease BETA
long_description The GNU compiler collection, including front ends for C, \
C++, Objective-C, Objective-C++, Java and Fortran95, \
prerelease BETA version.
homepage http://gcc.gnu.org/
master_sites ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/snapshots/${version}/ \
ftp://ftp.gwdg.de/pub/linux/gcc/snapshots/${version}/ \
ftp://gcc.gnu.org/pub/gcc/snapshots/${version}/
set dcore gcc-core-${version}.tar.bz2
set dfort gcc-fortran-${version}.tar.bz2
set dcxx gcc-g++-${version}.tar.bz2
set djava gcc-java-${version}.tar.bz2
set dobjc gcc-objc-${version}.tar.bz2
distfiles ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}
checksums ${dcore} sha1 6f15ecedf7e8c2db36decc999800ae370b04a008 \
${dfort} sha1 33ee097e423a07356f41cdcb76ed546782090fd7 \
${dcxx} sha1 f0934286dc4f6d9c209299fd601c718e0d3c75e1 \
${djava} sha1 fd3037313307679cf2945c8c950119334c220b67 \
${dobjc} sha1 69a769c52b0f032a569ac99c25384181a1c68e0f
use_bzip2 yes
depends_lib port:gmp port:mpfr port:libiconv
set major 4.2
worksrcdir build
pre-configure {
file mkdir ${worksrcpath}
}
configure.cmd ../gcc-${version}/configure
configure.args --enable-languages=c,c++,java,objc,obj-c++,fortran \
--libdir=${prefix}/lib/${name} \
--includedir=${prefix}/include/${name} \
--infodir=${prefix}/share/info \
--mandir=${prefix}/share/man \
--with-local-prefix=${prefix} \
--with-system-zlib \
--disable-nls \
--disable-multilib \
--program-suffix=-dp-${major} \
--with-gxx-include-dir=${prefix}/include/${name}/c++/ \
--with-gmp=${prefix} \
--with-mpfr=${prefix}
build.target bootstrap
build.args -j 2
post-destroot {
file delete -force ${destroot}${prefix}/share/man/man7 \
${destroot}${prefix}/share/info
}
#platform darwin 7 {
# configure.env CFLAGS=-force_cpusubtype_ALL \
# BOOT_CFLAGS="-g -O2 -force_cpusubtype_ALL"
# build.args-append XCFLAGS=-force_cpusubtype_ALL
#}
platform darwin 8 {
configure.env CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}
post-destroot {
system "cd ${destroot}${prefix}/include/${name} && \
cp ../../lib/${name}/gcc/*/4.2.0/include/ffitarget.h ."
}
# odcctools currently do not compile for x64 - move to variant for the time being
variant odcctools {
depends_lib-append bin:odas:odcctools
patch {
reinplace "s|/usr/bin/libtool|${prefix}/bin/odlibtool|g" \
${workpath}/gcc-${version}/gcc/config/darwin.h
}
configure.args-append --with-as=${prefix}/bin/odas \
--with-ld=${prefix}/bin/odld \
--with-ar=${prefix}/bin/odar
}
# for the BETA snapshots, use regex on the ftp url
livecheck.check regex
livecheck.url ftp://gcc.gnu.org/pub/gcc/snapshots/
livecheck.regex LATEST-4.2 -> (4.2-\[0-9\]+)
#livecheck.check moddate
#livecheck.url http://gcc.gnu.org/gcc-4.2/