1 | # $Id: Portfile 94958 2012-07-02 21:25:00Z mww@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup select 1.0 |
---|
5 | |
---|
6 | name gcc47 |
---|
7 | epoch 1 |
---|
8 | version 4.7.1 |
---|
9 | revision 1 |
---|
10 | platforms darwin |
---|
11 | categories lang |
---|
12 | maintainers mww openmaintainer |
---|
13 | license GPL-3 |
---|
14 | description The GNU compiler collection |
---|
15 | long_description The GNU compiler collection, including front ends for \ |
---|
16 | C, C++, Objective-C, Objective-C++, Fortran and Java. |
---|
17 | |
---|
18 | homepage http://gcc.gnu.org/ |
---|
19 | master_sites ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/:gcc \ |
---|
20 | ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/:gcc \ |
---|
21 | ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/:gcc \ |
---|
22 | ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/:gcc \ |
---|
23 | gnu:gcc/gcc-${version}:gcc \ |
---|
24 | ftp://sourceware.org/pub/java/:ecj \ |
---|
25 | http://mirrors.kernel.org/sources.redhat.com/java/:ecj \ |
---|
26 | http://www.mirrorservice.org/sites/sources.redhat.com/pub/java/:ecj \ |
---|
27 | http://ftp-stud.fht-esslingen.de/pub/Mirrors/sourceware.org/java/:ecj |
---|
28 | |
---|
29 | use_bzip2 yes |
---|
30 | |
---|
31 | set ecj ecj-4.5.jar |
---|
32 | |
---|
33 | distname gcc-${version} |
---|
34 | |
---|
35 | distfiles [suffix ${distname}]:gcc ${ecj}:ecj |
---|
36 | |
---|
37 | extract.only [suffix ${distname}] |
---|
38 | |
---|
39 | checksums [suffix ${distname}] \ |
---|
40 | rmd160 4b52d867d06288a0b3bb33c845cac0112c22b513 \ |
---|
41 | sha256 16093f6fa01732adf378d97fe338f113c933bdf56da22bf87c76beff13da406f \ |
---|
42 | ${ecj} \ |
---|
43 | rmd160 d3f4da657f086b6423f74e93f001132f4855368a \ |
---|
44 | sha256 98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781 |
---|
45 | |
---|
46 | depends_lib port:gmp port:mpfr port:libiconv port:libmpc port:ppl port:cloog |
---|
47 | depends_run port:gcc_select port:ld64 port:cctools |
---|
48 | |
---|
49 | depends_skip_archcheck-append gcc_select ld64 cctools |
---|
50 | |
---|
51 | patchfiles ppc_fde_encoding.diff |
---|
52 | patch.dir ${workpath}/gcc-${version} |
---|
53 | |
---|
54 | set major 4.7 |
---|
55 | |
---|
56 | worksrcdir build |
---|
57 | |
---|
58 | post-extract { |
---|
59 | file mkdir ${worksrcpath} |
---|
60 | copy ${distpath}/${ecj} ${workpath}/${distname}/ecj.jar |
---|
61 | } |
---|
62 | |
---|
63 | platform darwin { |
---|
64 | configure.pre_args-append --build=${build_arch}-apple-darwin${os.major} |
---|
65 | } |
---|
66 | |
---|
67 | configure.cmd ../gcc-${version}/configure |
---|
68 | configure.args --enable-languages=c,c++,objc,obj-c++,lto,fortran,java \ |
---|
69 | --libdir=${prefix}/lib/${name} \ |
---|
70 | --includedir=${prefix}/include/${name} \ |
---|
71 | --infodir=${prefix}/share/info \ |
---|
72 | --mandir=${prefix}/share/man \ |
---|
73 | --datarootdir=${prefix}/share/gcc-${major} \ |
---|
74 | --with-libiconv-prefix=${prefix} \ |
---|
75 | --with-local-prefix=${prefix} \ |
---|
76 | --with-system-zlib \ |
---|
77 | --disable-nls \ |
---|
78 | --program-suffix=-mp-${major} \ |
---|
79 | --with-gxx-include-dir=${prefix}/include/${name}/c++/ \ |
---|
80 | --with-gmp=${prefix} \ |
---|
81 | --with-mpfr=${prefix} \ |
---|
82 | --with-mpc=${prefix} \ |
---|
83 | --with-ppl=${prefix} \ |
---|
84 | --with-cloog=${prefix} --enable-cloog-backend=isl \ |
---|
85 | --enable-stage1-checking \ |
---|
86 | --disable-multilib \ |
---|
87 | --enable-lto \ |
---|
88 | --with-as=${prefix}/bin/as \ |
---|
89 | --with-ld=${prefix}/bin/ld \ |
---|
90 | --with-ar=${prefix}/bin/ar \ |
---|
91 | --with-bugurl=https://trac.macports.org/newticket |
---|
92 | # remove this asap when upstream implements a check for ppl 1.0 |
---|
93 | configure.args-append --disable-ppl-version-check |
---|
94 | |
---|
95 | configure.env-append \ |
---|
96 | AR_FOR_TARGET=${prefix}/bin/ar \ |
---|
97 | AS_FOR_TARGET=${prefix}/bin/as \ |
---|
98 | LD_FOR_TARGET=${prefix}/bin/ld \ |
---|
99 | NM_FOR_TARGET=${prefix}/bin/nm \ |
---|
100 | OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \ |
---|
101 | RANLIB_FOR_TARGET=${prefix}/bin/ranlib \ |
---|
102 | STRIP_FOR_TARGET=${prefix}/bin/strip \ |
---|
103 | OTOOL=${prefix}/bin/otool \ |
---|
104 | OTOOL64=${prefix}/bin/otool |
---|
105 | |
---|
106 | pre-configure { |
---|
107 | configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}" |
---|
108 | } |
---|
109 | |
---|
110 | # http://trac.macports.org/ticket/29104 |
---|
111 | if {${configure.compiler} == "llvm-gcc-4.2"} { |
---|
112 | configure.compiler clang |
---|
113 | } |
---|
114 | |
---|
115 | build.target bootstrap |
---|
116 | use_parallel_build yes |
---|
117 | |
---|
118 | destroot.target install install-info-host |
---|
119 | |
---|
120 | post-destroot { |
---|
121 | file delete -force ${destroot}${prefix}/share/man/man7 \ |
---|
122 | ${destroot}${prefix}/share/info |
---|
123 | # install/copy ffitarget.h only if we have it |
---|
124 | if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} { |
---|
125 | file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/ |
---|
126 | } |
---|
127 | } |
---|
128 | |
---|
129 | select.group gcc |
---|
130 | select.file ${filespath}/mp-${name} |
---|
131 | |
---|
132 | platform powerpc { |
---|
133 | configure.universal_archs ppc ppc64 |
---|
134 | depends_build-append port:apple-gcc42 |
---|
135 | configure.compiler apple-gcc-4.2 |
---|
136 | } |
---|
137 | platform i386 { |
---|
138 | configure.universal_archs i386 x86_64 |
---|
139 | } |
---|
140 | variant universal { |
---|
141 | configure.args-delete --disable-multilib |
---|
142 | } |
---|
143 | # the generated compiler doesn't accept -arch |
---|
144 | configure.env-append CPP="${configure.cc} -E" |
---|
145 | build.env-append CPP="${configure.cc} -E" |
---|
146 | configure.cc-append [get_canonical_archflags] |
---|
147 | configure.cc_archflags |
---|
148 | configure.cxx_archflags |
---|
149 | configure.objc_archflags |
---|
150 | configure.ld_archflags |
---|
151 | configure.universal_cflags |
---|
152 | configure.universal_cxxflags |
---|
153 | configure.universal_ldflags |
---|
154 | configure.universal_args |
---|
155 | |
---|
156 | livecheck.type regex |
---|
157 | livecheck.url http://gcc.gnu.org/gcc-4.7/ |
---|
158 | livecheck.regex GCC (4\\.7\\.\[0-9\]) |
---|
159 | |
---|