Mesa (master): configure.ac: add llvm_add_optional_component helper

Emil Velikov evelikov at kemper.freedesktop.org
Fri Oct 13 12:06:32 UTC 2017


Module: Mesa
Branch: master
Commit: 36d6d1e931936a80da327889862ba02942ac427b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=36d6d1e931936a80da327889862ba02942ac427b

Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Thu Oct  5 11:19:07 2017 +0100

configure.ac: add llvm_add_optional_component helper

We want to add "optional" components, which have been added with later
LLVM versions.

One such in-tree example is inteljitevents. Others are to follow
shortly.

v2: Use the correct function, add blank line between functions (Tobias)

Cc: mesa-stable at lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Tobias Droste <tdroste at gmx.de>

---

 configure.ac | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 751f70a02a..d22b522278 100644
--- a/configure.ac
+++ b/configure.ac
@@ -955,6 +955,15 @@ llvm_add_component() {
     fi
 }
 
+llvm_add_optional_component() {
+    new_llvm_component=$1
+    driver_name=$2
+
+    if $LLVM_CONFIG --components | grep -iqw $new_llvm_component ; then
+        LLVM_COMPONENTS="${LLVM_COMPONENTS} ${new_llvm_component}"
+    fi
+}
+
 llvm_add_default_components() {
     driver_name=$1
 
@@ -965,9 +974,7 @@ llvm_add_default_components() {
     llvm_add_component "mcjit" $driver_name
 
     # Optional default components
-    if $LLVM_CONFIG --components | grep -iqw inteljitevents ; then
-        LLVM_COMPONENTS="$LLVM_COMPONENTS inteljitevents"
-    fi
+    llvm_add_optional_component "inteljitevents" $driver_name
 }
 
 llvm_add_target() {




More information about the mesa-commit mailing list