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
Line 
1# $Id: Portfile 97700 2012-09-12 16:43:28Z jeremyhu@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5
6name                gcc48
7subport             libstdcxx-devel {}
8version             4.8-20120909
9revision            4
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 \
16                    C, C++, Objective-C, Objective-C++, Fortran and Java. \
17                    This is a prerelease BETA version!
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}/ \
22                    ftp://gcc.gnu.org/pub/gcc/snapshots/${version}/ \
23                    http://mirrors-us.seosue.com/gcc/snapshots/${version}/ \
24                    http://gcc.skazkaforyou.com/snapshots/${version}/
25
26distname            gcc-${version}
27
28checksums           rmd160  35cd54340b158c8fcccbf5f4be599f141d60f694 \
29                    sha256  7afd0b9143a541702f767d69610b5648e7e97fdd66b02ca910175e0bad2b31c0
30
31supported_archs     i386 x86_64
32
33use_bzip2           yes
34
35depends_lib         port:gmp port:mpfr port:libiconv port:libmpc port:ppl port:cloog
36depends_run         port:gcc_select port:ld64 port:cctools port:libstdcxx-devel
37
38depends_skip_archcheck-append gcc_select ld64 cctools
39
40set major           4.8
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
53configure.args      --enable-languages=c,c++,objc,obj-c++,fortran,java \
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} \
67                    --with-ppl=${prefix} \
68                    --with-cloog=${prefix} --enable-cloog-backend=isl \
69                    --enable-stage1-checking \
70                    --disable-multilib \
71                    --enable-lto \
72                    --with-as=${prefix}/bin/as \
73                    --with-ld=${prefix}/bin/ld \
74                    --with-ar=${prefix}/bin/ar \
75                    --with-bugurl=https://trac.macports.org/newticket
76
77configure.env-append \
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 \
84                    STRIP_FOR_TARGET=${prefix}/bin/strip \
85                    OTOOL=${prefix}/bin/otool \
86                    OTOOL64=${prefix}/bin/otool
87
88pre-configure {
89    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
90}
91
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
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
111    configure.args-append --disable-bootstrap
112
113    build.target        all
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}
120
121        # base doesn't like the + in this depspec path:lib/libstdc++.dylib:libstdcxx
122        system "touch ${destroot}${prefix}/lib/.libstdcxx"
123    }
124} else {
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    }
132
133    # http://trac.macports.org/ticket/35770
134    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
135
136    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
137
138    # This symlink is provided as a transition aide and will be removed
139    # with a future revision of this port.
140    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
141}
142
143select.group        gcc
144select.file         ${filespath}/mp-${name}
145
146}
147
148platform powerpc {
149    configure.universal_archs ppc ppc64
150}
151platform i386 {
152    configure.universal_archs i386 x86_64
153}
154variant universal {
155    configure.args-delete --disable-multilib
156}
157# the generated compiler doesn't accept -arch
158configure.env-append CPP="${configure.cc} -E"
159build.env-append CPP="${configure.cc} -E"
160configure.cc-append [get_canonical_archflags]
161configure.cc_archflags
162configure.cxx_archflags
163configure.objc_archflags
164configure.ld_archflags
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/
172livecheck.regex     LATEST-4.8 -> (4.8-\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.