source: trunk/dports/lang/gcc43/Portfile @ 83904

Last change on this file since 83904 was 83904, checked in by jmr@…, 6 years ago

gcc4*: set more accurate license

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 83904 2011-09-12 17:40:37Z jmr@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6
7name            gcc43
8version         4.3.6
9revision        0
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++, Java and Fortran95.
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
26set dcore       gcc-core-${version}.tar.bz2
27set dfort       gcc-fortran-${version}.tar.bz2
28set dcxx        gcc-g++-${version}.tar.bz2
29set djava       gcc-java-${version}.tar.bz2
30set dobjc       gcc-objc-${version}.tar.bz2
31distfiles       ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}
32
33checksums           gcc-core-${version}.tar.bz2 \
34                    md5     43df9ad8b4bb314a46bac12f5aefaec2 \
35                    sha1    d9dc274ad558194e7d9bacc49c333a4870d7e613 \
36                    rmd160  d4bed0820d5eae5072e30fa66167fda4fc2f0bbc \
37                    gcc-fortran-${version}.tar.bz2 \
38                    md5     c6eeee73007015c52043716fbe8ffdc7 \
39                    sha1    20d9f1293857d24e4a69996f91875718e3217ae3 \
40                    rmd160  ca92b43af16f6837d99f839a76547cd0610fbc58 \
41                    gcc-g++-${version}.tar.bz2 \
42                    md5     ee7dc01b6e1a6a92a6e8d66adb8d2ab9 \
43                    sha1    91afb0336103204731d5d8156790b97005869d1f \
44                    rmd160  90e5836b9b5e16a378b93f093dec78e917ae3f9c \
45                    gcc-java-${version}.tar.bz2 \
46                    md5     b5c12ad38048c354686747d640f5d621 \
47                    sha1    0216314c694642e0b16418a1259bd0f90987107e \
48                    rmd160  bfc0ac76397e81ccfeb9334966359e668a961d8e \
49                    gcc-objc-${version}.tar.bz2 \
50                    md5     3fdb8158eabb765d1711f894bf71f7f5 \
51                    sha1    437833d7211118f8647941c1a78531ec125f97c2 \
52                    rmd160  cde38f66b4b952f52938dc50d7606a0e1ccc7d2f
53
54use_bzip2       yes
55
56depends_lib     port:gmp port:mpfr port:libiconv
57depends_run     port:gcc_select
58
59patchfiles      Make-lang.in.diff darwin10.diff i386_multilib.diff
60patch.dir       ${workpath}/gcc-${version}
61
62set major       4.3
63
64worksrcdir      build
65
66post-extract {
67    file mkdir ${worksrcpath}
68}
69
70# the generated compiler doesn't accept -arch
71configure.cc_archflags
72configure.cxx_archflags
73configure.objc_archflags
74configure.ld_archflags
75platform darwin {
76    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
77}
78
79configure.cmd   ../gcc-${version}/configure
80configure.args  --enable-languages=c,c++,objc,obj-c++,java,fortran \
81        --libdir=${prefix}/lib/${name} \
82        --includedir=${prefix}/include/${name} \
83        --infodir=${prefix}/share/info \
84        --mandir=${prefix}/share/man \
85        --with-local-prefix=${prefix} \
86        --with-system-zlib \
87        --disable-nls \
88        --program-suffix=-mp-${major} \
89        --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
90        --with-gmp=${prefix} \
91        --with-mpfr=${prefix} \
92        --disable-multilib
93# do NOT use MacPorts binutils -- they do not work
94configure.env-append    AR_FOR_TARGET=/usr/bin/ar \
95            AS_FOR_TARGET=/usr/bin/as \
96            LD_FOR_TARGET=/usr/bin/ld \
97            NM_FOR_TARGET=/usr/bin/nm \
98            OBJDUMP_FOR_TARGET=/usr/bin/objdump \
99            RANLIB_FOR_TARGET=/usr/bin/ranlib \
100            STRIP_FOR_TARGET=/usr/bin/strip
101
102# http://trac.macports.org/ticket/29104
103if {${configure.compiler} == "llvm-gcc-4.2"} {
104    configure.compiler clang
105}
106
107# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
108# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
109# -std=gnu89 : for building with compilers that default to c99
110# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
111#                       exposed in libc headers for fortified string functions.
112#                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
113#                       because STAGE1_CFLAGS is used with xgcc for libgcc
114if {${configure.compiler} == "clang"} {
115    # -O1 in STAGE1_CFLAGS : <rdar://problem/9720596>, fixed in llvm trunk r134428
116    build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O1 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
117} else {
118    build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
119}
120
121use_parallel_build  yes
122
123destroot.target install install-info-host
124# install-info # errors on objc-info files
125
126post-destroot {
127    # move manuals to gcc43-specific directory
128    xinstall -m 755 -d ${destroot}${prefix}/share/gcc43/man/man7
129    xinstall -m 755 -d ${destroot}${prefix}/share/gcc43/info
130    eval xinstall -m 0644 [glob ${destroot}${prefix}/share/man/man7/*]  ${destroot}${prefix}/share/gcc43/man/man7
131    eval xinstall -m 0644 [glob ${destroot}${prefix}/share/info/*] ${destroot}${prefix}/share/gcc43/info
132    # install/copy ffitarget.h only if we have it
133    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
134        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
135    }
136}
137
138select.group    gcc
139select.file     ${filespath}/mp-${name}
140
141# Java support does not compile on 10.4/x86
142platform darwin 8 i386 {
143        configure.args-delete   --enable-languages=c,c++,objc,obj-c++,java,fortran
144        configure.args-append   --enable-languages=c,c++,objc,obj-c++,fortran
145}
146
147# odcctools currently do not compile for x64 - move to variant for the time being
148#variant odcctools \
149#   description "Use the odcctools instead of the system provided ones - does not work for x64 currently!" {
150#   depends_lib-append  port:odcctools
151#   patch {
152#       reinplace "s|/usr/bin/libtool|${prefix}/bin/odlibtool|g" \
153#           ${workpath}/gcc-${version}/gcc/config/darwin.h
154#   }
155#   configure.args-append   --with-as=${prefix}/bin/odas \
156#               --with-ld=${prefix}/bin/odld \
157#               --with-ar=${prefix}/bin/odar
158#}
159
160platform powerpc {
161    configure.universal_archs ppc ppc64
162}
163platform i386 {
164    configure.universal_archs i386 x86_64
165}
166configure.universal_cflags
167configure.universal_cxxflags
168configure.universal_ldflags
169configure.universal_args
170variant universal {
171    configure.args-delete --disable-multilib
172}
173
174livecheck.type  regex
175livecheck.url   http://gcc.gnu.org/gcc-4.3/
176livecheck.regex GCC (4\\.3\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.