# $Id: Portfile 75057 2011-01-13 12:07:10Z mww@macports.org $ PortSystem 1.0 name gcc46 version 4.6-20110108 platforms darwin categories lang maintainers mww license GPLv3 description The GNU compiler collection, prerelease BETA long_description The GNU compiler collection, including front ends for \ C, C++, Objective-C and Objective-C++. This is a \ prerelease BETA version and does not have all \ available language front ends enabled. homepage http://gcc.gnu.org/ master_sites ftp://ftp.gwdg.de/pub/linux/gcc/snapshots/${version}/:gcc \ ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/snapshots/${version}/:gcc \ ftp://gcc.gnu.org/pub/gcc/snapshots/${version}/:gcc \ ftp://sourceware.org/pub/java/:ecj \ http://mirrors.kernel.org/sources.redhat.com/java/:ecj \ http://www.mirrorservice.org/sites/sources.redhat.com/pub/java/:ecj \ http://ftp-stud.fht-esslingen.de/pub/Mirrors/sourceware.org/java/:ecj 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 set ecj ecj-4.5.jar distfiles ${dcore}:gcc ${dfort}:gcc ${dcxx}:gcc ${djava}:gcc ${dobjc}:gcc ${ecj}:ecj extract.only ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc} checksums gcc-core-${version}.tar.bz2 \ md5 b65a4408e0c6f2f0f3d2206a51766703 \ sha1 71504988a972d2bd83b6e4ea51f93ca77aa37567 \ rmd160 580724622e6113e6fea81bc73da68001f626e105 \ gcc-fortran-${version}.tar.bz2 \ md5 63a90f2353413f0438525dea78bb7a0a \ sha1 dc6d8b56a53b3aa2975941bec53e9e9ed24a7b36 \ rmd160 3f2a64d0a1539907d56d6953fd4919102ad202dd \ gcc-g++-${version}.tar.bz2 \ md5 36ada7fd6536f3abd62e53c684b6e6f9 \ sha1 b278a01f56086228c7cc7c6b0d553c63809fc1dd \ rmd160 97348424e7fc726a4b5f38575b6d8155f9ae8b5e \ gcc-java-${version}.tar.bz2 \ md5 42d55eb8ecd945e43773c029b2f6df1d \ sha1 c890b5cb71f56dee89ed83d4a3a45728e03a43e3 \ rmd160 1c59c0ea9ca0dd799546d0796dffbcef3fd511b4 \ gcc-objc-${version}.tar.bz2 \ md5 78f1cf03639521bc06de5171a8fc5d68 \ sha1 ed476d4cb20898fbafc3320931e530609e2fc1b1 \ rmd160 a3fe5da37dc1cbcbd7e1b20b1d83d84001f0c4b9 \ ecj-4.5.jar \ md5 d7cd6a27c8801e66cbaa964a039ecfdb \ sha1 58c1d79c64c8cd718550f32a932ccfde8d1e6449 \ rmd160 d3f4da657f086b6423f74e93f001132f4855368a \ use_bzip2 yes depends_lib port:gmp port:mpfr port:libiconv port:libmpc set major 4.6 worksrcdir build post-extract { file mkdir ${worksrcpath} copy ${distpath}/${ecj} ${workpath}/gcc-${version}/ecj.jar } # the generated compiler doesn't accept -arch configure.cc_archflags configure.cxx_archflags configure.objc_archflags configure.ld_archflags platform darwin { configure.pre_args-append --build=${build_arch}-apple-darwin${os.major} } configure.cmd ../gcc-${version}/configure configure.args --enable-languages=c,c++,objc,obj-c++ \ --libdir=${prefix}/lib/${name} \ --includedir=${prefix}/include/${name} \ --infodir=${prefix}/share/info \ --mandir=${prefix}/share/man \ --datarootdir=${prefix}/share/gcc-${major} \ --with-local-prefix=${prefix} \ --with-system-zlib \ --disable-nls \ --program-suffix=-mp-${major} \ --with-gxx-include-dir=${prefix}/include/${name}/c++/ \ --with-gmp=${prefix} \ --with-mpfr=${prefix} \ --with-mpc=${prefix} \ --enable-stage1-checking \ --disable-multilib # do NOT use MacPorts binutils -- they do not work configure.env-append AR_FOR_TARGET=/usr/bin/ar \ AS_FOR_TARGET=/usr/bin/as \ LD_FOR_TARGET=/usr/bin/ld \ NM_FOR_TARGET=/usr/bin/nm \ OBJDUMP_FOR_TARGET=/usr/bin/objdump \ RANLIB_FOR_TARGET=/usr/bin/ranlib \ STRIP_FOR_TARGET=/usr/bin/strip build.target bootstrap use_parallel_build yes destroot.target install install-info-host post-destroot { file delete -force ${destroot}${prefix}/share/man/man7 \ ${destroot}${prefix}/share/info # install/copy ffitarget.h only if we have it if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} { file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/ } # install select file for gcc_select xinstall -m 755 -d ${destroot}${prefix}/etc/select/gcc xinstall -m 444 ${filespath}/mp-gcc46 ${destroot}${prefix}/etc/select/gcc/ } platform darwin 10 { configure.args-append --enable-fully-dynamic-string } # due to popular request - untested for the BETA; will be removed as soon as other languages than C compile successfuly variant gfortran conflicts java \ description "Enables Fortran/gfortran; this language will be enabled in the final version - this variant is completely untested!" { configure.args-delete --enable-languages=c,c++,objc,obj-c++ configure.args-append --enable-languages=c,c++,objc,obj-c++,fortran } # due to popular request - untested for the BETA; will be removed as soon as other languages than C compile successfuly variant java conflicts gfortran \ description "Enables Java/gcj; this language will be enabled in the final version - this variant is completely untested!" { configure.args-delete --enable-languages=c,c++,objc,obj-c++ configure.args-append --enable-languages=c,c++,objc,obj-c++,java post-destroot { file rename ${destroot}${prefix}/share/python/aotcompile.py \ ${destroot}${prefix}/share/python/aotcompile-46.py file rename ${destroot}${prefix}/share/python/classfile.py \ ${destroot}${prefix}/share/python/classfile-46.py } } platform powerpc { configure.universal_archs ppc ppc64 } platform i386 { configure.universal_archs i386 x86_64 } configure.universal_cflags configure.universal_cxxflags configure.universal_ldflags configure.universal_args variant universal { configure.args-delete --disable-multilib } livecheck.type regex livecheck.url ftp://gcc.gnu.org/pub/gcc/snapshots/ livecheck.regex LATEST-4.6 -> (4.6-\[0-9\]+)