summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Cafarelli <voyageur@gentoo.org>2010-07-27 13:06:47 +0000
committerBernard Cafarelli <voyageur@gentoo.org>2010-07-27 13:06:47 +0000
commit47b0fe524081658791dbcc4b9a005401fd7d7347 (patch)
treef843d8a10a16fb3c15165285840fcc072251e7ef /sys-devel
parentFix net-snmp automagic dependency (bug #330043, thanks to Timo Gurr). Cleanup... (diff)
downloadgentoo-2-47b0fe524081658791dbcc4b9a005401fd7d7347.tar.gz
gentoo-2-47b0fe524081658791dbcc4b9a005401fd7d7347.tar.bz2
gentoo-2-47b0fe524081658791dbcc4b9a005401fd7d7347.zip
Add a USE-flag for system CXX headers, fix for x86. llvm-gcc users should leave the flag off
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/clang/ChangeLog9
-rw-r--r--sys-devel/clang/clang-2.7-r2.ebuild (renamed from sys-devel/clang/clang-2.7-r1.ebuild)29
-rw-r--r--sys-devel/clang/clang-9999.ebuild27
-rw-r--r--sys-devel/clang/metadata.xml1
4 files changed, 46 insertions, 20 deletions
diff --git a/sys-devel/clang/ChangeLog b/sys-devel/clang/ChangeLog
index dd8d96dc8e36..ed74ff43e0a9 100644
--- a/sys-devel/clang/ChangeLog
+++ b/sys-devel/clang/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-devel/clang
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.17 2010/07/20 09:35:43 voyageur Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.18 2010/07/27 13:06:47 voyageur Exp $
+
+*clang-2.7-r2 (27 Jul 2010)
+
+ 27 Jul 2010; Bernard Cafarelli <voyageur@gentoo.org> -clang-2.7-r1.ebuild,
+ +clang-2.7-r2.ebuild, clang-9999.ebuild, metadata.xml:
+ Add a USE-flag for system CXX headers, fix for x86. llvm-gcc users should
+ leave the flag off
*clang-2.7-r1 (20 Jul 2010)
diff --git a/sys-devel/clang/clang-2.7-r1.ebuild b/sys-devel/clang/clang-2.7-r2.ebuild
index 0a5242811297..421d384538a0 100644
--- a/sys-devel/clang/clang-2.7-r1.ebuild
+++ b/sys-devel/clang/clang-2.7-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.7-r1.ebuild,v 1.1 2010/07/20 09:35:43 voyageur Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.7-r2.ebuild,v 1.1 2010/07/27 13:06:47 voyageur Exp $
EAPI=2
@@ -18,7 +18,7 @@ SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tgz
LICENSE="UoI-NCSA"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-IUSE="debug +static-analyzer test"
+IUSE="debug +static-analyzer system-cxx-headers test"
# Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
DEPEND="static-analyzer? ( dev-lang/perl )
@@ -80,12 +80,15 @@ src_configure() {
# Skip llvm-gcc parts even if installed
CONF_FLAGS="${CONF_FLAGS} --with-llvmgccdir=/dev/null"
- # Try to get current C++ headers path
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=$(gcc-config -X| cut -d: -f1)/include/g++-v4"
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-arch=$CHOST"
- if has_multilib_profile; then
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-32bit-dir=32"
+ if use system-cxx-headers; then
+ # Try to get current C++ headers path
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=$(gcc-config -X| cut -d: -f1 | sed '/-v4$/! s,$,/include/g++-v4,')"
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-arch=$CHOST"
+ if has_multilib_profile; then
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-32bit-dir=32"
+ fi
fi
+
econf ${CONF_FLAGS} || die "econf failed"
}
@@ -132,9 +135,15 @@ src_install() {
pkg_postinst() {
python_mod_optimize clang
- elog "C++ headers search path is hardcoded to the active gcc profile one"
- elog "If you change the active gcc profile, or update gcc to a new version,"
- elog "you will have to remerge this package to update the search path"
+ if use system-cxx-headers; then
+ elog "C++ headers search path is hardcoded to the active gcc profile one"
+ elog "If you change the active gcc profile, or update gcc to a new version,"
+ elog "you will have to remerge this package to update the search path"
+ else
+ elog "If clang++ fails to find C++ headers on your system,"
+ elog "you can remerge clang with USE=system-cxx-headers to use C++ headers"
+ elog "from the active gcc profile"
+ fi
}
pkg_postrm() {
diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild
index dc5b6ef988a2..bb2d4b53da0b 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-9999.ebuild,v 1.3 2010/07/20 09:35:43 voyageur Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-9999.ebuild,v 1.4 2010/07/27 13:06:47 voyageur Exp $
EAPI=2
@@ -83,12 +83,15 @@ src_configure() {
# Skip llvm-gcc parts even if installed
CONF_FLAGS="${CONF_FLAGS} --with-llvmgccdir=/dev/null"
- # Try to get current C++ headers path
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=$(gcc-config -X| cut -d: -f1)/include/g++-v4"
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-arch=$CHOST"
- if has_multilib_profile; then
- CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-32bit-dir=32"
+ if use system-cxx-headers; then
+ # Try to get current C++ headers path
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=$(gcc-config -X| cut -d: -f1 | sed '/-v4$/! s,$,/include/g++-v4,')"
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-arch=$CHOST"
+ if has_multilib_profile; then
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-32bit-dir=32"
+ fi
fi
+
econf ${CONF_FLAGS} || die "econf failed"
}
@@ -135,9 +138,15 @@ src_install() {
pkg_postinst() {
python_mod_optimize clang
- elog "C++ headers search path is hardcoded to the active gcc profile one"
- elog "If you change the active gcc profile, or update gcc to a new version,"
- elog "you will have to remerge this package to update the search path"
+ if use system-cxx-headers; then
+ elog "C++ headers search path is hardcoded to the active gcc profile one"
+ elog "If you change the active gcc profile, or update gcc to a new version,"
+ elog "you will have to remerge this package to update the search path"
+ else
+ elog "If clang++ fails to find C++ headers on your system,"
+ elog "you can remerge clang with USE=system-cxx-headers to use C++ headers"
+ elog "from the active gcc profile"
+ fi
}
pkg_postrm() {
diff --git a/sys-devel/clang/metadata.xml b/sys-devel/clang/metadata.xml
index 4527f3eb8502..d6429cc3d137 100644
--- a/sys-devel/clang/metadata.xml
+++ b/sys-devel/clang/metadata.xml
@@ -30,5 +30,6 @@ A single unified parser for C, Objective C, C++, and Objective C++
Conformance with C/C++/ObjC and their variants</longdescription>
<use>
<flag name='static-analyzer'>Install the Clang static analyzer</flag>
+ <flag name='system-cxx-headers'>By default, clang++ searchs for C++ headers in a series of hardcoded paths. Enabling this flag will force it to use the active gcc profile ones</flag>
</use>
</pkgmetadata>