source: trunk/dports/lang/gcc43/Portfile

Last change on this file was 148394, checked in by ryandesign@…, 17 months ago

gcc43, gcc44, gcc45, gcc46, gcc47, gcc48, gcc49, gcc5, gcc6, gcc7: change build.target from bootstrap to bootstrap-lean to use less disk space during the build

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.9 KB
Line 
1# $Id: Portfile 148394 2016-05-07 00:56:38Z ryandesign@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5PortGroup compiler_blacklist_versions 1.0
6
7name                gcc43
8version             4.3.6
9revision            11
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:cctools \
58                    port:gmp \
59                    port:ld64 \
60                    path:lib/libgcc/libgcc_s.1.dylib:libgcc \
61                    port:libiconv \
62                    port:mpfr
63depends_run         port:gcc_select \
64                    port:libgcc45
65
66depends_skip_archcheck-append gcc_select ld64 cctools
67license_noconflict  gmp mpfr
68
69patchfiles          Make-lang.in.diff \
70                    darwin10.diff \
71                    i386_multilib.diff \
72                    ppc_fde_encoding.diff \
73                    texinfo5.patch
74
75# Handle OS X deployment targets correctly (GCC PR target/63810
76# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810>).
77patchfiles-append   macosx-version-min.patch
78
79# GCC 4.3 is so old that it's not affected by the Libtool
80# MACOSX_DEPLOYMENT_TARGET bug (#45483) and is linked correctly on
81# Yosemite without patching.
82
83set major           [join [lrange [split ${version} .-] 0 1] .]
84
85worksrcdir          gcc-${version}
86
87platform darwin {
88    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
89}
90
91configure.dir       ${workpath}/build
92configure.cmd       ${worksrcpath}/configure
93configure.args      --enable-languages=c,c++,objc,obj-c++,java,fortran \
94                    --libdir=${prefix}/lib/${name} \
95                    --includedir=${prefix}/include/${name} \
96                    --infodir=${prefix}/share/info \
97                    --mandir=${prefix}/share/man \
98                    --datadir=${prefix}/share/${name} \
99                    --with-local-prefix=${prefix} \
100                    --with-libiconv-prefix=${prefix} \
101                    --with-system-zlib \
102                    --disable-nls \
103                    --program-suffix=-mp-${major} \
104                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
105                    --with-gmp=${prefix} \
106                    --with-mpfr=${prefix} \
107                    --enable-stage1-checking \
108                    --disable-multilib \
109                    --with-as=${prefix}/bin/as \
110                    --with-ld=${prefix}/bin/ld \
111                    --with-ar=${prefix}/bin/ar \
112                    --with-bugurl=https://trac.macports.org/newticket
113
114configure.env-append \
115                    AR_FOR_TARGET=${prefix}/bin/ar \
116                    AS_FOR_TARGET=${prefix}/bin/as \
117                    LD_FOR_TARGET=${prefix}/bin/ld \
118                    NM_FOR_TARGET=${prefix}/bin/nm \
119                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
120                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
121                    STRIP_FOR_TARGET=${prefix}/bin/strip \
122                    OTOOL=${prefix}/bin/otool \
123                    OTOOL64=${prefix}/bin/otool
124
125pre-configure {
126    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
127
128    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
129    file mkdir ${configure.dir}
130}
131
132# http://trac.macports.org/ticket/29067
133compiler.blacklist-append gcc-4.0
134
135# http://trac.macports.org/ticket/29104
136compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
137 
138# "-stdlib" would be passed on to the bootstrap compiler if present
139configure.cxx_stdlib
140
141# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
142# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
143# -std=gnu89 : for building with clang
144# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
145#                       exposed in libc headers for fortified string functions.
146#                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
147#                       because STAGE1_CFLAGS is used with xgcc for libgcc
148build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
149build.dir           ${configure.dir}
150build.target        bootstrap-lean
151use_parallel_build  yes
152
153destroot.target     install install-info-host
154
155post-destroot {
156    # install/copy ffitarget.h only if we have it
157    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
158        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
159    }
160
161    file delete ${destroot}${prefix}/share/info/dir
162
163    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
164        set extension [file extension ${file}]
165        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
166       
167        file rename ${file} ${newfile}
168    }
169
170    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} {
171        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
172        # https://trac.macports.org/ticket/40098
173        # https://trac.macports.org/ticket/40100
174        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
175            delete ${destroot}${prefix}/lib/${name}/${dylib}
176            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
177        }
178
179        if {[variant_isset universal]} {
180            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
181                if {[file exists ${archdir}/${dylib}]} {
182                    delete ${archdir}/${dylib}
183                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
184                }
185            }
186        }
187    }
188}
189
190select.group        gcc
191select.file         ${filespath}/mp-${name}
192
193# Java support does not compile on 10.4/x86
194platform darwin 8 i386 {
195    configure.args-delete   --enable-languages=c,c++,objc,obj-c++,java,fortran
196    configure.args-append   --enable-languages=c,c++,objc,obj-c++,fortran
197}
198
199platform powerpc {
200    configure.universal_archs ppc ppc64
201}
202platform i386 {
203    configure.universal_archs i386 x86_64
204}
205variant universal {
206    configure.args-delete --disable-multilib
207}
208# the generated compiler doesn't accept -arch
209configure.env-append CPP="${configure.cc} -E"
210build.env-append CPP="${configure.cc} -E"
211configure.cc-append [get_canonical_archflags]
212configure.cc_archflags
213configure.cxx_archflags
214configure.objc_archflags
215configure.ld_archflags
216configure.universal_cflags
217configure.universal_cxxflags
218configure.universal_ldflags
219configure.universal_args
220
221livecheck.type      regex
222livecheck.url       http://ftp.gnu.org/gnu/gcc/
223livecheck.regex     gcc-(${major}\\.\[0-9.\]+)/
Note: See TracBrowser for help on using the repository browser.