diff options
author | Tobias Droste <[email protected]> | 2016-11-19 02:39:09 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-12-05 14:43:47 +0000 |
commit | 45c8a4ea0a19f092c69ed9cd0f0a2cab81716d02 (patch) | |
tree | 232116eb4a50976c69df09a64bc768461471e078 | |
parent | a8ae340f7e198f9a4b8b125a5e0e28c3be0f1237 (diff) |
configure.ac: Only add default LLVM components if needed
LLVM components are only added when LLVM is needed.
This means gallium adds this as soon as "--enable-gallium-llvm"
is "yes" and radv + opencl add it explicitly.
v5:
Removed hunk that disabled LLVM for gallium if it was not found.
Signed-off-by: Tobias Droste <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
-rw-r--r-- | configure.ac | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index cd42bdddd06..3acaa4448e3 100644 --- a/configure.ac +++ b/configure.ac @@ -899,7 +899,11 @@ llvm_add_component() { new_llvm_component=$1 driver_name=$2 - LLVM_COMPONENTS="$LLVM_COMPONENTS $new_llvm_component" + if $LLVM_CONFIG --components | grep -iqw $new_llvm_component ; then + LLVM_COMPONENTS="${LLVM_COMPONENTS} ${new_llvm_component}" + else + AC_MSG_ERROR([LLVM component '$new_llvm_component' not enabled in your LLVM build. Required by $driver_name.]) + fi } llvm_add_default_components() { @@ -982,8 +986,6 @@ llvm_set_environment_variables() { LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'` fi - llvm_add_default_components "gallium" - DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH" MESA_LLVM=1 else @@ -1009,6 +1011,7 @@ radeon_llvm_check() { llvm_add_target $amdgpu_llvm_target_name $4 + llvm_add_default_components $4 llvm_add_component "bitreader" $4 llvm_add_component "ipo" $4 @@ -2134,6 +2137,7 @@ if test "x$enable_opencl" = xyes; then llvm_check_version_for "3" "6" "0" "opencl" + llvm_add_default_components "opencl" llvm_add_component "all-targets" "opencl" llvm_add_component "linker" "opencl" llvm_add_component "instrumentation" "opencl" @@ -2508,6 +2512,11 @@ if test -n "$with_gallium_drivers"; then done fi +if test "x$enable_gallium_llvm" == "xyes"; then + llvm_check_version_for "3" "3" "0" "gallium" + llvm_add_default_components "gallium" +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 |