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

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

gcc*: Add build dependency on compiler if needed

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.1 KB
Line 
1# $Id: Portfile 102108 2013-01-28 06:22:45Z 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 {[portconfigure::compiler_is_port ${configure.compiler}]} {
125    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
126    depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
127}
128
129# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
130# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
131# -std=gnu89 : for building with clang
132# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
133#                       exposed in libc headers for fortified string functions.
134#                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
135#                       because STAGE1_CFLAGS is used with xgcc for libgcc
136build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
137build.target        bootstrap
138use_parallel_build  yes
139
140destroot.target     install install-info-host
141
142post-destroot {
143    file delete -force ${destroot}${prefix}/share/man/man7 \
144        ${destroot}${prefix}/share/info
145    # install/copy ffitarget.h only if we have it
146    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
147        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
148    }
149    file rename ${destroot}${prefix}/share/python/aotcompile.py \
150                ${destroot}${prefix}/share/python/aotcompile-44.py
151    file rename ${destroot}${prefix}/share/python/classfile.py \
152                ${destroot}${prefix}/share/python/classfile-44.py
153
154    if {[variant_isset universal]} {
155        foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
156            if {[file exists ${archdir}/libstdc++.6.dylib]} {
157                eval delete [glob ${archdir}/libstdc++*]
158
159                # This symlink is provided as a transition aide and will be removed
160                # with a future revision of this port.
161                ln -s ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib
162            }
163        }
164    }
165
166    # http://trac.macports.org/ticket/35770
167    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
168
169    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
170
171    # This symlink is provided as a transition aide and will be removed
172    # with a future revision of this port.
173    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
174}
175
176select.group        gcc
177select.file         ${filespath}/mp-${name}
178
179platform powerpc {
180    configure.universal_archs ppc ppc64
181}
182platform i386 {
183    configure.universal_archs i386 x86_64
184}
185variant universal {
186    configure.args-delete --disable-multilib
187}
188# the generated compiler doesn't accept -arch
189configure.env-append CPP="${configure.cc} -E"
190build.env-append CPP="${configure.cc} -E"
191configure.cc-append [get_canonical_archflags]
192configure.cc_archflags
193configure.cxx_archflags
194configure.objc_archflags
195configure.ld_archflags
196configure.universal_cflags
197configure.universal_cxxflags
198configure.universal_ldflags
199configure.universal_args
200
201livecheck.type      regex
202livecheck.url       http://gcc.gnu.org/gcc-4.4/
203livecheck.regex     GCC (4\\.4\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.