# 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 eutils flag-o-matic git-r3 multilib \ multilib-minimal python-single-r1 toolchain-funcs pax-utils DESCRIPTION="Low Level Virtual Machine" HOMEPAGE="http://llvm.org/" SRC_URI="" EGIT_REPO_URI="http://llvm.org/git/llvm.git https://github.com/llvm-mirror/llvm.git" LICENSE="UoI-NCSA" SLOT="0/${PV%.*}" KEYWORDS="" IUSE="clang debug default-compiler-rt default-libcxx +doc gold libedit +libffi lldb multitarget ncurses ocaml python +sanitize +static-analyzer test xml video_cards_radeon elibc_musl kernel_Darwin kernel_FreeBSD" COMMON_DEPEND=" sys-libs/zlib:0= clang? ( static-analyzer? ( dev-lang/perl:* ) xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) ${PYTHON_DEPS} ) gold? ( >=sys-devel/binutils-2.22:*[cxx] ) libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] ) ocaml? ( >=dev-lang/ocaml-4.00.0:0= dev-ml/findlib dev-ml/ocaml-ctypes )" # configparser-3.2 breaks the build (3.3 or none at all are fine) DEPEND="${COMMON_DEPEND} dev-lang/perl >=sys-devel/make-3.81 >=sys-devel/flex-2.5.4 >=sys-devel/bison-1.875d || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5 ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx ) ) || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 ) kernel_Darwin? ( 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 fi } multilib_src_install_all() { insinto /usr/share/vim/vimfiles doins -r utils/vim/*/. # some users may find it useful dodoc utils/vim/vimrc if use clang; then pushd tools/clang >/dev/null || die if use python ; then pushd bindings/python/clang >/dev/null || die python_moduleinto clang python_domodule *.py popd >/dev/null || die fi # AddressSanitizer symbolizer (currently separate) dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py popd >/dev/null || die python_fix_shebang "${ED}" if use static-analyzer; then python_optimize "${ED}"usr/share/scan-view fi fi } pkg_postinst() { if use clang && ! has_version 'sys-libs/libomp'; then elog "To enable OpenMP support in clang, install sys-libs/libomp." fi }