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

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

misc: Update compiler dependency workaround for #32542, see #37817

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