configure.ac: Move llvm_set_environment_variables higher.
authorTobias Droste <tdroste@gmx.de>
Sat, 19 Nov 2016 01:39:04 +0000 (02:39 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 5 Dec 2016 14:43:46 +0000 (14:43 +0000)
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@gmx.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
12 files changed:
configure.ac
src/gallium/auxiliary/Makefile.am
src/gallium/targets/d3dadapter9/Makefile.am
src/gallium/targets/dri/Makefile.am
src/gallium/targets/libgl-xlib/Makefile.am
src/gallium/targets/omx/Makefile.am
src/gallium/targets/osmesa/Makefile.am
src/gallium/targets/pipe-loader/Makefile.am
src/gallium/targets/va/Makefile.am
src/gallium/targets/vdpau/Makefile.am
src/gallium/targets/xa/Makefile.am
src/gallium/targets/xvmc/Makefile.am

index 1de6b7e905d33dfa4c69aa2f188db890aba23354..3e9972c7e3204f64bcdc3a4046954e64d5d3cb48 100644 (file)
@@ -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.])
index 4a4a4fb89cfaf75895ce3167c777e84d78af9707..0d1aee69ff0e7bee2e5c3f47e067cc4d7e3762ab 100644 (file)
@@ -20,7 +20,7 @@ libgallium_la_SOURCES = \
        $(NIR_SOURCES) \
        $(GENERATED_SOURCES)
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 
 AM_CFLAGS += \
        $(LLVM_CFLAGS)
index c37da9864c4494b8faf98d765fee531c26b1b1fe..a3d2416c319a3d8f7988f298f66d1bef7f0ec7e7 100644 (file)
@@ -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)
index 06ade45fe1b0572181776103c5fae500c3fc2b63..0527e9f2b1e162f85ee007d72efee4ac75e1809e 100644 (file)
@@ -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
index 3f1382e28482b2b4a9a735a56ca85c925eece82f..6f966c3aebe219e55602e5000bbcc0a02feab80c 100644 (file)
@@ -75,7 +75,7 @@ lib@GL_LIB@_la_LIBADD = \
        $(GL_LIB_DEPS) \
        $(CLOCK_LIB)
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 lib@GL_LIB@_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 lib@GL_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
index 3bdb9eb7e61e09cd3e2538fd8365684c4c3012c4..29ba242b362d09e353578dcb096342073dfbea65 100644 (file)
@@ -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
index 5d394866946405056093f0c55b75734d8b0a56cb..6d340f1d92cef6451c42d8c56ba9cec228961180 100644 (file)
@@ -68,7 +68,7 @@ lib@OSMESA_LIB@_la_LIBADD = \
        $(OSMESA_LIB_DEPS) \
        $(CLOCK_LIB)
 
-if HAVE_MESA_LLVM
+if HAVE_GALLIUM_LLVM
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 lib@OSMESA_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
 lib@OSMESA_LIB@_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
index ce504cfd7ef7852715d772474bbddd9f619e3155..7bcf9905d802a5f1612b7465177f8950abaaed99 100644 (file)
@@ -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
index df825b764a8bd238b35f93ce8f379a8251e15af4..afaa85bf9a94137d9e0db26fcea8f58908799047 100644 (file)
@@ -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
index d388f8b5014c0b9a9382480b3e891acae71525f7..97c0ab27f514033161c04898b3c4ea60bc7e43d2 100644 (file)
@@ -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
index cdd9a862e4a12815afa59d83f2587ba4ee49ed8f..cd065fc11c76481ba2d433202530ae6c39918e79 100644 (file)
@@ -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
index fdc5f4b7318722b8acbfd794654735483d7e1add..c8bac58961d91b2e89b6d1b3944c9f83c85bf3a9 100644 (file)
@@ -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