source: trunk/dports/lang/gcc48/Portfile @ 103515

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

gcc48: version 4.8-20130224

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.1 KB
Line 
1# $Id: Portfile 103515 2013-02-28 06:37:37Z mww@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5PortGroup compiler_blacklist_versions 1.0
6
7name                gcc48
8subport             libstdcxx-devel {}
9
10# Remove the revision in libstdcxx-devel when bumping
11version             4.8-20130224
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, prerelease BETA
18long_description    The GNU compiler collection, including front ends for \
19                    C, C++, Objective-C, Objective-C++, Fortran and Java. \
20                    This is a prerelease BETA version!
21
22homepage            http://gcc.gnu.org/
23master_sites        http://gcc.petsads.us/snapshots/${version} \
24                    ftp://ftp.gwdg.de/pub/linux/gcc/snapshots/${version}/ \
25                    ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/snapshots/${version}/ \
26                    ftp://gcc.gnu.org/pub/gcc/snapshots/${version}/ \
27                    http://mirrors-us.seosue.com/gcc/snapshots/${version}/ \
28                    http://gcc.skazkaforyou.com/snapshots/${version}/
29
30distname            gcc-${version}
31
32checksums           rmd160  5436c153c6d6b3466f236985e56a98d560fe4f4b \
33                    sha256  041cf6f2e9a9551da2e38ad387d85500f82919db1e7dc9802793b5e9f5c892b5
34
35supported_archs     i386 x86_64
36
37use_bzip2           yes
38
39depends_lib         port:gmp port:mpfr port:libiconv port:libmpc port:ppl port:cloog
40depends_run         port:gcc_select port:ld64 port:cctools port:libstdcxx-devel
41
42depends_skip_archcheck-append gcc_select ld64 cctools
43license_noconflict  gmp mpfr ppl libmpc
44
45patchfiles          libstdc++-configure-timespec.patch
46patch.dir           ${workpath}/gcc-${version}
47
48set major           4.8
49
50worksrcdir          build
51
52post-extract {
53    file mkdir ${worksrcpath}
54}
55
56platform darwin {
57    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
58}
59
60configure.cmd       ../gcc-${version}/configure
61configure.args      --enable-languages=c,c++,objc,obj-c++,fortran,java \
62                    --libdir=${prefix}/lib/${name} \
63                    --includedir=${prefix}/include/${name} \
64                    --infodir=${prefix}/share/info \
65                    --mandir=${prefix}/share/man \
66                    --datarootdir=${prefix}/share/gcc-${major} \
67                    --with-local-prefix=${prefix} \
68                    --with-system-zlib \
69                    --disable-nls \
70                    --program-suffix=-mp-${major} \
71                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
72                    --with-gmp=${prefix} \
73                    --with-mpfr=${prefix} \
74                    --with-mpc=${prefix} \
75                    --with-ppl=${prefix} \
76                    --with-cloog=${prefix} --enable-cloog-backend=isl \
77                    --disable-cloog-version-check \
78                    --enable-stage1-checking \
79                    --disable-multilib \
80                    --enable-lto \
81                    --enable-libstdcxx-time \
82                    --with-as=${prefix}/bin/as \
83                    --with-ld=${prefix}/bin/ld \
84                    --with-ar=${prefix}/bin/ar \
85                    --with-bugurl=https://trac.macports.org/newticket
86
87configure.env-append \
88                    AR_FOR_TARGET=${prefix}/bin/ar \
89                    AS_FOR_TARGET=${prefix}/bin/as \
90                    LD_FOR_TARGET=${prefix}/bin/ld \
91                    NM_FOR_TARGET=${prefix}/bin/nm \
92                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
93                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
94                    STRIP_FOR_TARGET=${prefix}/bin/strip \
95                    OTOOL=${prefix}/bin/otool \
96                    OTOOL64=${prefix}/bin/otool
97
98pre-configure {
99    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
100}
101
102# http://trac.macports.org/ticket/29067
103compiler.blacklist-append gcc-4.0
104
105# http://trac.macports.org/ticket/29104
106compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
107
108build.target        bootstrap
109use_parallel_build  yes
110
111destroot.target     install install-info-host
112
113if {${subport} == "libstdcxx-devel"} {
114    revision        1
115
116    conflicts       libstdcxx
117
118    patchfiles-append  force-static-gcc.patch
119
120    depends_run-delete port:${subport}
121
122    configure.args-delete --libdir=${prefix}/lib/${name}
123
124    configure.args-delete --enable-languages=c,c++,objc,obj-c++,lto,fortran,java
125    configure.args-append --enable-languages=c++
126
127    # http://trac.macports.org/ticket/36116
128    compiler.blacklist-append {clang < 425}
129
130    configure.args-append --disable-bootstrap
131    build.target        all
132
133    destroot.target     install-target-libstdc++-v3
134
135    post-destroot {
136        eval file delete [glob ${destroot}${prefix}/lib/*{a,py}]
137        eval file delete [glob ${destroot}${prefix}/lib/libgcc*]
138        file delete -force ${destroot}${prefix}/lib/gcc
139        file delete -force ${destroot}${prefix}/share/gcc-${major}
140        file delete -force ${destroot}${prefix}/include/${name}
141
142        # Don't install the linktime symlink.  The compilers will place this
143        # in their libdir, and we don't want to break other toolchains by having
144        # them link against this libstdc++ (at least not until it is built on
145        # top of libc++abi).
146        file delete ${destroot}${prefix}/lib/libstdc++.dylib
147
148        # For compatibility.  Delete this eventually.
149        system "touch ${destroot}${prefix}/lib/.libstdcxx"
150
151        if {[variant_isset universal]} {
152            foreach archdir [glob ${destroot}${prefix}/lib/*/] {
153                if {[file exists ${archdir}/libstdc++.6.dylib]} {
154                    system "install_name_tool -id ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib"
155                    system "lipo -create -output ${destroot}${prefix}/lib/libstdc++.6.dylib~ ${destroot}${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib && mv ${destroot}${prefix}/lib/libstdc++.6.dylib~ ${destroot}${prefix}/lib/libstdc++.6.dylib"
156                }
157                file delete -force ${archdir}
158            }
159        }
160    }
161} else {
162post-destroot {
163    file delete -force ${destroot}${prefix}/share/man/man7 \
164        ${destroot}${prefix}/share/info
165    # install/copy ffitarget.h only if we have it
166    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
167        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
168    }
169
170    if {[variant_isset universal]} {
171        foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
172            if {[file exists ${archdir}/libstdc++.6.dylib]} {
173                eval delete [glob ${archdir}/libstdc++*]
174
175                # This symlink is provided as a transition aide and will be removed
176                # with a future revision of this port.
177                ln -s ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib
178            }
179        }
180    }
181
182    # http://trac.macports.org/ticket/35770
183    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
184
185    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
186
187    # This symlink is provided as a transition aide and will be removed
188    # with a future revision of this port.
189    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
190}
191
192select.group        gcc
193select.file         ${filespath}/mp-${name}
194
195}
196
197platform powerpc {
198    configure.universal_archs ppc ppc64
199}
200platform i386 {
201    configure.universal_archs i386 x86_64
202}
203variant universal {
204    configure.args-delete --disable-multilib
205}
206# the generated compiler doesn't accept -arch
207configure.env-append CPP="${configure.cc} -E"
208build.env-append CPP="${configure.cc} -E"
209configure.cc-append [get_canonical_archflags]
210configure.cc_archflags
211configure.cxx_archflags
212configure.objc_archflags
213configure.ld_archflags
214configure.universal_cflags
215configure.universal_cxxflags
216configure.universal_ldflags
217configure.universal_args
218
219livecheck.type      regex
220livecheck.url       ftp://gcc.gnu.org/pub/gcc/snapshots/
221livecheck.regex     LATEST-4.8 -> (4.8-\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.