source: trunk/dports/lang/gcc44/Portfile

Last change on this file was 148394, checked in by ryandesign@…, 15 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.8 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                gcc44
8epoch               1
9version             4.4.7
10revision            10
11platforms           darwin
12categories          lang
13maintainers         mww openmaintainer
14# an exception in the license allows dependents to not be GPL
15license             {GPL-3+ 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-4.4.7.tar.bz2 \
38                    md5     3bda0831d654964ee152c46fa8d29e46 \
39                    sha1    6db82d9cb0c9c0bd93c80c972e8b08b8dca2455d \
40                    rmd160  eb53966a8077cc6753ba06a1f542bf699b3cd95c \
41                    gcc-fortran-4.4.7.tar.bz2 \
42                    md5     38496cf90e69c99b5fc0fef023a2d9ce \
43                    sha1    ef9f57d587fd79b15b9bb61b6a480d859037400a \
44                    rmd160  542b0052fcacfde4524bc7695698ff7532c2c8c2 \
45                    gcc-g++-4.4.7.tar.bz2 \
46                    md5     5494ba2227ccbd7c90f318723b0e7fe5 \
47                    sha1    d6c030fd2c666956366ba784e77491adb0b9ad2d \
48                    rmd160  50e0aa25aa61efe92d2f2b574eaf5efacf998bee \
49                    gcc-java-4.4.7.tar.bz2 \
50                    md5     a777517bed21fb850c74dd7015171608 \
51                    sha1    891b16c7414d4f5d241c1bd3264b6d198a6a1108 \
52                    rmd160  61f947efef544bfbf8333a9ccf867e9c33a379a7 \
53                    gcc-objc-4.4.7.tar.bz2 \
54                    md5     64121f41d2bd70e51733aaff9e34f41f \
55                    sha1    d87e56cf6216795e8c0fd7148918d2e09790c24d \
56                    rmd160  660d8e2f8162458e463de6195e58391ee711ed59
57
58depends_lib         port:cctools \
59                    port:gmp \
60                    port:ld64 \
61                    path:lib/libgcc/libgcc_s.1.dylib:libgcc \
62                    port:libiconv \
63                    port:mpfr
64depends_run         port:gcc_select \
65                    port:libgcc45
66
67depends_skip_archcheck-append gcc_select ld64 cctools
68license_noconflict  gmp mpfr
69
70patchfiles          ppc_fde_encoding.diff \
71                    texinfo5.patch
72
73# Handle OS X deployment targets correctly (GCC PR target/63810
74# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810>).
75patchfiles-append   macosx-version-min.patch
76
77# Don't link with "-flat_namespace -undefined suppress" on Yosemite and
78# later (#45483).
79patchfiles-append   yosemite-libtool.patch
80
81set major           [join [lrange [split ${version} .-] 0 1] .]
82
83worksrcdir          gcc-${version}
84
85platform darwin {
86    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
87}
88
89configure.dir       ${workpath}/build
90configure.cmd       ${worksrcpath}/configure
91configure.args      --enable-languages=c,c++,objc,obj-c++,java,fortran \
92                    --libdir=${prefix}/lib/${name} \
93                    --includedir=${prefix}/include/${name} \
94                    --infodir=${prefix}/share/info \
95                    --mandir=${prefix}/share/man \
96                    --datadir=${prefix}/share/${name} \
97                    --with-local-prefix=${prefix} \
98                    --with-libiconv-prefix=${prefix} \
99                    --with-system-zlib \
100                    --disable-nls \
101                    --program-suffix=-mp-${major} \
102                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
103                    --with-gmp=${prefix} \
104                    --with-mpfr=${prefix} \
105                    --enable-stage1-checking \
106                    --disable-multilib \
107                    --with-as=${prefix}/bin/as \
108                    --with-ld=${prefix}/bin/ld \
109                    --with-ar=${prefix}/bin/ar \
110                    --with-bugurl=https://trac.macports.org/newticket
111
112configure.env-append \
113                    AR_FOR_TARGET=${prefix}/bin/ar \
114                    AS_FOR_TARGET=${prefix}/bin/as \
115                    LD_FOR_TARGET=${prefix}/bin/ld \
116                    NM_FOR_TARGET=${prefix}/bin/nm \
117                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
118                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
119                    STRIP_FOR_TARGET=${prefix}/bin/strip \
120                    OTOOL=${prefix}/bin/otool \
121                    OTOOL64=${prefix}/bin/otool
122
123pre-configure {
124    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
125
126    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
127    file mkdir ${configure.dir}
128}
129
130# http://trac.macports.org/ticket/29067
131compiler.blacklist-append gcc-4.0
132
133# http://trac.macports.org/ticket/29104
134compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
135 
136# "-stdlib" would be passed on to the bootstrap compiler if present
137configure.cxx_stdlib
138
139# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
140# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
141# -std=gnu89 : for building with clang
142# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
143#                       exposed in libc headers for fortified string functions.
144#                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
145#                       because STAGE1_CFLAGS is used with xgcc for libgcc
146build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
147build.dir           ${configure.dir}
148build.target        bootstrap-lean
149use_parallel_build  yes
150
151destroot.target     install install-info-host
152
153post-destroot {
154    # install/copy ffitarget.h only if we have it
155    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
156        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
157    }
158    file rename ${destroot}${prefix}/share/python/aotcompile.py \
159                ${destroot}${prefix}/share/python/aotcompile-44.py
160    file rename ${destroot}${prefix}/share/python/classfile.py \
161                ${destroot}${prefix}/share/python/classfile-44.py
162
163    file delete ${destroot}${prefix}/share/info/dir
164
165    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
166        set extension [file extension ${file}]
167        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
168       
169        file rename ${file} ${newfile}
170    }
171
172    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} {
173        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
174        # https://trac.macports.org/ticket/40098
175        # https://trac.macports.org/ticket/40100
176        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
177            delete ${destroot}${prefix}/lib/${name}/${dylib}
178            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
179        }
180
181        if {[variant_isset universal]} {
182            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
183                if {[file exists ${archdir}/${dylib}]} {
184                    delete ${archdir}/${dylib}
185                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
186                }
187            }
188        }
189    }
190}
191
192select.group        gcc
193select.file         ${filespath}/mp-${name}
194
195platform powerpc {
196    configure.universal_archs ppc ppc64
197}
198platform i386 {
199    configure.universal_archs i386 x86_64
200}
201variant universal {
202    configure.args-delete --disable-multilib
203}
204# the generated compiler doesn't accept -arch
205configure.env-append CPP="${configure.cc} -E"
206build.env-append CPP="${configure.cc} -E"
207configure.cc-append [get_canonical_archflags]
208configure.cc_archflags
209configure.cxx_archflags
210configure.objc_archflags
211configure.ld_archflags
212configure.universal_cflags
213configure.universal_cxxflags
214configure.universal_ldflags
215configure.universal_args
216
217livecheck.type      regex
218livecheck.url       http://ftp.gnu.org/gnu/gcc/
219livecheck.regex     gcc-(${major}\\.\[0-9.\]+)/
Note: See TracBrowser for help on using the repository browser.