# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ EAPI=6 : ${CMAKE_MAKEFILE_GENERATOR:=ninja} CMAKE_MIN_VERSION=3.4.3 PYTHON_COMPAT=( python2_7 ) inherit check-reqs cmake-utils flag-o-matic git-r3 multilib-minimal \ python-single-r1 toolchain-funcs pax-utils DESCRIPTION="C language family frontend for LLVM" HOMEPAGE="http://llvm.org/" SRC_URI="" EGIT_REPO_URI="http://llvm.org/git/clang.git https://github.com/llvm-mirror/clang.git" LICENSE="UoI-NCSA" SLOT="0/${PV%.*}" KEYWORDS="" IUSE="debug default-compiler-rt default-libcxx +doc multitarget python +static-analyzer test xml video_cards_radeon elibc_musl kernel_FreeBSD" RDEPEND=" ~sys-devel/llvm-${PV}:=[debug=,multitarget?,video_cards_radeon?,${MULTILIB_USEDEP}] static-analyzer? ( dev-lang/perl:* ) xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) ! clang-X.Y # - clang++, clang-cl -> clang # we want to have: # - clang-X.Y # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y # - clang, clang++, clang-cl -> clang*-X.Y # so we need to fix the two tools for i in "${clang_tools[@]:1}"; do rm "${ED%/}/usr/bin/${i}" || die dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}" dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}" done # now prepend ${CHOST} and let the multilib-build.eclass symlink it if ! multilib_is_native_abi; then # non-native? let's replace it with a simple wrapper for i in "${clang_tools[@]}"; do rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die cat > "${T}"/wrapper.tmp <<-_EOF_ #!${EPREFIX}/bin/sh exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}" _EOF_ newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}" done fi } multilib_src_install_all() { if use python ; then pushd bindings/python/clang >/dev/null || die python_moduleinto clang python_domodule *.py popd >/dev/null || die fi python_fix_shebang "${ED}" if use static-analyzer; then python_optimize "${ED}"usr/share/scan-view fi } pkg_postinst() { if ! has_version 'sys-libs/libomp'; then elog "To enable OpenMP support in clang, install sys-libs/libomp." fi }