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