source: trunk/dports/lang/gcc46/Portfile @ 102942

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

gcc*: Use compiler_blacklist_versions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.1 KB
Line 
1# $Id: Portfile 102942 2013-02-11 02:46:02Z jeremyhu@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5PortGroup compiler_blacklist_versions 1.0
6
7name                gcc46
8epoch               1
9
10# Whenever this port is bumped for version/revision, please revbump dragonegg-3.[012]
11version             4.6.3
12revision            9
13platforms           darwin
14categories          lang
15maintainers         mww openmaintainer
16# an exception in the license allows dependents to not be GPL
17license             {GPL-3+ Permissive}
18description         The GNU compiler collection
19long_description    The GNU compiler collection, including front ends for \
20                    C, C++, Objective-C, Objective-C++, and Fortran.
21
22homepage            http://gcc.gnu.org/
23master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/:gcc \
24                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/:gcc \
25                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/:gcc \
26                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/:gcc \
27                    gnu:gcc/gcc-${version}:gcc \
28                    ftp://sourceware.org/pub/java/:ecj \
29                    http://mirrors.kernel.org/sources.redhat.com/java/:ecj \
30                    http://www.mirrorservice.org/sites/sources.redhat.com/pub/java/:ecj \
31                    http://ftp-stud.fht-esslingen.de/pub/Mirrors/sourceware.org/java/:ecj
32
33use_bzip2           yes
34
35set ecj             ecj-4.5.jar
36
37distname            gcc-${version}
38
39distfiles           [suffix ${distname}]:gcc ${ecj}:ecj
40
41extract.only        [suffix ${distname}]
42
43checksums           [suffix ${distname}] \
44                    md5     773092fe5194353b02bb0110052a972e \
45                    rmd160  9abb2f940d08fc84f2d91b6a6ce8d662ca889269 \
46                    sha256  e8f5853d4eec2f5ebaf8a72ae4d53c436aacf98153b2499f8635b48c4718a093 \
47                    ${ecj} \
48                    rmd160  d3f4da657f086b6423f74e93f001132f4855368a \
49                    sha256  98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781
50
51depends_lib         port:gmp port:mpfr port:libiconv port:libmpc port:ppl port:cloog
52depends_run         port:gcc_select port:ld64 port:cctools path:lib/libstdc\\\\+\\\\+.6.dylib:libstdcxx
53
54depends_skip_archcheck-append gcc_select ld64 cctools
55license_noconflict  gmp mpfr ppl
56
57patchfiles          gcc-4.6-cloog_lang_c.patch
58patch.dir           ${workpath}/gcc-${version}
59
60set major           4.6
61
62worksrcdir          build
63
64post-extract {
65    file mkdir ${worksrcpath}
66    copy ${distpath}/${ecj} ${workpath}/${distname}/ecj.jar
67}
68
69platform darwin {
70    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
71}
72
73configure.cmd       ../gcc-${version}/configure
74# 'java' and 'go' lead to compilation errors on 10.5/XCode 3.x
75configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran \
76                    --libdir=${prefix}/lib/${name} \
77                    --includedir=${prefix}/include/${name} \
78                    --infodir=${prefix}/share/info \
79                    --mandir=${prefix}/share/man \
80                    --datarootdir=${prefix}/share/gcc-${major} \
81                    --with-local-prefix=${prefix} \
82                    --with-libiconv-prefix=${prefix} \
83                    --with-system-zlib \
84                    --disable-nls \
85                    --program-suffix=-mp-${major} \
86                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
87                    --with-gmp=${prefix} \
88                    --with-mpfr=${prefix} \
89                    --with-mpc=${prefix} \
90                    --with-ppl=${prefix} \
91                    --with-cloog=${prefix} --enable-cloog-backend=isl \
92                    --disable-cloog-version-check \
93                    --enable-stage1-checking \
94                    --disable-multilib \
95                    --enable-lto \
96                    --enable-libstdcxx-time \
97                    --with-as=${prefix}/bin/as \
98                    --with-ld=${prefix}/bin/ld \
99                    --with-ar=${prefix}/bin/ar \
100                    --with-bugurl=https://trac.macports.org/newticket
101# remove this asap when upstream implements a check for ppl 1.0
102configure.args-append --disable-ppl-version-check
103
104configure.env-append \
105                    AR_FOR_TARGET=${prefix}/bin/ar \
106                    AS_FOR_TARGET=${prefix}/bin/as \
107                    LD_FOR_TARGET=${prefix}/bin/ld \
108                    NM_FOR_TARGET=${prefix}/bin/nm \
109                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
110                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
111                    STRIP_FOR_TARGET=${prefix}/bin/strip \
112                    OTOOL=${prefix}/bin/otool \
113                    OTOOL64=${prefix}/bin/otool
114
115pre-configure {
116    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
117}
118
119# http://trac.macports.org/ticket/29067
120compiler.blacklist-append gcc-4.0
121
122# http://trac.macports.org/ticket/29104
123compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
124
125build.target        bootstrap
126use_parallel_build  yes
127
128destroot.target     install install-info-host
129
130post-destroot {
131    file delete -force ${destroot}${prefix}/share/man/man7 \
132        ${destroot}${prefix}/share/info
133    # install/copy ffitarget.h only if we have it
134    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
135        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
136    }
137
138    if {[variant_isset universal]} {
139        foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
140            if {[file exists ${archdir}/libstdc++.6.dylib]} {
141                eval delete [glob ${archdir}/libstdc++*]
142
143                # This symlink is provided as a transition aide and will be removed
144                # with a future revision of this port.
145                ln -s ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib
146            }
147        }
148    }
149
150    # http://trac.macports.org/ticket/35770
151    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
152
153    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
154
155    # This symlink is provided as a transition aide and will be removed
156    # with a future revision of this port.
157    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
158}
159
160select.group        gcc
161select.file         ${filespath}/mp-${name}
162
163platform darwin 8 {
164    # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248
165    configure.args-append --with-dwarf2
166}
167
168platform powerpc {
169    configure.universal_archs ppc ppc64
170}
171platform i386 {
172    configure.universal_archs i386 x86_64
173}
174variant universal {
175    configure.args-delete --disable-multilib
176}
177# the generated compiler doesn't accept -arch
178configure.env-append CPP="${configure.cc} -E"
179build.env-append CPP="${configure.cc} -E"
180configure.cc-append [get_canonical_archflags]
181configure.cc_archflags
182configure.cxx_archflags
183configure.objc_archflags
184configure.ld_archflags
185configure.universal_cflags
186configure.universal_cxxflags
187configure.universal_ldflags
188configure.universal_args
189
190livecheck.type      regex
191livecheck.url       http://gcc.gnu.org/gcc-4.6/
192livecheck.regex     GCC (4\\.6\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.