source: trunk/dports/lang/gcc43/Portfile @ 125551

Last change on this file since 125551 was 125551, checked in by ryandesign@…, 6 years ago

gcc43, gcc44, gcc45, gcc46, gcc47, gcc48, gcc49, gcc410: indicate build conflict with libunwind-headers (#43869)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.4 KB
Line 
1# $Id: Portfile 125551 2014-09-20 23:11:55Z ryandesign@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5PortGroup compiler_blacklist_versions 1.0
6PortGroup conflicts_build 1.0
7
8name                gcc43
9version             4.3.6
10revision            9
11platforms           darwin
12categories          lang
13maintainers         mww openmaintainer
14# an exception in the license allows dependents to not be GPL
15license             {GPL-3+ GPL-2+ Permissive}
16description         The GNU compiler collection
17long_description    The GNU compiler collection, including front ends for \
18                    C, C++, Objective-C, Objective-C++, Fortran, and Java.
19
20homepage            http://gcc.gnu.org/
21master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \
22                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
23                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
24                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
25                    gnu:gcc/gcc-${version}
26
27use_bzip2           yes
28
29set dcore           gcc-core-${version}.tar.bz2
30set dfort           gcc-fortran-${version}.tar.bz2
31set dcxx            gcc-g++-${version}.tar.bz2
32set djava           gcc-java-${version}.tar.bz2
33set dobjc           gcc-objc-${version}.tar.bz2
34
35distfiles           ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}
36
37checksums           gcc-core-${version}.tar.bz2 \
38                    md5     43df9ad8b4bb314a46bac12f5aefaec2 \
39                    sha1    d9dc274ad558194e7d9bacc49c333a4870d7e613 \
40                    rmd160  d4bed0820d5eae5072e30fa66167fda4fc2f0bbc \
41                    gcc-fortran-${version}.tar.bz2 \
42                    md5     c6eeee73007015c52043716fbe8ffdc7 \
43                    sha1    20d9f1293857d24e4a69996f91875718e3217ae3 \
44                    rmd160  ca92b43af16f6837d99f839a76547cd0610fbc58 \
45                    gcc-g++-${version}.tar.bz2 \
46                    md5     ee7dc01b6e1a6a92a6e8d66adb8d2ab9 \
47                    sha1    91afb0336103204731d5d8156790b97005869d1f \
48                    rmd160  90e5836b9b5e16a378b93f093dec78e917ae3f9c \
49                    gcc-java-${version}.tar.bz2 \
50                    md5     b5c12ad38048c354686747d640f5d621 \
51                    sha1    0216314c694642e0b16418a1259bd0f90987107e \
52                    rmd160  bfc0ac76397e81ccfeb9334966359e668a961d8e \
53                    gcc-objc-${version}.tar.bz2 \
54                    md5     3fdb8158eabb765d1711f894bf71f7f5 \
55                    sha1    437833d7211118f8647941c1a78531ec125f97c2 \
56                    rmd160  cde38f66b4b952f52938dc50d7606a0e1ccc7d2f
57
58depends_lib         port:gmp port:mpfr port:libiconv path:lib/libgcc/libgcc_s.1.dylib:libgcc port:ld64 port:cctools
59depends_run         port:gcc_select port:libgcc45
60
61depends_skip_archcheck-append gcc_select ld64 cctools
62license_noconflict  gmp mpfr
63
64patchfiles          Make-lang.in.diff darwin10.diff i386_multilib.diff ppc_fde_encoding.diff
65
66set major           4.3
67
68worksrcdir          gcc-${version}
69
70platform darwin {
71    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
72}
73
74configure.dir       ${workpath}/build
75configure.cmd       ${worksrcpath}/configure
76configure.args      --enable-languages=c,c++,objc,obj-c++,java,fortran \
77                    --libdir=${prefix}/lib/${name} \
78                    --includedir=${prefix}/include/${name} \
79                    --infodir=${prefix}/share/info \
80                    --mandir=${prefix}/share/man \
81                    --datadir=${prefix}/share/${name} \
82                    --with-local-prefix=${prefix} \
83                    --with-libiconv-prefix=${prefix} \
84                    --with-system-zlib \
85                    --disable-nls \
86                    --program-suffix=-mp-${major} \
87                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
88                    --with-gmp=${prefix} \
89                    --with-mpfr=${prefix} \
90                    --enable-stage1-checking \
91                    --disable-multilib \
92                    --with-as=${prefix}/bin/as \
93                    --with-ld=${prefix}/bin/ld \
94                    --with-ar=${prefix}/bin/ar \
95                    --with-bugurl=https://trac.macports.org/newticket
96
97configure.env-append \
98                    AR_FOR_TARGET=${prefix}/bin/ar \
99                    AS_FOR_TARGET=${prefix}/bin/as \
100                    LD_FOR_TARGET=${prefix}/bin/ld \
101                    NM_FOR_TARGET=${prefix}/bin/nm \
102                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
103                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
104                    STRIP_FOR_TARGET=${prefix}/bin/strip \
105                    OTOOL=${prefix}/bin/otool \
106                    OTOOL64=${prefix}/bin/otool
107
108pre-configure {
109    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
110
111    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
112    file mkdir ${configure.dir}
113}
114
115# http://trac.macports.org/ticket/29067
116compiler.blacklist-append gcc-4.0
117
118# http://trac.macports.org/ticket/29104
119compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
120 
121# "-stdlib" would be passed on to the bootstrap compiler if present
122configure.cxx_stdlib
123
124# https://trac.macports.org/ticket/43869
125conflicts_build-append libunwind-headers
126
127# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
128# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
129# -std=gnu89 : for building with clang
130# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
131#                       exposed in libc headers for fortified string functions.
132#                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
133#                       because STAGE1_CFLAGS is used with xgcc for libgcc
134build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
135build.dir           ${configure.dir}
136build.target        bootstrap
137use_parallel_build  yes
138
139destroot.target     install install-info-host
140
141post-destroot {
142    # install/copy ffitarget.h only if we have it
143    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
144        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
145    }
146
147    file delete ${destroot}${prefix}/share/info/dir
148
149    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
150        set extension [file extension ${file}]
151        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
152       
153        file rename ${file} ${newfile}
154    }
155
156    foreach dylib {libgcc_ext.10.4.dylib libgcc_ext.10.5.dylib libgcc_s.1.dylib libgfortran.3.dylib libstdc++.6.dylib libobjc-gnu.2.dylib libgomp.1.dylib libssp.0.dylib} {
157        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
158        # https://trac.macports.org/ticket/40098
159        # https://trac.macports.org/ticket/40100
160        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
161            delete ${destroot}${prefix}/lib/${name}/${dylib}
162            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
163        }
164
165        if {[variant_isset universal]} {
166            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
167                if {[file exists ${archdir}/${dylib}]} {
168                    delete ${archdir}/${dylib}
169                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
170                }
171            }
172        }
173    }
174}
175
176select.group        gcc
177select.file         ${filespath}/mp-${name}
178
179# Java support does not compile on 10.4/x86
180platform darwin 8 i386 {
181    configure.args-delete   --enable-languages=c,c++,objc,obj-c++,java,fortran
182    configure.args-append   --enable-languages=c,c++,objc,obj-c++,fortran
183}
184
185platform powerpc {
186    configure.universal_archs ppc ppc64
187}
188platform i386 {
189    configure.universal_archs i386 x86_64
190}
191variant universal {
192    configure.args-delete --disable-multilib
193}
194# the generated compiler doesn't accept -arch
195configure.env-append CPP="${configure.cc} -E"
196build.env-append CPP="${configure.cc} -E"
197configure.cc-append [get_canonical_archflags]
198configure.cc_archflags
199configure.cxx_archflags
200configure.objc_archflags
201configure.ld_archflags
202configure.universal_cflags
203configure.universal_cxxflags
204configure.universal_ldflags
205configure.universal_args
206
207livecheck.type      regex
208livecheck.url       http://gcc.gnu.org/gcc-4.3/
209livecheck.regex     GCC (4\\.3\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.