configure: check once for DRI3 dependencies
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 27 Nov 2016 00:25:28 +0000 (00:25 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 19 May 2017 18:44:15 +0000 (19:44 +0100)
Currently we are having the XCB_DRI3 dependencies duplicated,
partially.

Just do a once-off check and add all of the respective CFLAGS/LIBS
where needed.

As a nice side effect this helps us solve a couple of FIXMEs.

DRI3 is not a thing w/o X11 so disable it in such cases.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
13 files changed:
configure.ac
src/amd/vulkan/Makefile.am
src/gallium/auxiliary/Makefile.am
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
src/intel/Makefile.vulkan.am
src/vulkan/Makefile.am

index e6dcea7329359ab3f3d0da439a75080af9a8d15a..14f0c6e3c80523f08c30ca2c7349c828689a0ae6 100644 (file)
@@ -1536,15 +1536,10 @@ xdri)
 
             PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
             GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
+
             if test x"$enable_dri" = xyes; then
                dri_modules="$dri_modules xcb-dri2 >= $XCBDRI2_REQUIRED"
             fi
-
-            if test x"$enable_dri3" = xyes; then
-               PKG_CHECK_EXISTS([xcb >= $XCB_REQUIRED], [], AC_MSG_ERROR([DRI3 requires xcb >= $XCB_REQUIRED]))
-               dri3_modules="xcb xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
-               PKG_CHECK_MODULES([XCB_DRI3], [$dri3_modules])
-            fi
         fi
         if test x"$dri_platform" = xapple ; then
             DEFINES="$DEFINES -DGLX_USE_APPLEGL"
@@ -1725,6 +1720,13 @@ if test "x$enable_glx" != xno; then
     fi
 fi
 
+if test x"$enable_dri3" = xyes; then
+    DEFINES="$DEFINES -DHAVE_DRI3"
+
+    dri3_modules="x11-xcb xcb >= $XCB_REQUIRED xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
+    PKG_CHECK_MODULES([XCB_DRI3], [$dri3_modules])
+fi
+
 AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
 AM_CONDITIONAL(HAVE_PLATFORM_WAYLAND, echo "$platforms" | grep -q 'wayland')
 AM_CONDITIONAL(HAVE_PLATFORM_DRM, echo "$platforms" | grep -q 'drm')
@@ -1773,10 +1775,6 @@ if test "x$enable_dri" = xyes; then
     # Platform specific settings and drivers to build
     case "$host_os" in
     linux*)
-        if test "x$enable_dri3" = xyes; then
-            DEFINES="$DEFINES -DHAVE_DRI3"
-        fi
-
         case "$host_cpu" in
         powerpc* | sparc*)
             # Build only the drivers for cards that exist on PowerPC/sparc
@@ -2088,12 +2086,7 @@ if test "x$enable_xvmc" = xyes -o \
         "x$enable_vdpau" = xyes -o \
         "x$enable_omx" = xyes -o \
         "x$enable_va" = xyes; then
-    if test x"$enable_dri3" = xyes; then
-        PKG_CHECK_MODULES([VL], [xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED
-                                 xcb-xfixes x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
-    else
-        PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
-    fi
+    PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
     need_gallium_vl_winsys=yes
 fi
 AM_CONDITIONAL(NEED_GALLIUM_VL_WINSYS, test "x$need_gallium_vl_winsys" = xyes)
index fbd9f5a030554dd25b18c822b8e39ef42d433be9..88af9102a3b0e06bf384bd788cf5c08273e3069d 100644 (file)
@@ -70,8 +70,7 @@ AM_CPPFLAGS += \
 
 VULKAN_SOURCES += $(VULKAN_WSI_X11_FILES)
 
-# FIXME: Use pkg-config for X11-xcb ldflags.
-VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS) -lX11-xcb
+VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS)
 endif
 
 
index dc4bd4a40cfac0c430f7154d670b082169a20f7e..e25e31b89eadac33f18f1ba8944368ae4e16face 100644 (file)
@@ -72,6 +72,7 @@ if NEED_GALLIUM_VL
 COMMON_VL_CFLAGS = \
        $(AM_CFLAGS) \
        $(VL_CFLAGS) \
+       $(XCB_DRI3_CFLAGS) \
        $(DRI2PROTO_CFLAGS) \
        $(LIBDRM_CFLAGS)
 
index d68746cecbd4e66b9370375d935d7c75453ef205..e2d9ec72dc63803933fd704fb5dcad6d4db1284f 100644 (file)
@@ -27,6 +27,7 @@ AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS) \
        $(VL_CFLAGS) \
