sys-devel/clang: Enable support for Z3 backend in -9999
authorMichał Górny <mgorny@gentoo.org>
Thu, 6 Apr 2017 12:47:20 +0000 (14:47 +0200)
committerMichał Górny <mgorny@gentoo.org>
Thu, 6 Apr 2017 12:48:02 +0000 (14:48 +0200)
sys-devel/clang/clang-9999.ebuild
sys-devel/clang/metadata.xml

index c28114fd1a917cf226902d433111e0946cbdd800..05f378ffda76812e951c01668bad52c4ad01b4bb 100644 (file)
@@ -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"
index 38b8ec4ab6ab71138b7cd48f929b280668006776..03502538f638aecbe5b561b1b6ae8e8d367707da 100644 (file)
@@ -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>