source: trunk/dports/lang/gcc48/Portfile @ 97700

Last change on this file since 97700 was 97700, checked in by jeremyhu@…, 7 years ago

gcc4?: Make libstdcxx builds faster, workaround bug in base depspec for the libstdcxx dependency

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.0 KB
RevLine 
[88422]1# $Id: Portfile 97700 2012-09-12 16:43:28Z jeremyhu@macports.org $
[87650]2
3PortSystem 1.0
4PortGroup select 1.0
5
[91037]6name                gcc48
[97687]7subport             libstdcxx-devel {}
[97645]8version             4.8-20120909
[97700]9revision            4
[87650]10platforms           darwin
11categories          lang
12maintainers         mww openmaintainer
13license             GPL-3
14description         The GNU compiler collection, prerelease BETA
15long_description    The GNU compiler collection, including front ends for \
[93106]16                    C, C++, Objective-C, Objective-C++, Fortran and Java. \
17                    This is a prerelease BETA version!
[87650]18
19homepage            http://gcc.gnu.org/
20master_sites        ftp://ftp.gwdg.de/pub/linux/gcc/snapshots/${version}/ \
21                    ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/snapshots/${version}/ \
[87651]22                    ftp://gcc.gnu.org/pub/gcc/snapshots/${version}/ \
[89262]23                    http://mirrors-us.seosue.com/gcc/snapshots/${version}/ \
24                    http://gcc.skazkaforyou.com/snapshots/${version}/
[87650]25
26distname            gcc-${version}
27
[97645]28checksums           rmd160  35cd54340b158c8fcccbf5f4be599f141d60f694 \
29                    sha256  7afd0b9143a541702f767d69610b5648e7e97fdd66b02ca910175e0bad2b31c0
[87650]30
[93033]31supported_archs     i386 x86_64
32
[87650]33use_bzip2           yes
34
[92877]35depends_lib         port:gmp port:mpfr port:libiconv port:libmpc port:ppl port:cloog
[97687]36depends_run         port:gcc_select port:ld64 port:cctools port:libstdcxx-devel
[87650]37
[92064]38depends_skip_archcheck-append gcc_select ld64 cctools
39
[91037]40set major           4.8
[87650]41
42worksrcdir          build
43
44post-extract {
45    file mkdir ${worksrcpath}
46}
47
48platform darwin {
49    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
50}
51
52configure.cmd       ../gcc-${version}/configure
[93105]53configure.args      --enable-languages=c,c++,objc,obj-c++,fortran,java \
[87650]54                    --libdir=${prefix}/lib/${name} \
55                    --includedir=${prefix}/include/${name} \
56                    --infodir=${prefix}/share/info \
57                    --mandir=${prefix}/share/man \
58                    --datarootdir=${prefix}/share/gcc-${major} \
59                    --with-local-prefix=${prefix} \
60                    --with-system-zlib \
61                    --disable-nls \
62                    --program-suffix=-mp-${major} \
63                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
64                    --with-gmp=${prefix} \
65                    --with-mpfr=${prefix} \
66                    --with-mpc=${prefix} \
[91016]67                    --with-ppl=${prefix} \
[92877]68                    --with-cloog=${prefix} --enable-cloog-backend=isl \
[87650]69                    --enable-stage1-checking \
[88802]70                    --disable-multilib \
[92064]71                    --enable-lto \
72                    --with-as=${prefix}/bin/as \
73                    --with-ld=${prefix}/bin/ld \
[92418]74                    --with-ar=${prefix}/bin/ar \
75                    --with-bugurl=https://trac.macports.org/newticket
[92064]76
[87650]77configure.env-append \
[92064]78                    AR_FOR_TARGET=${prefix}/bin/ar \
79                    AS_FOR_TARGET=${prefix}/bin/as \
80                    LD_FOR_TARGET=${prefix}/bin/ld \
81                    NM_FOR_TARGET=${prefix}/bin/nm \
82                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
83                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
[92418]84                    STRIP_FOR_TARGET=${prefix}/bin/strip \
85                    OTOOL=${prefix}/bin/otool \
86                    OTOOL64=${prefix}/bin/otool
[87650]87
[92418]88pre-configure {
89    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
90}
91
[87650]92# http://trac.macports.org/ticket/29104
93if {${configure.compiler} == "llvm-gcc-4.2"} {
94    configure.compiler clang
95}
96
97build.target        bootstrap
98use_parallel_build  yes
99
100destroot.target     install install-info-host
101
[97687]102# TODO: Optimize this.  We don't need to actually bootstrap gcc to build libstdc++
103if {${subport} == "libstdcxx-devel"} {
104    depends_run-delete port:${subport}
105
106    configure.args-delete --libdir=${prefix}/lib/${name}
107
108    configure.args-delete --enable-languages=c,c++,objc,obj-c++,lto,fortran,java
109    configure.args-append --enable-languages=c++
110
[97700]111    configure.args-append --disable-bootstrap
112
113    build.target        all
[97687]114    destroot.target     install-target-libstdc++-v3
115
116    post-destroot {
117        eval delete [glob ${destroot}${prefix}/lib/*{a,py}]
118        file delete -force ${destroot}${prefix}/share/gcc-${major}
119        file delete -force ${destroot}${prefix}/include/${name}
[97700]120
121        # base doesn't like the + in this depspec path:lib/libstdc++.dylib:libstdcxx
122        system "touch ${destroot}${prefix}/lib/.libstdcxx"
[97687]123    }
124} else {
[87650]125post-destroot {
126    file delete -force ${destroot}${prefix}/share/man/man7 \
127        ${destroot}${prefix}/share/info
128    # install/copy ffitarget.h only if we have it
129    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
130        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
131    }
[97657]132
133    # http://trac.macports.org/ticket/35770
134    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
135
[97687]136    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
137
[97657]138    # This symlink is provided as a transition aide and will be removed
139    # with a future revision of this port.
[97687]140    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
[87650]141}
142
143select.group        gcc
144select.file         ${filespath}/mp-${name}
145
[97687]146}
147
[87650]148platform powerpc {
149    configure.universal_archs ppc ppc64
150}
151platform i386 {
152    configure.universal_archs i386 x86_64
153}
[89472]154variant universal {
155    configure.args-delete --disable-multilib
156}
157# the generated compiler doesn't accept -arch
[91015]158configure.env-append CPP="${configure.cc} -E"
[89719]159build.env-append CPP="${configure.cc} -E"
[89472]160configure.cc-append [get_canonical_archflags]
161configure.cc_archflags
162configure.cxx_archflags
163configure.objc_archflags
164configure.ld_archflags
[87650]165configure.universal_cflags
166configure.universal_cxxflags
167configure.universal_ldflags
168configure.universal_args
169
170livecheck.type      regex
171livecheck.url       ftp://gcc.gnu.org/pub/gcc/snapshots/
[91037]172livecheck.regex     LATEST-4.8 -> (4.8-\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.