--- toolchain.eclass.orig 2006-03-12 21:44:23.000000000 -0800 +++ toolchain.eclass 2006-03-12 23:01:06.000000000 -0800 @@ -2,6 +2,10 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.250 2006/03/10 00:46:18 vapier Exp $ +# Maybe this should go in gcc-*.ebuild instead, but +# the overlay is smaller this way: +GDC_VER="0.17" + HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" LICENSE="GPL-2 LGPL-2.1" RESTRICT="nostrip" # cross-compilers need controlled stripping @@ -136,6 +140,7 @@ if [[ ${PN} != "kgcc64" ]] ; then IUSE="${IUSE} altivec bootstrap build fortran gcj gtk hardened multilib nls nocxx objc vanilla" + [[ -n ${GDC_VER} ]] && IUSE="${IUSE} dlang" [[ -n ${PIE_VER} ]] && IUSE="${IUSE} nopie" [[ -n ${PP_VER} ]] && IUSE="${IUSE} nossp" [[ -n ${HTB_VER} ]] && IUSE="${IUSE} boundschecking" @@ -334,6 +339,14 @@ )" fi + # D language frontend + if [[ -n ${GDC_VER} ]] ; then + GCC_SRC_URI="${GCC_SRC_URI} + dlang? ( + http://home.earthlink.net/~dvdfrdmn/d/gdc-${GDC_VER}.tar.bz2 + )" + fi + echo "${GCC_SRC_URI}" } S=$(gcc_get_s_dir) @@ -1014,6 +1027,11 @@ ${ETYPE}_src_unpack || die "failed to ${ETYPE}_src_unpack" + if use dlang ; then + einfo "Unpacking GDC ${GDC_VER} ..." + tar -xf "${DISTDIR}"/gdc-${GDC_VER}.tar.bz2 -C gcc + fi + fix_files="" for x in contrib/test_summary libstdc++-v3/scripts/check_survey.in ; do [[ -e ${x} ]] && fix_files="${fix_files} ${x}" @@ -1123,6 +1141,7 @@ esac GCC_LANG="c" + is_dlang && GCC_LANG="${GCC_LANG},d" is_cxx && GCC_LANG="${GCC_LANG},c++" is_gcj && GCC_LANG="${GCC_LANG},java" if is_objc || is_objcxx ; then @@ -1469,6 +1488,12 @@ [[ ! -x /usr/bin/perl ]] && [[ -n ${MAN_VER} ]] && \ unpack gcc-${MAN_VER}-manpages.tar.bz2 + if use dlang ; then + einfo "Setting up GDC ${GDC_VER} ..." + cd ${S} + ./gcc/d/setup-gcc.sh || die + fi + einfo "Configuring ${PN} ..." gcc_do_configure @@ -2214,6 +2239,12 @@ # [[ " ${TOOLCHAIN_ALLOWED_LANGS} " != " "*$1*" " ]] } +is_dlang() { + gcc-lang-supported 'd' || return 1 + use build && return 1 + use dlang +} + is_cxx() { gcc-lang-supported 'c++' || return 1 is_allowed 'c++' || return 1