[Mesa-dev] [PATCH v3 25/25] configure.ac: Add required LLVM versions to the top
Tobias Droste
tdroste at gmx.de
Tue Oct 11 23:02:52 UTC 2016
Consolidate the required LLVM versions at the top where the other
versions for dependencies are listed.
Rework the LLVM_VERSION and LLVM_VERSION_INT calculation to make the
format "x.y.z." possible.
LLVM_VERSION_INT is now including LLVM_VERSION_PATCH.
For the C define HAVE_LLVM is set now which does not include
LLVM_VERSION_PATCH.
Signed-off-by: Tobias Droste <tdroste at gmx.de>
---
configure.ac | 47 +++++++++++++++++++++++++++++++++--------------
1 file changed, 33 insertions(+), 14 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4847704..0d1530c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,15 @@ XVMC_REQUIRED=1.0.6
PYTHON_MAKO_REQUIRED=0.8.0
LIBSENSORS_REQUIRED=4.0.0
+dnl LLVM versions
+LLVM_VERSION_REQUIRED_GALLIUM=3.3.0
+LLVM_VERSION_REQUIRED_LLVMPIPE=3.6.0
+LLVM_VERSION_REQUIRED_OPENCL=3.6.0
+LLVM_VERSION_REQUIRED_R600=3.6.0
+LLVM_VERSION_REQUIRED_RADEONSI=3.6.0
+LLVM_VERSION_REQUIRED_RADV=3.9.0
+LLVM_VERSION_REQUIRED_SWR=3.6.0
+
dnl Check for progs
AC_PROG_CPP
AC_PROG_CC
@@ -935,29 +944,38 @@ llvm_get_version() {
[#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
[#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
+ AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH],
+ [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
+
+ if test -z "$LLVM_VERSION_PATCH"; then
+ LLVM_VERSION_PATCH=`echo $LLVM_VERSION | cut -d. -f3 | egrep -o '^[[0-9]]+'`
+ fi
- LLVM_VERSION_PATCH=`echo $LLVM_VERSION | cut -d. -f3 | egrep -o '^[[0-9]]+'`
if test -z "$LLVM_VERSION_PATCH"; then
LLVM_VERSION_PATCH=0
fi
if test -n "${LLVM_VERSION_MAJOR}"; then
- LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
- else
- LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
+ LLVM_VERSION="${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}"
fi
- DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
+ LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\.\([[1-9]][[0-9]]\)\.\([[0-9]]\)/\1\2/' -e 's/\.\([[0-9]]\)\.\([[0-9]]\)/0\1\2/' -e 's/\.\([[1-9]][[0-9]]\)/\10/' -e 's/\.\([[0-9]]\)/0\10/'`
+ HAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\.\([[1-9]][[0-9]]\)\.\([[0-9]]\)/\1/' -e 's/\.\([[0-9]]\)\.\([[0-9]]\)/0\1/' -e 's/\.\([[1-9]][[0-9]]\)/\1/' -e 's/\.\([[0-9]]\)/0\1/'`
+
+ DEFINES="${DEFINES} -DHAVE_LLVM=0x0$HAVE_LLVM -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
MESA_LLVM=1
else
MESA_LLVM=0
LLVM_VERSION_INT=0
+ LLVM_VERSION=0.0.0
fi
}
llvm_check_version_for() {
- if test "${LLVM_VERSION_INT}${LLVM_VERSION_PATCH}" -lt "${1}0${2}${3}"; then
- AC_MSG_ERROR([LLVM $1.$2.$3 or newer is required for $4])
+ llvm_target_version=`echo $1 | sed -e 's/\.\([[1-9]][[0-9]]\)\.\([[0-9]]\)/\1\2/' -e 's/\.\([[0-9]]\)\.\([[0-9]]\)/0\1\2/' -e 's/\.\([[1-9]][[0-9]]\)/\10/' -e 's/\.\([[0-9]]\)/0\10/'`
+
+ if test "x$MESA_LLVM" = x0 || test "${LLVM_VERSION_INT}" -lt "${llvm_target_version}"; then
+ AC_MSG_ERROR([LLVM $1 or newer is required for $2])
fi
}
@@ -999,7 +1017,7 @@ llvm_add_target() {
}
radeon_llvm_check() {
- if test ${LLVM_VERSION_INT} -lt 307; then
+ if test ${LLVM_VERSION_INT} -lt 3070; then
amdgpu_llvm_target_name='r600'
else
amdgpu_llvm_target_name='amdgpu'
@@ -1888,7 +1906,7 @@ if test -n "$with_vulkan_drivers"; then
;;
xradeon)
PKG_CHECK_MODULES([AMDGPU], [libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
- radeon_llvm_check "3" "9" "0" "radv"
+ radeon_llvm_check $LLVM_VERSION_REQUIRED_RADV "radv"
HAVE_RADEON_VULKAN=yes;
if test "x$with_sha1" == "x"; then
AC_MSG_ERROR([radv vulkan driver requires SHA1])
@@ -2177,7 +2195,7 @@ if test "x$enable_opencl" = xyes; then
AC_MSG_ERROR([Clover requires libelf])
fi
- llvm_check_version_for "3" "6" "0" "opencl"
+ llvm_check_version_for $LLVM_VERSION_REQUIRED_OPENCL "opencl"
llvm_add_default_components
llvm_add_component "all-targets" "opencl"
@@ -2393,7 +2411,7 @@ gallium_require_llvm() {
AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
fi
- llvm_check_version_for "3" "3" "0" "gallium"
+ llvm_check_version_for $LLVM_VERSION_REQUIRED_GALLIUM "gallium"
llvm_add_target "x86" "gallium"
llvm_add_default_components
;;
@@ -2498,7 +2516,7 @@ if test -n "$with_gallium_drivers"; then
gallium_require_drm "r600"
gallium_require_drm_loader
if test "x$enable_opencl" = xyes; then
- radeon_llvm_check "3" "6" "0" "r600"
+ radeon_llvm_check $LLVM_VERSION_REQUIRED_R600 "r600"
gallium_require_llvm "r600"
llvm_add_component "bitreader" "r600"
llvm_add_component "asmparser" "r600"
@@ -2510,7 +2528,7 @@ if test -n "$with_gallium_drivers"; then
PKG_CHECK_MODULES([AMDGPU], [libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
gallium_require_drm "radeonsi"
gallium_require_drm_loader
- radeon_llvm_check "3" "6" "0" "radeonsi"
+ radeon_llvm_check $LLVM_VERSION_REQUIRED_RADEONSI "radeonsi"
gallium_require_llvm "radeonsi"
require_egl_drm "radeonsi"
;;
@@ -2529,12 +2547,13 @@ if test -n "$with_gallium_drivers"; then
xswrast)
HAVE_GALLIUM_SOFTPIPE=yes
if test "x$MESA_LLVM" = x1 && (test "x$enable_gallium_llvm" = xyes || test "x$enable_gallium_llvm" = xauto); then
+ llvm_check_version_for $LLVM_VERSION_REQUIRED_LLVMPIPE "llvmpipe"
gallium_require_llvm "llvmpipe"
HAVE_GALLIUM_LLVMPIPE=yes
fi
;;
xswr)
- llvm_check_version_for "3" "6" "0" "swr"
+ llvm_check_version_for $LLVM_VERSION_REQUIRED_SWR "swr"
gallium_require_llvm "swr"
swr_require_cxx_feature_flags "C++11" "__cplusplus >= 201103L" \
--
2.10.0
More information about the mesa-dev
mailing list