Skip to content

Commit

Permalink
gcc[345678]: Adjust formatting to make diffing easier to read. I also…
Browse files Browse the repository at this point in the history
… added MacPorts branding to the --version but didn't feel it was worth a revbump for

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@92418 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
jeremyhu committed Apr 28, 2012
1 parent e9c2e0f commit 6653ec7
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 375 deletions.
172 changes: 81 additions & 91 deletions lang/gcc43/Portfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem 1.0
PortGroup select 1.0

name gcc43
version 4.3.6
revision 2
platforms darwin
categories lang
maintainers mww openmaintainer
name gcc43
version 4.3.6
revision 3
platforms darwin
categories lang
maintainers mww openmaintainer
# an exception in the license allows dependents to not be GPL
license {GPL-3+ GPL-2+ Permissive}
description The GNU compiler collection
long_description The GNU compiler collection, including front ends for \
C, C++, Objective-C, Objective-C++, Java and Fortran95.

homepage http://gcc.gnu.org/
master_sites ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \
ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
gnu:gcc/gcc-${version}

set dcore gcc-core-${version}.tar.bz2
set dfort gcc-fortran-${version}.tar.bz2
set dcxx gcc-g++-${version}.tar.bz2
set djava gcc-java-${version}.tar.bz2
set dobjc gcc-objc-${version}.tar.bz2
distfiles ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}

license {GPL-3+ GPL-2+ Permissive}
description The GNU compiler collection
long_description The GNU compiler collection, including front ends for \
C, C++, Objective-C, Objective-C++, Fortran, and Java.

homepage http://gcc.gnu.org/
master_sites ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \
ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
gnu:gcc/gcc-${version}

use_bzip2 yes

set dcore gcc-core-${version}.tar.bz2
set dfort gcc-fortran-${version}.tar.bz2
set dcxx gcc-g++-${version}.tar.bz2
set djava gcc-java-${version}.tar.bz2
set dobjc gcc-objc-${version}.tar.bz2

distfiles ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}

checksums gcc-core-${version}.tar.bz2 \
md5 43df9ad8b4bb314a46bac12f5aefaec2 \
sha1 d9dc274ad558194e7d9bacc49c333a4870d7e613 \
Expand All @@ -51,19 +53,17 @@ checksums gcc-core-${version}.tar.bz2 \
sha1 437833d7211118f8647941c1a78531ec125f97c2 \
rmd160 cde38f66b4b952f52938dc50d7606a0e1ccc7d2f

use_bzip2 yes

depends_lib port:gmp port:mpfr port:libiconv
depends_run port:gcc_select port:ld64 port:cctools
depends_lib port:gmp port:mpfr port:libiconv
depends_run port:gcc_select port:ld64 port:cctools

depends_skip_archcheck-append gcc_select ld64 cctools

patchfiles Make-lang.in.diff darwin10.diff i386_multilib.diff
patch.dir ${workpath}/gcc-${version}
patchfiles Make-lang.in.diff darwin10.diff i386_multilib.diff
patch.dir ${workpath}/gcc-${version}

set major 4.3
set major 4.3

worksrcdir build
worksrcdir build

