source: trunk/dports/lang/gcc47/Portfile

Last change on this file was 148394, checked in by ryandesign@…, 15 months ago

gcc43, gcc44, gcc45, gcc46, gcc47, gcc48, gcc49, gcc5, gcc6, gcc7: change build.target from bootstrap to bootstrap-lean to use less disk space during the build

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.3 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 148394 2016-05-07 00:56:38Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6PortGroup compiler_blacklist_versions 1.0
7
8name                gcc47
9epoch               1
10
11# Whenever this port is bumped for version/revision, please revbump dragonegg-*-gcc-4.7
12version             4.7.4
13revision            5
14platforms           darwin
15categories          lang
16maintainers         mww openmaintainer
17# an exception in the license allows dependents to not be GPL
18license             {GPL-3+ Permissive}
19description         The GNU compiler collection
20long_description    The GNU compiler collection, including front ends for \
21                    C, C++, Objective-C, Objective-C++, Fortran and Java.
22
23homepage            http://gcc.gnu.org/
24master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/:gcc \
25                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/:gcc \
26                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/:gcc \
27                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/:gcc \
28                    gnu:gcc/gcc-${version}:gcc \
29                    ftp://sourceware.org/pub/java/:ecj \
30                    http://mirrors.kernel.org/sources.redhat.com/java/:ecj \
31                    http://www.mirrorservice.org/sites/sources.redhat.com/pub/java/:ecj \
32                    http://ftp-stud.fht-esslingen.de/pub/Mirrors/sourceware.org/java/:ecj
33
34use_bzip2           yes
35
36set ecj             ecj-4.5.jar
37
38distname            gcc-${version}
39
40distfiles           ${distname}${extract.suffix}:gcc ${ecj}:ecj
41
42extract.only        ${distname}${extract.suffix}
43
44checksums           ${distname}${extract.suffix} \
45                    rmd160  d0a8e421b9c62a923f765b97828b12d5af388199 \
46                    sha256  92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282 \
47                    ${ecj} \
48                    rmd160  d3f4da657f086b6423f74e93f001132f4855368a \
49                    sha256  98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781
50
51depends_lib         port:cctools \
52                    path:lib/pkgconfig/cloog-isl.pc:cloog \
53                    port:gmp \
54                    port:ld64 \
55                    path:lib/libgcc/libgcc_s.1.dylib:libgcc \
56                    port:libiconv \
57                    port:libmpc \
58                    port:mpfr \
59                    port:ppl
60depends_run         port:gcc_select
61
62depends_skip_archcheck-append gcc_select ld64 cctools
63license_noconflict  gmp mpfr ppl libmpc
64
65patchfiles          ppc_fde_encoding.diff
66
67# Don't check Darwin kernel version (GCC PR target/61407
68# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61407>).
69patchfiles-append   remove-kernel-version-check.patch
70
71# Handle OS X deployment targets correctly (GCC PR target/63810
72# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810>).
73patchfiles-append   macosx-version-min.patch
74
75# Don't link with "-flat_namespace -undefined suppress" on Yosemite and
76# later (#45483).
77patchfiles-append   yosemite-libtool.patch
78
79set major           [join [lrange [split ${version} .-] 0 1] .]
80
81post-extract {
82    copy ${distpath}/${ecj} ${worksrcpath}/ecj.jar
83}
84
85platform darwin {
86    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
87}
88
89configure.dir       ${workpath}/build
90configure.cmd       ${worksrcpath}/configure
91configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran,java \
92                    --libdir=${prefix}/lib/${name} \
93                    --includedir=${prefix}/include/${name} \
94                    --infodir=${prefix}/share/info \
95                    --mandir=${prefix}/share/man \
96                    --datarootdir=${prefix}/share/gcc-${major} \
97                    --with-libiconv-prefix=${prefix} \
98                    --with-local-prefix=${prefix} \
99                    --with-system-zlib \
100                    --disable-nls \
101                    --program-suffix=-mp-${major} \
102                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
103                    --with-gmp=${prefix} \
104                    --with-mpfr=${prefix} \
105                    --with-mpc=${prefix} \
106                    --with-ppl=${prefix} \
107                    --with-cloog=${prefix} --enable-cloog-backend=isl \
108                    --disable-cloog-version-check \
109                    --enable-stage1-checking \
110                    --disable-multilib \
111                    --enable-lto \
112                    --enable-libstdcxx-time \
113                    --with-build-config=bootstrap-debug \
114                    --with-as=${prefix}/bin/as \
115                    --with-ld=${prefix}/bin/ld \
116                    --with-ar=${prefix}/bin/ar \
117                    --with-bugurl=https://trac.macports.org/newticket
118# remove this asap when upstream implements a check for ppl 1.0
119configure.args-append --disable-ppl-version-check
120
121configure.env-append \
122                    AR_FOR_TARGET=${prefix}/bin/ar \
123                    AS_FOR_TARGET=${prefix}/bin/as \
124                    LD_FOR_TARGET=${prefix}/bin/ld \
125                    NM_FOR_TARGET=${prefix}/bin/nm \
126                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
127                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
128                    STRIP_FOR_TARGET=${prefix}/bin/strip \
129                    OTOOL=${prefix}/bin/otool \
130                    OTOOL64=${prefix}/bin/otool
131
132pre-configure {
133    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
134
135    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
136    file mkdir ${configure.dir}
137}
138
139# http://trac.macports.org/ticket/29067
140compiler.blacklist-append gcc-4.0
141
142# http://trac.macports.org/ticket/29104
143compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
144
145# "-stdlib" would be passed on to the bootstrap compiler if present
146configure.cxx_stdlib
147
148build.dir           ${configure.dir}
149build.target        bootstrap-lean
150use_parallel_build  yes
151
152destroot.target     install install-info-host
153
154post-destroot {
155    # install/copy ffitarget.h only if we have it
156    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
157        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
158    }
159
160    file delete ${destroot}${prefix}/share/info/dir
161
162    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
163        set extension [file extension ${file}]
164        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
165       
166        file rename ${file} ${newfile}
167    }
168
169    foreach dylib {libgcc_ext.10.4.dylib libgcc_ext.10.5.dylib libgcc_s.1.dylib libgfortran.3.dylib libquadmath.0.dylib libstdc++.6.dylib libobjc-gnu.4.dylib libgomp.1.dylib libitm.1.dylib libssp.0.dylib} {
170        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
171        # https://trac.macports.org/ticket/40098
172        # https://trac.macports.org/ticket/40100
173        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
174            delete ${destroot}${prefix}/lib/${name}/${dylib}
175            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
176        }
177
178        if {[variant_isset universal]} {
179            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
180                if {[file exists ${archdir}/${dylib}]} {
181                    delete ${archdir}/${dylib}
182                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
183                }
184            }
185        }
186    }
187}
188
189select.group        gcc
190select.file         ${filespath}/mp-${name}
191
192platform powerpc {
193    configure.universal_archs ppc ppc64
194}
195platform i386 {
196    configure.universal_archs i386 x86_64
197}
198variant universal {
199    configure.args-delete --disable-multilib
200}
201# the generated compiler doesn't accept -arch
202configure.env-append CPP="${configure.cc} -E"
203build.env-append CPP="${configure.cc} -E"
204configure.cc-append [get_canonical_archflags]
205configure.cc_archflags
206configure.cxx_archflags
207configure.objc_archflags
208configure.ld_archflags
209configure.universal_cflags
210configure.universal_cxxflags
211configure.universal_ldflags
212configure.universal_args
213
214livecheck.type      regex
215livecheck.url       http://ftp.gnu.org/gnu/gcc/
216livecheck.regex     gcc-(${major}\\.\[0-9.\]+)/
Note: See TracBrowser for help on using the repository browser.