summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/clang')
-rw-r--r--sys-devel/clang/ChangeLog8
-rw-r--r--sys-devel/clang/Manifest5
-rw-r--r--sys-devel/clang/clang-2.7-r1.ebuild142
-rw-r--r--sys-devel/clang/clang-9999.ebuild13
4 files changed, 163 insertions, 5 deletions
diff --git a/sys-devel/clang/ChangeLog b/sys-devel/clang/ChangeLog
index 1a1b09b4d3b2..dd8d96dc8e36 100644
--- a/sys-devel/clang/ChangeLog
+++ b/sys-devel/clang/ChangeLog
@@ -1,6 +1,12 @@
# 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.16 2010/07/20 09:28:09 voyageur Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.17 2010/07/20 09:35:43 voyageur Exp $
+
+*clang-2.7-r1 (20 Jul 2010)
+
+ 20 Jul 2010; Bernard Cafarelli <voyageur@gentoo.org> +clang-2.7-r1.ebuild,
+ clang-9999.ebuild:
+ Get C++ headers from active gcc version, bug #327575
20 Jul 2010; Bernard Cafarelli <voyageur@gentoo.org> -clang-2.6-r3.ebuild,
-files/llvm-2.6-cflags.patch, -files/clang-2.6-fixdoc.patch,
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest
index f062c6fac3f9..29ab18ffe0e7 100644
--- a/sys-devel/clang/Manifest
+++ b/sys-devel/clang/Manifest
@@ -1,7 +1,8 @@
AUX clang-2.7-fixdoc.patch 1977 RMD160 62f52e5580baa396d93c56735c0039c8691b43b6 SHA1 351c1d2cf86b6da75a6ed19083d7a857333f007c SHA256 36c2214e575ed3fd78938279739e82c4f750f8726f8387e1414c18532501314a
DIST clang-2.7.tgz 4953739 RMD160 177fdcf59be4a60c37cf0dfb058535c9cdbbad4e SHA1 4d8326bfe2308a7355a5e4ca2eb172bffd761e1e SHA256 fb349471947f155c1cda1c8a4a3bbc7fa437b86f6875d9978f86c915dfed623a
DIST llvm-2.7.tgz 8374297 RMD160 0fa2f362dd6a45efec35ce8fa0f8d36d98f32c8f SHA1 059fc21b0ec1b649c4a3dec81756e5f92aa131a2 SHA256 99664bdc8503a306038166af33f28eb426d99e297575a59d74a1a0dcbddbbca5
+EBUILD clang-2.7-r1.ebuild 4485 RMD160 8a166967b4c8d1c438c403ec166b5409af437575 SHA1 450638be607cfd9129303a85e9a234486c0b8184 SHA256 2ba395e018e5bae97fcb773ba35066ad56e5a47b817200d34003d63507124e0b
EBUILD clang-2.7.ebuild 3957 RMD160 58ee1b5fee888f1140fe531b69e1384daff924b2 SHA1 8c93df183c694fa262f6d471065c7cb52eae9e24 SHA256 c80168384d384bd7ce1a790b67bdb17b6268e862b12b7e78f4d6883ce0a67dff
-EBUILD clang-9999.ebuild 3997 RMD160 5d794c52c44ce11ba40a37cee10d5f170080f726 SHA1 64664d40403a628c272360b3fbc6811d50fc6932 SHA256 24c949c97f6f782344379be1c277c40993bfd4b93a975c327a78a5517ae398f0
-MISC ChangeLog 2778 RMD160 e323c1da9d147df3a750d25c5ea153281415023b SHA1 d91032bfab081035cc6eb3b130b74cb145adb7e9 SHA256 fb1fd5442e60f763ebc15e1cb68683b6ecec2528f3cef40fa9f6219638e6e02d
+EBUILD clang-9999.ebuild 4522 RMD160 318c33f07d4a5d786274d9e15ce83899e64e0c14 SHA1 735e54147b49d4967d844ed05d3d197a7b02b357 SHA256 d06f4332f49fcf95db1fbb41b11baf00fab47818332c91f86554a07901f71271
+MISC ChangeLog 2961 RMD160 afa92805aacc7ecd1d3c0d331b834b071d9e8d4e SHA1 5cf1bd385864eb2d1feaae16c7daf7cd04e8b27e SHA256 06f72a66d8a1273209e1d48ba2d2f9226fac661df16c1d7074fb846fe578258b
MISC metadata.xml 1098 RMD160 472ed702bea452e68447b59908bc9279bbb890dd SHA1 ef26faea642b17778814391ccd3016f933ec8e12 SHA256 2d18687396a420ad6aa7179f1104b90962514d2fcf94e3838ce82cd109b359c0
diff --git a/sys-devel/clang/clang-2.7-r1.ebuild b/sys-devel/clang/clang-2.7-r1.ebuild
new file mode 100644
index 000000000000..0a5242811297
--- /dev/null
+++ b/sys-devel/clang/clang-2.7-r1.ebuild
@@ -0,0 +1,142 @@
+# 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 $
+
+EAPI=2
+
+RESTRICT_PYTHON_ABIS="3.*"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit eutils multilib python
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="http://clang.llvm.org/"
+# Fetching LLVM as well: see http://llvm.org/bugs/show_bug.cgi?id=4840
+SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tgz
+ http://llvm.org/releases/${PV}/${P}.tgz"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug +static-analyzer 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 )
+ test? ( dev-util/dejagnu )"
+RDEPEND="~sys-devel/llvm-${PV}"
+
+S="${WORKDIR}/llvm-2.7"
+
+src_prepare() {
+ mv "${WORKDIR}"/clang-2.7 "${S}"/tools/clang || die "clang source directory not found"
+
+ # Same as llvm doc patches
+ epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch
+
+ # multilib-strict
+ sed -e "/PROJ_headers/s#lib/clang#$(get_libdir)/clang#" \
+ -i tools/clang/lib/Headers/Makefile \
+ || die "clang Makefile failed"
+ # fix the static analyzer for in-tree install
+ sed -e 's/import ScanView/from clang \0/' \
+ -i tools/clang/tools/scan-view/scan-view \
+ || die "scan-view sed failed"
+ sed -e "/scanview.css\|sorttable.js/s#\$RealBin#/usr/share/${PN}#" \
+ -i tools/clang/tools/scan-build/scan-build \
+ || die "scan-build sed failed"
+ # Specify python version
+ python_convert_shebangs 2 tools/clang/tools/scan-view/scan-view
+
+ # From llvm src_prepare
+ einfo "Fixing install dirs"
+ sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
+ -e 's,^PROJ_etcdir.*,PROJ_etcdir := /etc/llvm,' \
+ -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir), \
+ -i Makefile.config.in || die "Makefile.config sed failed"
+
+ einfo "Fixing rpath"
+ sed -e 's/\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))//g' -i Makefile.rules \
+ || die "rpath sed failed"
+}
+
+src_configure() {
+ local CONF_FLAGS=""
+
+ if use debug; then
+ CONF_FLAGS="${CONF_FLAGS} --disable-optimized"
+ einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries"
+ # ...and you probably shouldn't use tmpfs, unless it can hold 900MB
+ else
+ CONF_FLAGS="${CONF_FLAGS} \
+ --enable-optimized \
+ --disable-assertions \
+ --disable-expensive-checks"
+ fi
+
+ if use amd64; then
+ CONF_FLAGS="${CONF_FLAGS} --enable-pic"
+ fi
+
+ # 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"
+ fi
+ econf ${CONF_FLAGS} || die "econf failed"
+}
+
+src_compile() {
+ emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 clang-only || die "emake failed"
+}
+
+src_test() {
+ cd "${S}"/test || die "cd failed"
+ emake site.exp || die "updating llvm site.exp failed"
+
+ cd "${S}"/tools/clang || die "cd clang failed"
+
+ echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ if ! emake -j1 VERBOSE=1 test; then
+ hasq test $FEATURES && die "Make test failed. See above for details."
+ hasq test $FEATURES || eerror "Make test failed. See above for details."
+ fi
+}
+
+src_install() {
+ cd "${S}"/tools/clang || die "cd clang failed"
+ emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
+
+ if use static-analyzer ; then
+ dobin tools/scan-build/ccc-analyzer
+ dosym ccc-analyzer /usr/bin/c++-analyzer
+ dobin tools/scan-build/scan-build
+
+ insinto /usr/share/${PN}
+ doins tools/scan-build/scanview.css
+ doins tools/scan-build/sorttable.js
+
+ cd tools/scan-view || die "cd scan-view failed"
+ dobin scan-view
+ install-scan-view() {
+ insinto "$(python_get_sitedir)"/clang
+ doins Reporter.py Resources ScanView.py startfile.py
+ touch "${D}"/"$(python_get_sitedir)"/clang/__init__.py
+ }
+ python_execute_function install-scan-view
+ fi
+}
+
+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"
+}
+
+pkg_postrm() {
+ python_mod_cleanup clang
+}
diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild
index 1d351664ab39..dc5b6ef988a2 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -1,13 +1,13 @@
# 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.2 2010/06/02 08:29:27 voyageur Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-9999.ebuild,v 1.3 2010/07/20 09:35:43 voyageur Exp $
EAPI=2
RESTRICT_PYTHON_ABIS="3.*"
SUPPORT_PYTHON_ABIS="1"
-inherit subversion eutils python
+inherit subversion eutils multilib python
DESCRIPTION="C language family frontend for LLVM"
HOMEPAGE="http://clang.llvm.org/"
@@ -83,6 +83,12 @@ 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"
+ fi
econf ${CONF_FLAGS} || die "econf failed"
}
@@ -129,6 +135,9 @@ 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"
}
pkg_postrm() {