summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/gcc-apple/gcc-apple-4.2.1_p5574.ebuild')
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.2.1_p5574.ebuild64
1 files changed, 30 insertions, 34 deletions
diff --git a/sys-devel/gcc-apple/gcc-apple-4.2.1_p5574.ebuild b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5574.ebuild
index 6151f9c7c515..294f930c2ddf 100644
--- a/sys-devel/gcc-apple/gcc-apple-4.2.1_p5574.ebuild
+++ b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5574.ebuild
@@ -1,6 +1,8 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/gcc-apple-4.2.1_p5574.ebuild,v 1.4 2009/09/25 20:34:17 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-apple/gcc-apple-4.2.1_p5574.ebuild,v 1.5 2010/03/08 17:12:11 grobian Exp $
+
+EAPI="3"
ETYPE="gcc-compiler"
@@ -54,19 +56,23 @@ fi
STDCXX_INCDIR=${LIBPATH}/include/g++-v${GCC_VERS/\.*/}
src_unpack() {
+ # override toolchain.eclass func
unpack ${A}
- cd "${S}"
+}
+src_prepare() {
# Support for fortran
if use fortran ; then
- cd "${WORKDIR}"/gcc-${GCC_VERS}
- # hmmm, just use rsync?
- tar cf - * | ( cd "${S}" && tar xf - )
- cd "${S}"
- # from: http://r.research.att.com/tools/
+ mv "${WORKDIR}"/gcc-${GCC_VERS}/gcc/fortran gcc/ || die
+ mv "${WORKDIR}"/gcc-${GCC_VERS}/libgfortran . || die
+ # from: substracted from http://r.research.att.com/tools/
epatch "${FILESDIR}"/${PN}-${GCC_VERS}-gfortran.patch
fi
+ # move in libstdc++
+ mv "${WORKDIR}"/libstdcxx-${LIBSTDCXX_APPLE_VERSION}/libstdcxx/libstdc++-v3 .
+ epatch "${FILESDIR}"/libstdc++-${LIBSTDCXX_APPLE_VERSION}.patch
+
# we use our libtool
sed -i -e "s:/usr/bin/libtool:${EPREFIX}/usr/bin/${CTARGET}-libtool:" \
gcc/config/darwin.h || die "sed gcc/config/darwin.h failed"
@@ -105,14 +111,17 @@ src_unpack() {
cd "${S}"/gcc && eautoconf
cd "${S}"/libgomp && eautoconf
- cd "${WORKDIR}"/libstdcxx-${LIBSTDCXX_APPLE_VERSION}/libstdcxx
- epatch "${FILESDIR}"/libstdc++-${LIBSTDCXX_APPLE_VERSION}.patch
- # copy lt-stuff that has been fixed for darwin10 in gcc but not
- # libstdcxx
- cp "${S}"/lt* . || die "failed to update libstdcxx' lt-files"
+ local BRANDING_GCC_PKGVERSION="$(sed -n -e '/^#define VERSUFFIX/s/^[^"]*"\([^"]\+\)".*$/\1/p' "${S}"/gcc/version.c)"
+ BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/)/, Gentoo ${PVR})}
+ einfo "patching gcc version: ${GCC_VERS}${BRANDING_GCC_PKGVERSION}"
+
+ sed -i -e "s~VERSUFFIX \"[^\"]*~VERSUFFIX \"${BRANDING_GCC_PKGVERSION}~" \
+ "${S}"/gcc/version.c || die "failed to update VERSUFFIX with Gentoo branding"
+ sed -i -e 's~developer\.apple\.com\/bugreporter~bugs\.gentoo\.org\/~' \
+ "${S}"/gcc/version.c || die "Failed to change the bug URL"
}
-src_compile() {
+src_configure() {
local langs="c"
use nocxx || langs="${langs},c++"
use objc && langs="${langs},objc"
@@ -178,7 +187,7 @@ src_compile() {
&& myconf="${myconf} --disable-multilib"
#libstdcxx does not support this one
- local gccconf="${myconf} --enable-languages=${langs}"
+ myconf="${myconf} --enable-languages=${langs}"
# The produced libgcc_s.dylib is faulty if using a bit too much
# optimisation. Nail it down to something sane
@@ -193,31 +202,20 @@ src_compile() {
mkdir -p "${WORKDIR}"/build
cd "${WORKDIR}"/build
- einfo "Configuring GCC with: ${gccconf//--/\n\t--}"
- "${S}"/configure ${gccconf} || die "conf failed"
- emake bootstrap || die "emake failed"
+ einfo "Configuring GCC with: ${myconf//--/\n\t--}"
+ "${S}"/configure ${myconf} || die "conf failed"
+}
- local libstdcxxconf="${myconf} --disable-libstdcxx-debug"
- mkdir -p "${WORKDIR}"/build_libstdcxx || die
- cd "${WORKDIR}"/build_libstdcxx
- #the build requires the gcc built before, so link to it
- ln -s "${WORKDIR}"/build/gcc "${WORKDIR}"/build_libstdcxx/gcc || die
- einfo "Configuring libstdcxx with: ${libstdcxxconf//--/\n\t--}"
- "${WORKDIR}"/libstdcxx-${LIBSTDCXX_APPLE_VERSION}/libstdcxx/configure ${libstdcxxconf} || die "conf failed"
- emake all || die "emake failed"
+src_compile() {
+ cd "${WORKDIR}"/build || die
+ emake bootstrap || die "emake failed"
}
src_install() {
- local ED=${ED-${D}}
-
cd "${WORKDIR}"/build
# -jX doesn't work
emake -j1 DESTDIR="${D}" install || die
- cd "${WORKDIR}"/build_libstdcxx
- emake -j1 DESTDIR="${D}" install || die
- cd "${WORKDIR}"/build
-
# Punt some tools which are really only useful while building gcc
find "${ED}" -name install-tools -prune -type d -exec rm -rf "{}" \;
# This one comes with binutils
@@ -305,8 +303,6 @@ pkg_postinst() {
}
pkg_postrm() {
- local EROOT=${EROOT-${ROOT}}
-
# clean up the cruft left behind by cross-compilers
if is_crosscompile ; then
if [[ -z $(ls "${EROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then