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

Last change on this file since 127045 was 127045, checked in by mfeiri@…, 5 years ago

gcc43, gcc44, gcc45, gcc46, gcc47, gcc48, gcc49, gcc5: build conflict with libunwind-headers resolved in r127042

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 127045 2014-10-19 22:54:11Z mfeiri@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6PortGroup compiler_blacklist_versions 1.0
7
8name                gcc48
9
10# Whenever this port is bumped for version/revision, please revbump dragonegg-*-gcc-4.8
11epoch               2
12version             4.8.3
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++, Fortran and Java.
21
22homepage            http://gcc.gnu.org/
23master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \
24                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
25                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
26                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
27                    gnu:gcc/gcc-${version}
28
29distname            gcc-${version}
30use_bzip2           yes
31
32checksums           rmd160  2c7214ff607cbe822282c04d1d6f9fea765c82c5 \
33                    sha256  6a8e4f11b185f4fe2ed9d7fc053e80f8c7e73f800c045f51f9d8bea33f080f1e
34
35depends_lib         port:gmp port:mpfr port:libiconv port:libmpc path:lib/pkgconfig/cloog-isl.pc:cloog path:lib/libgcc/libgcc_s.1.dylib:libgcc port:ld64 port:cctools
36depends_run         port:gcc_select
37
38depends_skip_archcheck-append gcc_select ld64 cctools
39license_noconflict  gmp mpfr ppl libmpc
40
41patchfiles          patch-10.10.diff
42
43set major           4.8
44
45platform darwin {
46    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
47}
48
49configure.dir       ${workpath}/build
50configure.cmd       ${worksrcpath}/configure
51configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran,java \
52                    --libdir=${prefix}/lib/${name} \
53                    --includedir=${prefix}/include/${name} \
54                    --infodir=${prefix}/share/info \
55                    --mandir=${prefix}/share/man \
56                    --datarootdir=${prefix}/share/gcc-${major} \
57                    --with-local-prefix=${prefix} \
58                    --with-system-zlib \
59                    --disable-nls \
60                    --program-suffix=-mp-${major} \
61                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
62                    --with-gmp=${prefix} \
63                    --with-mpfr=${prefix} \
64                    --with-mpc=${prefix} \
65                    --with-cloog=${prefix} --enable-cloog-backend=isl \
66                    --disable-cloog-version-check \
67                    --enable-stage1-checking \
68                    --disable-multilib \
69                    --enable-lto \
70                    --enable-libstdcxx-time \
71                    --with-as=${prefix}/bin/as \
72                    --with-ld=${prefix}/bin/ld \
73                    --with-ar=${prefix}/bin/ar \
74                    --with-bugurl=https://trac.macports.org/newticket
75
76configure.env-append \
77                    AR_FOR_TARGET=${prefix}/bin/ar \
78                    AS_FOR_TARGET=${prefix}/bin/as \
79                    LD_FOR_TARGET=${prefix}/bin/ld \
80                    NM_FOR_TARGET=${prefix}/bin/nm \
81                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
82                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
83                    STRIP_FOR_TARGET=${prefix}/bin/strip \
84                    OTOOL=${prefix}/bin/otool \
85                    OTOOL64=${prefix}/bin/otool
86
87pre-configure {
88    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
89
90    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
91    file mkdir ${configure.dir}
92}
93
94# http://trac.macports.org/ticket/29067
95compiler.blacklist-append gcc-4.0
96
97# http://trac.macports.org/ticket/29104
98compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
99
100# "-stdlib" would be passed on to the bootstrap compiler if present
101configure.cxx_stdlib
102
103build.dir           ${configure.dir}
104build.target        bootstrap
105use_parallel_build  yes
106
107destroot.target     install install-info-host
108
109post-destroot {
110    file delete ${destroot}${prefix}/share/info/dir
111
112    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
113        set extension [file extension ${file}]
114        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
115
116        file rename ${file} ${newfile}
117    }
118
119    foreach dylib {libgcc_ext.10.4.dylib libgcc_ext.10.5.dylib libgcc_s.1.dylib libgfortran.3.dylib libquadmath.0.dylib libstdc++.6.dylib libobjc-gnu.4.dylib libgomp.1.dylib libitm.1.dylib libssp.0.dylib libasan.0.dylib libatomic.1.dylib} {
120        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
121        # https://trac.macports.org/ticket/40098
122        # https://trac.macports.org/ticket/40100
123        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
124            delete ${destroot}${prefix}/lib/${name}/${dylib}
125            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
126        }
127
128        if {[variant_isset universal]} {
129            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
130                if {[file exists ${archdir}/${dylib}]} {
131                    delete ${archdir}/${dylib}
132                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
133                }
134            }
135        }
136    }
137}
138
139select.group        gcc
140select.file         ${filespath}/mp-${name}
141
142platform powerpc {
143    configure.universal_archs ppc ppc64
144}
145platform i386 {
146    configure.universal_archs i386 x86_64
147}
148variant universal {
149    configure.args-delete --disable-multilib
150}
151# the generated compiler doesn't accept -arch
152configure.env-append CPP="${configure.cc} -E"
153build.env-append CPP="${configure.cc} -E"
154configure.cc-append [get_canonical_archflags]
155configure.cc_archflags
156configure.cxx-append ${configure.cxx_archflags}
157configure.cxx_archflags
158configure.objc_archflags
159configure.ld_archflags
160configure.universal_cflags
161configure.universal_cxxflags
162configure.universal_ldflags
163configure.universal_args
164
165livecheck.type      regex
166livecheck.url       http://gcc.gnu.org/gcc-4.8/
167livecheck.regex     GCC (4\\.8\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.