commit:     958e93248a7304267883968e2fc8e58a14f07cdb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  6 12:47:20 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr  6 12:48:02 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=958e9324

sys-devel/clang: Enable support for Z3 backend in -9999

 sys-devel/clang/clang-9999.ebuild | 11 +++++++++--
 sys-devel/clang/metadata.xml      |  1 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/sys-devel/clang/clang-9999.ebuild 
b/sys-devel/clang/clang-9999.ebuild
index c28114fd1a9..05f378ffda7 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -27,11 +27,15 @@ LICENSE="UoI-NCSA"
 SLOT="5"
 KEYWORDS=""
 IUSE="debug default-compiler-rt default-libcxx +doc multitarget
-       +static-analyzer test xml elibc_musl kernel_FreeBSD 
${ALL_LLVM_TARGETS[*]}"
+       +static-analyzer test xml z3 elibc_musl kernel_FreeBSD
+       ${ALL_LLVM_TARGETS[*]}"
 
 RDEPEND="
        ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// 
/,},${MULTILIB_USEDEP}]
-       static-analyzer? ( dev-lang/perl:* )
+       static-analyzer? (
+               dev-lang/perl:*
+               z3? ( sci-mathematics/z3:0= )
+       )
        xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
        ${PYTHON_DEPS}"
 # configparser-3.2 breaks the build (3.3 or none at all are fine)
@@ -170,6 +174,9 @@ multilib_src_configure() {
 
                -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
                -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+               # z3 is not multilib-friendly
+               -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
+               -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
        )
        use test && mycmakeargs+=(
                -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"

diff --git a/sys-devel/clang/metadata.xml b/sys-devel/clang/metadata.xml
index 38b8ec4ab6a..03502538f63 100644
--- a/sys-devel/clang/metadata.xml
+++ b/sys-devel/clang/metadata.xml
@@ -31,5 +31,6 @@ Conformance with C/C++/ObjC and their 
variants</longdescription>
                <flag name="default-libcxx">Use libc++ instead of libstdc++ as 
the default stdlib for clang</flag>
                <flag name="multitarget">Build all host targets (default: host 
only)</flag>
                <flag name="static-analyzer">Install the Clang static 
analyzer</flag>
+               <flag name="z3">Enable the static analyzer constraint manager 
backend using <pkg>sci-mathematics/z3</pkg></flag>
        </use>
 </pkgmetadata>

Reply via email to