+       $(XCB_DRI3_CFLAGS) \
        $(OMX_CFLAGS)
 
 noinst_LTLIBRARIES = libomxtracker.la
index a70eede537466d2cf3b11446a8a95ecea453f954..917839167bf8eb372e603f85514812fd1bde97c1 100644 (file)
@@ -27,6 +27,7 @@ AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS) \
        $(VL_CFLAGS) \
+       $(XCB_DRI3_CFLAGS) \
        $(VA_CFLAGS) \
        -DVA_DRIVER_INIT_FUNC="__vaDriverInit_$(VA_MAJOR)_$(VA_MINOR)"
 
index d7fd68b3dc630e91b6fa4cb7224fb4c6343c7d3d..e91b055177f473d347d31793b32681e92f8c7e7f 100644 (file)
@@ -30,6 +30,7 @@ AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS) \
        $(VL_CFLAGS) \
+       $(XCB_DRI3_CFLAGS) \
        $(VDPAU_CFLAGS)
 AM_CPPFLAGS = \
        -I$(top_srcdir)/include \
index 3c7c35c8c37d1cade836f1c30fe9807faa536857..398eaf6b6987004c4470ad41214ad73ebd652b1b 100644 (file)
@@ -27,6 +27,7 @@ AM_CFLAGS = \
        $(GALLIUM_CFLAGS) \
        $(VISIBILITY_CFLAGS) \
        $(VL_CFLAGS) \
+       $(XCB_DRI3_CFLAGS) \
        $(XVMC_CFLAGS)
 
 noinst_LTLIBRARIES = libxvmctracker.la
@@ -45,7 +46,7 @@ noinst_PROGRAMS = \
 
 noinst_HEADERS = tests/testlib.h
 
-TEST_LIBS = $(XVMC_LIBS) -lXvMCW $(VL_LIBS)
+TEST_LIBS = $(XVMC_LIBS) -lXvMCW $(VL_LIBS) $(XCB_DRI3_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 29ba242b362d09e353578dcb096342073dfbea65..5912241b38d1b170116430d07d1621896d3de0da 100644 (file)
@@ -30,6 +30,7 @@ libomx_mesa_la_LIBADD = \
        $(top_builddir)/src/util/libmesautil.la \
        $(OMX_LIBS) \
        $(VL_LIBS) \
+       $(XCB_DRI3_LIBS) \
        $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
index afaa85bf9a94137d9e0db26fcea8f58908799047..f8616406ada9b96094acbfab7b2e0bb18ad98c83 100644 (file)
@@ -30,6 +30,7 @@ gallium_drv_video_la_LIBADD = \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/util/libmesautil.la \
        $(VL_LIBS) \
+       $(XCB_DRI3_LIBS) \
        $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
index cd7ef982aac070b2b1ee429a4367cb7a52cfe8b5..26340f114a180b1f5293ae009cab5a61608738a9 100644 (file)
@@ -35,6 +35,7 @@ libvdpau_gallium_la_LIBADD = \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/util/libmesautil.la \
        $(VL_LIBS) \
+       $(XCB_DRI3_LIBS) \
        $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
index e29dd6a5cadc6a3c43419290773c69676aa685ad..6937850adb9dee83c1250ddf6a1538f095874ef8 100644 (file)
@@ -30,6 +30,7 @@ libXvMCgallium_la_LIBADD = \
        $(top_builddir)/src/util/libmesautil.la \
        $(XVMC_LIBS) \
        $(VL_LIBS) \
+       $(XCB_DRI3_LIBS) \
        $(LIBDRM_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
index ba6ab4fc93fcf5c253d3f39d593f825ee4d28221..ceea6b83278d4a75ca2453f0d058fbc3e282abc3 100644 (file)
@@ -121,8 +121,7 @@ VULKAN_CPPFLAGS += \
 
 VULKAN_SOURCES += $(VULKAN_WSI_X11_FILES)
 
-# FIXME: Use pkg-config for X11-xcb ldflags.
-VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS) -lX11-xcb
+VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS)
 endif
 
 
index bd66901255db56395a5279cf0f0013eb7e8bb9e2..c48245c22c9280d4aba30bd1c802b4266e8bd2a7 100644 (file)
@@ -44,8 +44,7 @@ AM_CPPFLAGS += \
 
 VULKAN_WSI_SOURCES += $(VULKAN_WSI_X11_FILES)
 
-# FIXME: Use pkg-config for X11-xcb ldflags.
-VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS) -lX11-xcb
+VULKAN_LIB_DEPS += $(XCB_DRI3_LIBS)
 endif
 
 BUILT_SOURCES += $(VULKAN_WSI_WAYLAND_GENERATED_FILES)