# $Id: Portfile 102108 2013-01-28 06:22:45Z jeremyhu@macports.org $ PortSystem 1.0 PortGroup select 1.0 name gcc48 subport libstdcxx-devel {} # Remove the revision in libstdcxx-devel when bumping version 4.8-20130120 platforms darwin categories lang maintainers mww openmaintainer license GPL-3 description The GNU compiler collection, prerelease BETA long_description The GNU compiler collection, including front ends for \ C, C++, Objective-C, Objective-C++, Fortran and Java. \ This is a prerelease BETA version! homepage http://gcc.gnu.org/ master_sites http://gcc.petsads.us/snapshots/${version} \ ftp://ftp.gwdg.de/pub/linux/gcc/snapshots/${version}/ \ ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/snapshots/${version}/ \ ftp://gcc.gnu.org/pub/gcc/snapshots/${version}/ \ http://mirrors-us.seosue.com/gcc/snapshots/${version}/ \ http://gcc.skazkaforyou.com/snapshots/${version}/ distname gcc-${version} checksums rmd160 f858b83ae98927d9ccd16531208390589c087c57 \ sha256 c360f7ea2d6f0ee4aa59699c521aa2662d574f889513f8bb67be126b03389d29 supported_archs i386 x86_64 use_bzip2 yes depends_lib port:gmp port:mpfr port:libiconv port:libmpc port:ppl port:cloog depends_run port:gcc_select port:ld64 port:cctools port:libstdcxx-devel depends_skip_archcheck-append gcc_select ld64 cctools license_noconflict gmp mpfr ppl patchfiles libstdc++-configure-timespec.patch patch.dir ${workpath}/gcc-${version} set major 4.8 worksrcdir build post-extract { file mkdir ${worksrcpath} } 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++,fortran,java \ --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} \ --with-ppl=${prefix} \ --with-cloog=${prefix} --enable-cloog-backend=isl \ --disable-cloog-version-check \ --enable-stage1-checking \ --disable-multilib \ --enable-lto \ --enable-libstdcxx-time \ --with-as=${prefix}/bin/as \ --with-ld=${prefix}/bin/ld \ --with-ar=${prefix}/bin/ar \ --with-bugurl=https://trac.macports.org/newticket configure.env-append \ 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 pre-configure { configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}" } # http://trac.macports.org/ticket/29067 compiler.blacklist-append gcc-4.0 # http://trac.macports.org/ticket/29104 if {[vercmp $xcodeversion 4.2] < 0} { compiler.blacklist-append llvm-gcc-4.2 } # TODO: base should do this: http://trac.macports.org/ticket/32542 if {[portconfigure::compiler_is_port ${configure.compiler}]} { depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler}) depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler}) } build.target bootstrap use_parallel_build yes destroot.target install install-info-host # TODO: Optimize this. We don't need to actually bootstrap gcc to build libstdc++ if {${subport} == "libstdcxx-devel"} { revision 1 conflicts libstdcxx patchfiles-append force-static-gcc.patch depends_run-delete port:${subport} configure.args-delete --libdir=${prefix}/lib/${name} configure.args-delete --enable-languages=c,c++,objc,obj-c++,lto,fortran,java configure.args-append --enable-languages=c++ # See http://trac.macports.org/ticket/36116 for why we can't do this yet # configure.args-append --disable-bootstrap # build.target all destroot.target install-target-libstdc++-v3 post-destroot { eval file delete [glob ${destroot}${prefix}/lib/*{a,py}] eval file delete [glob ${destroot}${prefix}/lib/libgcc*] file delete -force ${destroot}${prefix}/lib/gcc file delete -force ${destroot}${prefix}/share/gcc-${major} file delete -force ${destroot}${prefix}/include/${name} # Don't install the linktime symlink. The compilers will place this # in their libdir, and we don't want to break other toolchains by having # them link against this libstdc++ (at least not until it is built on # top of libc++abi). file delete ${destroot}${prefix}/lib/libstdc++.dylib # For compatibility. Delete this eventually. system "touch ${destroot}${prefix}/lib/.libstdcxx" if {[variant_isset universal]} { foreach archdir [glob ${destroot}${prefix}/lib/*/] { if {[file exists ${archdir}/libstdc++.6.dylib]} { system "install_name_tool -id ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib" system "lipo -create -output ${destroot}${prefix}/lib/libstdc++.6.dylib~ ${destroot}${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib && mv ${destroot}${prefix}/lib/libstdc++.6.dylib~ ${destroot}${prefix}/lib/libstdc++.6.dylib" } file delete -force ${archdir} } } } } else { 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}/ } if {[variant_isset universal]} { foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] { if {[file exists ${archdir}/libstdc++.6.dylib]} { eval delete [glob ${archdir}/libstdc++*] # This symlink is provided as a transition aide and will be removed # with a future revision of this port. ln -s ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib } } } # http://trac.macports.org/ticket/35770 eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*] ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib # This symlink is provided as a transition aide and will be removed # with a future revision of this port. ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib } select.group gcc select.file ${filespath}/mp-${name} } platform powerpc { configure.universal_archs ppc ppc64 } platform i386 { configure.universal_archs i386 x86_64 } variant universal { configure.args-delete --disable-multilib } # the generated compiler doesn't accept -arch configure.env-append CPP="${configure.cc} -E" build.env-append CPP="${configure.cc} -E" configure.cc-append [get_canonical_archflags] configure.cc_archflags configure.cxx_archflags configure.objc_archflags configure.ld_archflags configure.universal_cflags configure.universal_cxxflags configure.universal_ldflags configure.universal_args livecheck.type regex livecheck.url ftp://gcc.gnu.org/pub/gcc/snapshots/ livecheck.regex LATEST-4.8 -> (4.8-\[0-9\]+)