summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Cafarelli <voyageur@gentoo.org>2011-11-09 15:11:48 +0000
committerBernard Cafarelli <voyageur@gentoo.org>2011-11-09 15:11:48 +0000
commit8fef8615762b9c3f2841d2f83d649e10a5cdb5b5 (patch)
tree2e5b3825c10bb2c129c1506b2f46b9372b6403ea /sys-devel/clang
parentMaintainance release (diff)
downloadgentoo-2-8fef8615762b9c3f2841d2f83d649e10a5cdb5b5.tar.gz
gentoo-2-8fef8615762b9c3f2841d2f83d649e10a5cdb5b5.tar.bz2
gentoo-2-8fef8615762b9c3f2841d2f83d649e10a5cdb5b5.zip
Add rc release to prepare for 3.0, remove llvm-gcc detection code (not used in configure anymore). Also fix bug #387309, thanks to Stephan Wezel <s.wezel@web.de> for the patch
(Portage version: 2.2.0_alpha72/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel/clang')
-rw-r--r--sys-devel/clang/ChangeLog10
-rw-r--r--sys-devel/clang/clang-3.0_rc1.ebuild183
-rw-r--r--sys-devel/clang/clang-9999.ebuild7
-rw-r--r--sys-devel/clang/files/clang-3.0-fix_cxx_include_root.patch25
4 files changed, 220 insertions, 5 deletions
diff --git a/sys-devel/clang/ChangeLog b/sys-devel/clang/ChangeLog
index 1957ed46c3b4..1f64a43ae591 100644
--- a/sys-devel/clang/ChangeLog
+++ b/sys-devel/clang/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-devel/clang
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.43 2011/10/04 11:52:07 voyageur Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.44 2011/11/09 15:11:48 voyageur Exp $
+
+*clang-3.0_rc1 (09 Nov 2011)
+
+ 09 Nov 2011; Bernard Cafarelli <voyageur@gentoo.org> +clang-3.0_rc1.ebuild,
+ +files/clang-3.0-fix_cxx_include_root.patch, clang-9999.ebuild:
+ Add rc release to prepare for 3.0, remove llvm-gcc detection code (not used
+ in configure anymore). Also fix bug #387309, thanks to Stephan Wezel
+ <s.wezel@web.de> for the patch
04 Oct 2011; Bernard Cafarelli <voyageur@gentoo.org> clang-2.8-r3.ebuild,
clang-2.9-r1.ebuild, clang-9999.ebuild:
diff --git a/sys-devel/clang/clang-3.0_rc1.ebuild b/sys-devel/clang/clang-3.0_rc1.ebuild
new file mode 100644
index 000000000000..0fee9d7f749a
--- /dev/null
+++ b/sys-devel/clang/clang-3.0_rc1.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-3.0_rc1.ebuild,v 1.1 2011/11/09 15:11:48 voyageur Exp $
+
+EAPI=3
+
+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/pre-releases/${PV/_rc*}/${PV/3.0_}/sources/llvm-${PV/_}.src.tar.gz
+ http://llvm.org/pre-releases/${PV/_rc*}/${PV/3.0_}/sources/${P/_}.src.tar.gz"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="debug multitarget +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 )"
+RDEPEND="~sys-devel/llvm-${PV}[multitarget=]"
+
+S="${WORKDIR}/llvm-${PV/_}"
+
+src_prepare() {
+ # Leftover in rc1, remove for real release
+ rm -f "${S}"/tools/clang
+
+ mv "${WORKDIR}"/clang-${PV/_} "${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 cxx_include_root path for Gentoo
+ epatch "${FILESDIR}"/${P/_*}-fix_cxx_include_root.patch
+ # 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#${EPREFIX}/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 := '"${EPREFIX}"'/etc/llvm,' \
+ -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/llvm, \
+ -i Makefile.config.in || die "Makefile.config sed failed"
+
+ einfo "Fixing rpath and CFLAGS"
+ sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
+ -e '/OmitFramePointer/s/-fomit-frame-pointer//' \
+ -i Makefile.rules || die "rpath sed failed"
+}
+
+src_configure() {
+ local CONF_FLAGS="--enable-shared
+ --with-optimize-option=
+ $(use_enable !debug optimized)
+ $(use_enable debug assertions)
+ $(use_enable debug expensive-checks)"
+
+ # Setup the search path to include the Prefix includes
+ if use prefix ; then
+ CONF_FLAGS="${CONF_FLAGS} \
+ --with-c-include-dirs=${EPREFIX}/usr/include:/usr/include"
+ fi
+
+ if use multitarget; then
+ CONF_FLAGS="${CONF_FLAGS} --enable-targets=all"
+ else
+ CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only"
+ fi
+
+ if use amd64; then
+ CONF_FLAGS="${CONF_FLAGS} --enable-pic"
+ fi
+
+ if use system-cxx-headers; then
+ # Try to get current gcc headers path
+ local CXX_PATH=$(gcc-config -X| cut -d: -f1 | sed 's,/include/g++-v4$,,')
+ CONF_FLAGS="${CONF_FLAGS} --with-c-include-dirs=/usr/include:${CXX_PATH}/include"
+ CONF_FLAGS="${CONF_FLAGS} --with-cxx-include-root=${CXX_PATH}/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"
+}
+
+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
+ has test $FEATURES && die "Make test failed. See above for details."
+ has 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 "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
+ }
+ python_execute_function install-scan-view
+ fi
+
+ # Fix install_names on Darwin. The build system is too complicated
+ # to just fix this, so we correct it post-install
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ for lib in libclang.dylib ; do
+ ebegin "fixing install_name of $lib"
+ install_name_tool -id "${EPREFIX}"/usr/lib/llvm/${lib} \
+ "${ED}"/usr/lib/llvm/${lib}
+ eend $?
+ done
+ for f in usr/bin/{c-index-test,clang} usr/lib/llvm/libclang.dylib ; do
+ ebegin "fixing references in ${f##*/}"
+ install_name_tool \
+ -change "@rpath/libclang.dylib" \
+ "${EPREFIX}"/usr/lib/llvm/libclang.dylib \
+ -change "@executable_path/../lib/libLLVM-${PV}.dylib" \
+ "${EPREFIX}"/usr/lib/llvm/libLLVM-${PV}.dylib \
+ -change "${S}"/Release/lib/libclang.dylib \
+ "${EPREFIX}"/usr/lib/llvm/libclang.dylib \
+ "${ED}"/$f
+ eend $?
+ done
+ fi
+}
+
+pkg_postinst() {
+ python_mod_optimize clang
+ 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() {
+ python_mod_cleanup clang
+}
diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild
index 052c9831b985..2d0a787fb792 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 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.17 2011/10/04 11:52:07 voyageur Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-9999.ebuild,v 1.18 2011/11/09 15:11:48 voyageur Exp $
EAPI=3
@@ -39,6 +39,8 @@ src_prepare() {
sed -e "/PROJ_headers/s#lib/clang#$(get_libdir)/clang#" \
-i tools/clang/lib/Headers/Makefile \
|| die "clang Makefile failed"
+ # Fix cxx_include_root path for Gentoo
+ epatch "${FILESDIR}"/${PN}-3.0-fix_cxx_include_root.patch
# fix the static analyzer for in-tree install
sed -e 's/import ScanView/from clang \0/' \
-i tools/clang/tools/scan-view/scan-view \
@@ -85,9 +87,6 @@ src_configure() {
CONF_FLAGS="${CONF_FLAGS} --enable-pic"
fi
- # Skip llvm-gcc parts even if installed
- CONF_FLAGS="${CONF_FLAGS} --with-llvmgccdir=/dev/null"
-
if use system-cxx-headers; then
# Try to get current gcc headers path
local CXX_PATH=$(gcc-config -X| cut -d: -f1 | sed 's,/include/g++-v4$,,')
diff --git a/sys-devel/clang/files/clang-3.0-fix_cxx_include_root.patch b/sys-devel/clang/files/clang-3.0-fix_cxx_include_root.patch
new file mode 100644
index 000000000000..e0baab13affe
--- /dev/null
+++ b/sys-devel/clang/files/clang-3.0-fix_cxx_include_root.patch
@@ -0,0 +1,25 @@
+Bug #387309
+
+--- llvm/tools/clang/lib/Driver/ToolChains.cpp.orig 2011-10-16 19:27:45.505711873 +0200
++++ llvm/tools/clang/lib/Driver/ToolChains.cpp 2011-10-16 19:30:22.810705290 +0200
+@@ -1563,15 +1563,16 @@
+ // and this function would return
+ // CXX_GCC_ROOT/lib/gcc/CXX_INCLUDE_ARCH/CXX_GCC_VER
+ if (CxxIncludeRoot != "") {
+- // This is of the form /foo/bar/include/c++/4.5.2/
++ // This is of the form /usr/lib/gcc/<ARCH>/<Version>/include/g++-v4
+ if (CxxIncludeRoot.back() == '/')
+ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the /
++ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the g++-v4
++ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the include
+ StringRef Version = llvm::sys::path::filename(CxxIncludeRoot);
+ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the version
+- llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the c++
+- llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the include
++ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the ARCH
+ GccInstallPath = CxxIncludeRoot.str();
+- GccInstallPath.append("/lib/gcc/");
++ GccInstallPath.append("/");
+ GccInstallPath.append(CXX_INCLUDE_ARCH);
+ GccInstallPath.append("/");
+ GccInstallPath.append(Version);