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