automake: rework VL dependency tracking
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 9 Nov 2014 04:44:14 +0000 (04:44 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 26 Nov 2014 20:08:40 +0000 (20:08 +0000)
Set a single VL_{CFLAG,LIBS} for xcb and friends, and let each target
check for it's relevant library alone. Required as with follow up
commits we'll build aux/vl into a separate module, which needs VL_CFLAGS

Cleanup add a couple of explicit LIBDRM_LIBS linking, as aux/vl itself
requires libdrm, despite that LIBDRM_{RADEON,NOUVEAU...} may provide it
as well.

v2: Rebase. Make sure st/xvmc programs work.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
configure.ac
src/gallium/state_trackers/omx/Makefile.am
src/gallium/state_trackers/va/Makefile.am
src/gallium/state_trackers/vdpau/Makefile.am
src/gallium/state_trackers/xvmc/Makefile.am
src/gallium/targets/omx/Makefile.am
src/gallium/targets/va/Makefile.am
src/gallium/targets/vdpau/Makefile.am
src/gallium/targets/xvmc/Makefile.am

index 44a185be04c500efddb1f224ed8d36310e80b2db..882898f1d5422be65b9c93c8d1950bfbae3f6a34 100644 (file)
@@ -1375,28 +1375,35 @@ if test -n "$with_gallium_drivers" -a "x$with_gallium_drivers" != xswrast; then
     fi
 fi
 
+if test "x$enable_xvmc" = xyes -o \
+        "x$enable_vdpau" = xyes -o \
+        "x$enable_omx" = xyes -o \
+        "x$enable_va" = xyes; then
+    PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
+    need_gallium_vl=yes
+fi
+AM_CONDITIONAL(NEED_GALLIUM_VL, test "x$need_gallium_vl" = xyes)
+
 if test "x$enable_xvmc" = xyes; then
-    PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
+    PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED])
     enable_gallium_loader=$enable_shared_pipe_drivers
 fi
 AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
 
 if test "x$enable_vdpau" = xyes; then
-    PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED],
-                      [VDPAU_LIBS="`$PKG_CONFIG --libs x11-xcb xcb xcb-dri2`"])
+    PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED])
     enable_gallium_loader=$enable_shared_pipe_drivers
 fi
 AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
 
 if test "x$enable_omx" = xyes; then
-    PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
+    PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED])
     enable_gallium_loader=$enable_shared_pipe_drivers
 fi
 AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes)
 
 if test "x$enable_va" = xyes; then
-    PKG_CHECK_MODULES([VA], [libva >= $LIBVA_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED],
-                      [VA_LIBS="`$PKG_CONFIG --libs x11-xcb xcb-dri2`"])
+    PKG_CHECK_MODULES([VA], [libva >= $LIBVA_REQUIRED])
     enable_gallium_loader=$enable_shared_pipe_drivers
 fi
 AM_CONDITIONAL(HAVE_ST_VA, test "x$enable_va" = xyes)
index 68eed02e746cf2fdf0e76bbc3fc7250973e28df3..d68746cecbd4e66b9370375d935d7c75453ef205 100644 (file)
@@ -26,6 +26,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS) \
+       $(VL_CFLAGS) \
        $(OMX_CFLAGS)
 
 noinst_LTLIBRARIES = libomxtracker.la
index ec64c3f4611a1460eee589f0bce82a84ff05d34e..2a93a9043463c7e95b7f1894f594b001975d0be1 100644 (file)
@@ -26,6 +26,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS) \
+       $(VL_CFLAGS) \
        $(VA_CFLAGS) \
        -DVA_DRIVER_INIT_FUNC="__vaDriverInit_$(VA_MAJOR)_$(VA_MINOR)"
 
index a74b5bfb6f931cb0c57743fe44142823c60c0ff3..d7fd68b3dc630e91b6fa4cb7224fb4c6343c7d3d 100644 (file)
@@ -29,6 +29,7 @@ VDPAU_MINOR = 0
 AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS) \
