From: Michel Dänzer Date: Tue, 15 Aug 2017 00:41:57 +0000 (+0900) Subject: configure: Check llvm-config --shared-mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c5717a4de2a2406a7e155de641921571a3910c7;p=mesa.git configure: Check llvm-config --shared-mode https://bugs.llvm.org/show_bug.cgi?id=6823 still affects current LLVM. llvm-config --libs only reports the single shared library if LLVM was built with -DLLVM_LINK_LLVM_DYLIB=ON. llvm-config --shared-mode reports "shared" in that case, "static" otherwise (even if LLVM was built with -DLLVM_BUILD_LLVM_DYLIB=ON). v2: Keep the LLVM < 4.0 test. (llvm-config --shared-mode is actually available since LLVM 3.8, but that would make the test too complicated :) Fixes: 3d8da1f678e1 ("configure: Trust LLVM >= 4.0 llvm-config --libs for shared libraries") Bugzilla: https://bugs.freedesktop.org/102247 Tested-by: Dieter Nützel --- diff --git a/configure.ac b/configure.ac index e3babd3909a..52645bb44ff 100644 --- a/configure.ac +++ b/configure.ac @@ -2646,7 +2646,7 @@ if test "x$enable_llvm" = xyes; then LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`" if test "x$enable_llvm_shared_libs" = xyes; then - if test $LLVM_VERSION_MAJOR -lt 4; then + if test $LLVM_VERSION_MAJOR -lt 4 -o "`$LLVM_CONFIG --shared-mode ${LLVM_COMPONENTS}`" = static; then dnl llvm-config may not give the right answer when llvm is a built as a dnl single shared library, so we must work the library name out for dnl ourselves.