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