source: trunk/dports/lang/gcc44/Portfile @ 102174

Last change on this file since 102174 was 102174, checked in by jeremyhu@…, 7 years ago

misc: Update compiler dependency workaround for #32542, see #37817

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.4 KB
Line 
1# $Id: Portfile 102174 2013-01-29 07:53:39Z jeremyhu@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5
6name                gcc44
7epoch               1
8version             4.4.7
9revision            6
10platforms           darwin
11categories          lang
12maintainers         mww openmaintainer
13# an exception in the license allows dependents to not be GPL
14license             {GPL-3+ 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-4.4.7.tar.bz2 \
37                    md5     3bda0831d654964ee152c46fa8d29e46 \
38                    sha1    6db82d9cb0c9c0bd93c80c972e8b08b8dca2455d \
39                    rmd160  eb53966a8077cc6753ba06a1f542bf699b3cd95c \
40                    gcc-fortran-4.4.7.tar.bz2 \
41                    md5     38496cf90e69c99b5fc0fef023a2d9ce \
42                    sha1    ef9f57d587fd79b15b9bb61b6a480d859037400a \
43                    rmd160  542b0052fcacfde4524bc7695698ff7532c2c8c2 \
44                    gcc-g++-4.4.7.tar.bz2 \
45                    md5     5494ba2227ccbd7c90f318723b0e7fe5 \
46                    sha1    d6c030fd2c666956366ba784e77491adb0b9ad2d \
47                    rmd160  50e0aa25aa61efe92d2f2b574eaf5efacf998bee \
48                    gcc-java-4.4.7.tar.bz2 \
49                    md5     a777517bed21fb850c74dd7015171608 \
50                    sha1    891b16c7414d4f5d241c1bd3264b6d198a6a1108 \
51                    rmd160  61f947efef544bfbf8333a9ccf867e9c33a379a7 \
52                    gcc-objc-4.4.7.tar.bz2 \
53                    md5     64121f41d2bd70e51733aaff9e34f41f \
54                    sha1    d87e56cf6216795e8c0fd7148918d2e09790c24d \
55                    rmd160  660d8e2f8162458e463de6195e58391ee711ed59
56
57depends_lib         port:gmp port:mpfr port:libiconv
58depends_run         port:gcc_select port:ld64 port:cctools path:lib/libstdc\\\\+\\\\+.6.dylib:libstdcxx
59
60depends_skip_archcheck-append gcc_select ld64 cctools
61license_noconflict  gmp mpfr
62
63patchfiles          ppc_fde_encoding.diff
64patch.dir           ${workpath}/gcc-${version}
65
66set major           4.4
67
68worksrcdir          build
69
70post-extract {
71    file mkdir ${worksrcpath}
72}
73
74platform darwin {
75    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
76}
77
78configure.cmd       ../gcc-${version}/configure
79configure.args      --enable-languages=c,c++,objc,obj-c++,java,fortran \
80                    --libdir=${prefix}/lib/${name} \
81                    --includedir=${prefix}/include/${name} \
82                    --infodir=${prefix}/share/info \
83                    --mandir=${prefix}/share/man \
84                    --datadir=${prefix}/share/${name} \
85                    --with-local-prefix=${prefix} \
86                    --with-libiconv-prefix=${prefix} \
87                    --with-system-zlib \
88                    --disable-nls \
89                    --program-suffix=-mp-${major} \
90                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
91                    --with-gmp=${prefix} \
92                    --with-mpfr=${prefix} \
93                    --enable-stage1-checking \
94                    --disable-multilib \
95                    --with-as=${prefix}/bin/as \
96                    --with-ld=${prefix}/bin/ld \
97                    --with-ar=${prefix}/bin/ar \
98                    --with-bugurl=https://trac.macports.org/newticket
99
100configure.env-append \
101                    AR_FOR_TARGET=${prefix}/bin/ar \
102                    AS_FOR_TARGET=${prefix}/bin/as \
103                    LD_FOR_TARGET=${prefix}/bin/ld \
104                    NM_FOR_TARGET=${prefix}/bin/nm \
105                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
106                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
107                    STRIP_FOR_TARGET=${prefix}/bin/strip \
108                    OTOOL=${prefix}/bin/otool \
109                    OTOOL64=${prefix}/bin/otool
110
111pre-configure {
112    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
113}
114
115# http://trac.macports.org/ticket/29067
116compiler.blacklist-append gcc-4.0
117
118# http://trac.macports.org/ticket/29104
119if {[vercmp $xcodeversion 4.2] < 0} {
120    compiler.blacklist-append llvm-gcc-4.2
121}
122
123# TODO: base should do this: http://trac.macports.org/ticket/32542
124if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
125    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
126
127    # base 2.1.x ignores the argument and just use ${configure.compiler}
128    if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
129        depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
130    }
131
132    if {[string match macports-gcc* ${configure.compiler}]} {
133        depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler})
134    }
135}
136
137# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
138# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
139# -std=gnu89 : for building with clang
140# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
141#                       exposed in libc headers for fortified string functions.
142#                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
143#                       because STAGE1_CFLAGS is used with xgcc for libgcc
144build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
145build.target        bootstrap
146use_parallel_build  yes
147
148destroot.target     install install-info-host
149
150post-destroot {
151    file delete -force ${destroot}${prefix}/share/man/man7 \
152        ${destroot}${prefix}/share/info
153    # install/copy ffitarget.h only if we have it
154    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
155        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
156    }
157    file rename ${destroot}${prefix}/share/python/aotcompile.py \
158                ${destroot}${prefix}/share/python/aotcompile-44.py
159    file rename ${destroot}${prefix}/share/python/classfile.py \
160                ${destroot}${prefix}/share/python/classfile-44.py
161
162    if {[variant_isset universal]} {
163        foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
164            if {[file exists ${archdir}/libstdc++.6.dylib]} {
165                eval delete [glob ${archdir}/libstdc++*]
166
167                # This symlink is provided as a transition aide and will be removed
168                # with a future revision of this port.
169                ln -s ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib
170            }
171        }
172    }
173
174    # http://trac.macports.org/ticket/35770
175    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
176
177    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
178
179    # This symlink is provided as a transition aide and will be removed
180    # with a future revision of this port.
181    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
182}
183
184select.group        gcc
185select.file         ${filespath}/mp-${name}
186
187platform powerpc {
188    configure.universal_archs ppc ppc64
189}
190platform i386 {
191    configure.universal_archs i386 x86_64
192}
193variant universal {
194    configure.args-delete --disable-multilib
195}
196# the generated compiler doesn't accept -arch
197configure.env-append CPP="${configure.cc} -E"
198build.env-append CPP="${configure.cc} -E"
199configure.cc-append [get_canonical_archflags]
200configure.cc_archflags
201configure.cxx_archflags
202configure.objc_archflags
203configure.ld_archflags
204configure.universal_cflags
205configure.universal_cxxflags
206configure.universal_ldflags
207configure.universal_args
208
209livecheck.type      regex
210livecheck.url       http://gcc.gnu.org/gcc-4.4/
211livecheck.regex     GCC (4\\.4\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.