+       $(VL_CFLAGS) \
        $(VDPAU_CFLAGS)
 AM_CPPFLAGS = \
        -I$(top_srcdir)/include \
index abaa88e44631f90becd7ff25f8698bf1898c2a7d..047d05b37193b7bf1fe7976fe255cb9b5b1c6247 100644 (file)
@@ -26,6 +26,8 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
+       $(VISIBILITY_CFLAGS) \
+       $(VL_CFLAGS) \
        $(XVMC_CFLAGS)
 
 noinst_LTLIBRARIES = libxvmctracker.la
@@ -44,7 +46,7 @@ noinst_PROGRAMS = \
 
 noinst_HEADERS = tests/testlib.h
 
-TEST_LIBS = $(XVMC_LIBS) -lXvMCW
+TEST_LIBS = $(XVMC_LIBS) -lXvMCW $(VL_LIBS)
 tests_test_context_SOURCES = tests/test_context.c tests/testlib.c
 tests_test_context_LDADD = $(TEST_LIBS)
 tests_test_surface_SOURCES = tests/test_surface.c tests/testlib.c
index 7ea3144ffd3c3307934f7d3e8853930713561689..e69b4a21cf2833472abc495cdbc05eeacb8837ee 100644 (file)
@@ -1,6 +1,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
+       $(VL_CFLAGS) \
        $(GALLIUM_TARGET_CFLAGS)
 
 omxdir = $(OMX_LIB_INSTALL_DIR)
@@ -28,6 +29,8 @@ libomx_mesa_la_LIBADD = \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/util/libmesautil.la \
        $(OMX_LIBS) \
+       $(VL_LIBS) \
+       $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
 EXTRA_libomx_mesa_la_DEPENDENCIES = omx.sym
index 53b43c642edcb5893ce7e1f1f2ae1aa8e37e537b..fee892376994af0d3f23f94464cd8e4666b89582 100644 (file)
@@ -1,6 +1,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
+       $(VL_CFLAGS) \
        $(GALLIUM_TARGET_CFLAGS)
 
 vadir = $(VA_LIB_INSTALL_DIR)
@@ -23,11 +24,13 @@ gallium_drv_video_la_LDFLAGS += \
        -Wl,--version-script=$(top_srcdir)/src/gallium/targets/va/va.sym
 endif # HAVE_LD_VERSION_SCRIPT
 
+# NOTE: gallium_drv_video does not use(link against) libva
 gallium_drv_video_la_LIBADD = \
        $(top_builddir)/src/gallium/state_trackers/va/libvatracker.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/util/libmesautil.la \
-       $(VA_LIBS) \
+       $(VL_LIBS) \
+       $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
 EXTRA_gallium_drv_video_la_DEPENDENCIES = va.sym
index 68f72a09363d20cec7759e54bf61affa0f592730..c363114c2bc9319d64bb5fe7180d04aa81f47794 100644 (file)
@@ -1,6 +1,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
+       $(VL_CFLAGS) \
        $(GALLIUM_TARGET_CFLAGS)
 
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
@@ -28,11 +29,12 @@ libvdpau_gallium_la_LDFLAGS += \
        -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn
 endif # HAVE_LD_DYNAMIC_LIST
 
+# NOTE: libvdpau_gallium does not use(link against) libvdpau
 libvdpau_gallium_la_LIBADD = \
        $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/util/libmesautil.la \
-       $(VDPAU_LIBS) \
+       $(VL_LIBS) \
        $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
index 7c8799c413ebc2622bde99f9d1fd789e0b953de4..64092f90929f3d8d44c5e0334ce7ac1c531dbfb7 100644 (file)
@@ -1,6 +1,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
+       $(VL_CFLAGS) \
        $(GALLIUM_TARGET_CFLAGS)
 
 xvmcdir = $(XVMC_LIB_INSTALL_DIR)
@@ -28,6 +29,7 @@ libXvMCgallium_la_LIBADD = \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/util/libmesautil.la \
        $(XVMC_LIBS) \
+       $(VL_LIBS) \
        $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)