summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorTobias Droste <[email protected]>2016-11-19 02:38:54 +0100
committerEmil Velikov <[email protected]>2016-12-05 14:43:46 +0000
commit352831c5d9fcef43804ed2153d509b2d43cf44e9 (patch)
tree1ec65db31b3732a7393426ec527af5d4c1a9908f /configure.ac
parent2350387d24d6f2470450ee9e78792a9ee957034b (diff)
configure.ac: Add helper function for targets/components
Add functions to add and check targets/components. Not used in this patch. Signed-off-by: Tobias Droste <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac36
1 files changed, 36 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index fbe6fda0138..08f511c443e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -863,6 +863,42 @@ fi
AC_SUBST([SELINUX_CFLAGS])
AC_SUBST([SELINUX_LIBS])
+dnl
+dnl LLVM
+dnl
+llvm_add_component() {
+ new_llvm_component=$1
+ driver_name=$2
+
+ LLVM_COMPONENTS="$LLVM_COMPONENTS $new_llvm_component"
+}
+
+llvm_add_default_components() {
+ driver_name=$1
+
+ # Required default components
+ llvm_add_component "bitwriter" $driver_name
+ llvm_add_component "engine" $driver_name
+ llvm_add_component "mcdisassembler" $driver_name
+ 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_target() {
+ new_llvm_target=$1
+ driver_name=$2
+
+ if $LLVM_CONFIG --targets-built | grep -iqw $new_llvm_target ; then
+ llvm_add_component $new_llvm_target $driver_name
+ else
+ AC_MSG_ERROR([LLVM target '$new_llvm_target' not enabled in your LLVM build. Required by $driver_name.])
+ fi
+}
+
dnl Options for APIs
AC_ARG_ENABLE([opengl],
[AS_HELP_STRING([--disable-opengl],