[Mesa-dev] [PATCH 3/6] configure.ac: Only define HAVE_LLVM if LLVM is used

Tobias Droste tdroste at gmx.de
Thu Dec 8 02:03:37 UTC 2016


Make sure that HAVE_LLVM compiler define is only set if LLVM is
actually used.

Signed-off-by: Tobias Droste <tdroste at gmx.de>
---
 configure.ac | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index a209d87e62..7362ecdfaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -996,7 +996,6 @@ llvm_set_environment_variables() {
             LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}"
         fi
 
-        DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
         FOUND_LLVM=yes
         USE_LLVM=no
     else
@@ -2564,6 +2563,12 @@ if test "x$enable_gallium_llvm" == "xyes"; then
     HAVE_GALLIUM_LLVM=yes
 fi
 
+dnl Set HAVE_LLVM compiler define if LLVM is used.
+
+if test "x$USE_LLVM" == xyes; then
+    DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
+fi
+
 dnl Set LLVM_LIBS - This is done after the driver configuration so
 dnl that drivers can add additional components to LLVM_COMPONENTS.
 dnl Previously, gallium drivers were updating LLVM_LIBS directly
-- 
2.11.0



More information about the mesa-dev mailing list