Mesa (master): configure.ac: Move llvm_set_environment_variables higher.

Emil Velikov evelikov at kemper.freedesktop.org
Mon Dec 5 14:45:01 UTC 2016


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

Author: Tobias Droste <tdroste at gmx.de>
Date:   Sat Nov 19 02:39:04 2016 +0100

configure.ac: Move llvm_set_environment_variables higher.

This moves the function to get the LLVM environment variables higher
in the file. It still needs to be below the "--enable-opencl" because
it uses $enable_opencl.
It can be called without condition now as it only throws errors if
openCL is enabled.

v5:
HAVE_MESA_LLVM is only used for gallium. Rename it to HAVE_GALLIUM_LLVM.
In order to only link LLVM when it is needed, HAVE_GALLIUM_LLVM is only
set if "$enable-gallium-llvm" is yes.

Signed-off-by: Tobias Droste <tdroste at gmx.de>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

---

 configure.ac                                | 11 ++++-------
 src/gallium/auxiliary/Makefile.am           |  2 +-
 src/gallium/targets/d3dadapter9/Makefile.am |  2 +-
 src/gallium/targets/dri/Makefile.am         |  2 +-
 src/gallium/targets/libgl-xlib/Makefile.am  |  2 +-
 src/gallium/targets/omx/Makefile.am         |  2 +-
 src/gallium/targets/osmesa/Makefile.am      |  2 +-
 src/gallium/targets/pipe-loader/Makefile.am |  2 +-
 src/gallium/targets/va/Makefile.am          |  2 +-
 src/gallium/targets/vdpau/Makefile.am       |  2 +-
 src/gallium/targets/xa/Makefile.am          |  2 +-
 src/gallium/targets/xvmc/Makefile.am        |  2 +-
 12 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1de6b7e..3e9972c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1189,6 +1189,8 @@ AC_ARG_ENABLE([gallium-tests],
     [enable_gallium_tests="$enableval"],
     [enable_gallium_tests=no])
 
+llvm_set_environment_variables
+
 # Option for Gallium drivers
 
 # Keep this in sync with the --with-gallium-drivers help string default value
@@ -2285,12 +2287,6 @@ if test "x$enable_gallium_llvm" = xauto; then
     i*86|x86_64|amd64) enable_gallium_llvm=yes;;
     esac
 fi
-if test "x$enable_gallium_llvm" = xyes || test "x$HAVE_RADEON_VULKAN" = xyes; then
-    llvm_set_environment_variables
-else
-    MESA_LLVM=0
-    LLVM_VERSION_INT=0
-fi
 
 dnl Directory for XVMC libs
 AC_ARG_WITH([xvmc-libdir],
@@ -2626,7 +2622,8 @@ AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$HAVE_GALLIUM_R300" = xyes -o \
 AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$enable_glx" = xgallium-xlib)
 AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
-AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
+AM_CONDITIONAL(HAVE_GALLIUM_LLVM, test "x$MESA_LLVM" = x1 -a \
+                                       "x$enable_gallium_llvm" = xyes)
 AM_CONDITIONAL(USE_VC4_SIMULATOR, test x$USE_VC4_SIMULATOR = xyes)
 if test "x$USE_VC4_SIMULATOR" = xyes -a "x$HAVE_GALLIUM_ILO" = xyes; then
     AC_MSG_ERROR([VC4 simulator on x86 replaces i965 driver build, so ilo must be disabled.])
diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
index 4a4a4fb..0d1aee6 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -20,7 +20,7 @@ libgallium_la_SOURCES = \
 	$(NIR_SOURCES) \
 	$(GENERATED_SOURCES)
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 
 AM_CFLAGS += \
 	$(LLVM_CFLAGS)
diff --git a/src/gallium/targets/d3dadapter9/Makefile.am b/src/gallium/targets/d3dadapter9/Makefile.am
index c37da98..a3d2416 100644
--- a/src/gallium/targets/d3dadapter9/Makefile.am
+++ b/src/gallium/targets/d3dadapter9/Makefile.am
@@ -114,7 +114,7 @@ d3dadapter9_la_LIBADD += \
 
 endif # HAVE_GALLIUM_STATIC_TARGETS
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 nodist_EXTRA_d3dadapter9_la_SOURCES = dummy.cpp
 d3dadapter9_la_LDFLAGS += $(LLVM_LDFLAGS)
 d3dadapter9_la_LIBADD += $(LLVM_LIBS)
diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am
index 06ade45..0527e9f2 100644
--- a/src/gallium/targets/dri/Makefile.am
+++ b/src/gallium/targets/dri/Makefile.am
@@ -112,7 +112,7 @@ gallium_dri_la_LIBADD += \
 
 endif # HAVE_GALLIUM_STATIC_TARGETS
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 gallium_dri_la_LIBADD += $(LLVM_LIBS)
 gallium_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
diff --git a/src/gallium/targets/libgl-xlib/Makefile.am b/src/gallium/targets/libgl-xlib/Makefile.am
index 3f1382e..6f966c3 100644
--- a/src/gallium/targets/libgl-xlib/Makefile.am
+++ b/src/gallium/targets/libgl-xlib/Makefile.am
@@ -75,7 +75,7 @@ lib at GL_LIB@_la_LIBADD = \
 	$(GL_LIB_DEPS) \
 	$(CLOCK_LIB)
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 lib at GL_LIB@_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 lib at GL_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
diff --git a/src/gallium/targets/omx/Makefile.am b/src/gallium/targets/omx/Makefile.am
index 3bdb9eb..29ba242 100644
--- a/src/gallium/targets/omx/Makefile.am
+++ b/src/gallium/targets/omx/Makefile.am
@@ -63,7 +63,7 @@ libomx_mesa_la_LIBADD += \
 
 endif # HAVE_GALLIUM_STATIC_TARGETS
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 libomx_mesa_la_LIBADD += $(LLVM_LIBS)
 libomx_mesa_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
diff --git a/src/gallium/targets/osmesa/Makefile.am b/src/gallium/targets/osmesa/Makefile.am
index 5d39486..6d340f1 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -68,7 +68,7 @@ lib at OSMESA_LIB@_la_LIBADD = \
 	$(OSMESA_LIB_DEPS) \
 	$(CLOCK_LIB)
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 lib at OSMESA_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
 lib at OSMESA_LIB@_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index ce504cf..7bcf990 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -71,7 +71,7 @@ AM_LDFLAGS += \
 	-Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.sym
 endif
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 PIPE_LIBS += $(LLVM_LIBS)
 AM_LDFLAGS += $(LLVM_LDFLAGS)
 endif
diff --git a/src/gallium/targets/va/Makefile.am b/src/gallium/targets/va/Makefile.am
index df825b7..afaa85b 100644
--- a/src/gallium/targets/va/Makefile.am
+++ b/src/gallium/targets/va/Makefile.am
@@ -62,7 +62,7 @@ gallium_drv_video_la_LIBADD += \
 
 endif # HAVE_GALLIUM_STATIC_TARGETS
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 gallium_drv_video_la_LIBADD += $(LLVM_LIBS)
 gallium_drv_video_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
diff --git a/src/gallium/targets/vdpau/Makefile.am b/src/gallium/targets/vdpau/Makefile.am
index d388f8b..97c0ab2 100644
--- a/src/gallium/targets/vdpau/Makefile.am
+++ b/src/gallium/targets/vdpau/Makefile.am
@@ -72,7 +72,7 @@ libvdpau_gallium_la_LIBADD += \
 
 endif # HAVE_GALLIUM_STATIC_TARGETS
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 libvdpau_gallium_la_LIBADD += $(LLVM_LIBS)
 libvdpau_gallium_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
diff --git a/src/gallium/targets/xa/Makefile.am b/src/gallium/targets/xa/Makefile.am
index cdd9a86..cd065fc 100644
--- a/src/gallium/targets/xa/Makefile.am
+++ b/src/gallium/targets/xa/Makefile.am
@@ -86,7 +86,7 @@ libxatracker_la_LIBADD += \
 
 endif # HAVE_GALLIUM_STATIC_TARGETS
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 libxatracker_la_LIBADD += $(LLVM_LIBS)
 libxatracker_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
diff --git a/src/gallium/targets/xvmc/Makefile.am b/src/gallium/targets/xvmc/Makefile.am
index fdc5f4b..c8bac58 100644
--- a/src/gallium/targets/xvmc/Makefile.am
+++ b/src/gallium/targets/xvmc/Makefile.am
@@ -60,7 +60,7 @@ libXvMCgallium_la_LIBADD += \
 
 endif # HAVE_GALLIUM_STATIC_TARGETS
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 libXvMCgallium_la_LIBADD += $(LLVM_LIBS)
 libXvMCgallium_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif




More information about the mesa-commit mailing list