post-extract {
file mkdir ${worksrcpath}
Expand All @@ -73,33 +73,42 @@ platform darwin {
configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
}

configure.cmd ../gcc-${version}/configure
configure.args --enable-languages=c,c++,objc,obj-c++,java,fortran \
--libdir=${prefix}/lib/${name} \
--includedir=${prefix}/include/${name} \
--infodir=${prefix}/share/info \
--mandir=${prefix}/share/man \
--datadir=${prefix}/share/${name} \
--with-local-prefix=${prefix} \
--with-system-zlib \
--disable-nls \
--program-suffix=-mp-${major} \
--with-gxx-include-dir=${prefix}/include/${name}/c++/ \
--with-gmp=${prefix} \
--with-mpfr=${prefix} \
--disable-multilib \
--with-as=${prefix}/bin/as \
--with-ld=${prefix}/bin/ld \
--with-ar=${prefix}/bin/ar
configure.cmd ../gcc-${version}/configure
configure.args --enable-languages=c,c++,objc,obj-c++,java,fortran \
--libdir=${prefix}/lib/${name} \
--includedir=${prefix}/include/${name} \
--infodir=${prefix}/share/info \
--mandir=${prefix}/share/man \
--datadir=${prefix}/share/${name} \
--with-local-prefix=${prefix} \
--with-libiconv-prefix=${prefix} \
--with-system-zlib \
--disable-nls \
--program-suffix=-mp-${major} \
--with-gxx-include-dir=${prefix}/include/${name}/c++/ \
--with-gmp=${prefix} \
--with-mpfr=${prefix} \
--enable-stage1-checking \
--disable-multilib \
--with-as=${prefix}/bin/as \
--with-ld=${prefix}/bin/ld \
--with-ar=${prefix}/bin/ar \
--with-bugurl=https://trac.macports.org/newticket

configure.env-append \
AR_FOR_TARGET=${prefix}/bin/ar \
AS_FOR_TARGET=${prefix}/bin/as \
LD_FOR_TARGET=${prefix}/bin/ld \
NM_FOR_TARGET=${prefix}/bin/nm \
OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
STRIP_FOR_TARGET=${prefix}/bin/strip
AR_FOR_TARGET=${prefix}/bin/ar \
AS_FOR_TARGET=${prefix}/bin/as \
LD_FOR_TARGET=${prefix}/bin/ld \
NM_FOR_TARGET=${prefix}/bin/nm \
OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
STRIP_FOR_TARGET=${prefix}/bin/strip \
OTOOL=${prefix}/bin/otool \
OTOOL64=${prefix}/bin/otool

pre-configure {
configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
}

# http://trac.macports.org/ticket/29104
if {${configure.compiler} == "llvm-gcc-4.2"} {
Expand All @@ -108,52 +117,33 @@ if {${configure.compiler} == "llvm-gcc-4.2"} {

# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
# -std=gnu89 : for building with compilers that default to c99
# -std=gnu89 : for building with clang
# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
# exposed in libc headers for fortified string functions.
# Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
# because STAGE1_CFLAGS is used with xgcc for libgcc
if {${configure.compiler} == "clang"} {
# -O1 in STAGE1_CFLAGS : <rdar://problem/9720596>, fixed in llvm trunk r134428
build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O1 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
} else {
build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
}

build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
build.target bootstrap
use_parallel_build yes

destroot.target install install-info-host
# install-info # errors on objc-info files
destroot.target install install-info-host

post-destroot {
# move manuals to gcc43-specific directory
xinstall -m 755 -d ${destroot}${prefix}/share/gcc43/man/man7
xinstall -m 755 -d ${destroot}${prefix}/share/gcc43/info
eval xinstall -m 0644 [glob ${destroot}${prefix}/share/man/man7/*] ${destroot}${prefix}/share/gcc43/man/man7
eval xinstall -m 0644 [glob ${destroot}${prefix}/share/info/*] ${destroot}${prefix}/share/gcc43/info
file delete -force ${destroot}${prefix}/share/man/man7 \
${destroot}${prefix}/share/info
# install/copy ffitarget.h only if we have it
if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
}

foreach file {cpp cppinternals gcc gccinstall gccint gfortran libgomp} {
system -W ${destroot}${prefix}/share/info "mv ${file}.info ${file}-${major}.info"
}

if {${os.major} != 8 || ${build_arch} != "i386"} {
foreach file {cp-tools gcj} {
system -W ${destroot}${prefix}/share/info "mv ${file}.info ${file}-${major}.info"
}
}
}

select.group gcc
select.file ${filespath}/mp-${name}
select.group gcc
select.file ${filespath}/mp-${name}

# Java support does not compile on 10.4/x86
platform darwin 8 i386 {
configure.args-delete --enable-languages=c,c++,objc,obj-c++,java,fortran
configure.args-append --enable-languages=c,c++,objc,obj-c++,fortran
configure.args-delete --enable-languages=c,c++,objc,obj-c++,java,fortran
configure.args-append --enable-languages=c,c++,objc,obj-c++,fortran
}

platform powerpc {
Expand All @@ -178,6 +168,6 @@ configure.universal_cxxflags
configure.universal_ldflags
configure.universal_args

livecheck.type regex
livecheck.url http://gcc.gnu.org/gcc-4.3/
livecheck.regex GCC (4\\.3\\.\[0-9\])
livecheck.type regex
livecheck.url http://gcc.gnu.org/gcc-4.3/
livecheck.regex GCC (4\\.3\\.\[0-9\])
Loading

0 comments on commit 6653ec7

Please sign in to comment.