build: Use pkg-config to check for libxcb.

This commit is contained in:
Henri Verbeet 2016-11-03 12:40:54 +01:00
parent f17742401a
commit f9805396d9
2 changed files with 5 additions and 5 deletions

View File

@ -87,6 +87,7 @@ tests_d3d12_LDADD = $(LDADD) @PTHREAD_LIBS@
noinst_PROGRAMS = $(vkd3d_demos)
EXTRA_DIST += $(vkd3d_demos_headers)
EXTRA_demos_triangle_DEPENDENCIES = $(spv_triangle_shaders)
demos_triangle_CFLAGS = @XCB_CFLAGS@
demos_triangle_LDADD = libvkd3d.la $(LDADD) @XCB_LIBS@
VKD3D_V_WIDL = $(vkd3d_v_widl_@AM_V@)

View File

@ -49,18 +49,17 @@ AS_IF([test "x$ac_cv_header_pthread_h" != "xyes"], [AC_MSG_ERROR([pthread.h not
AS_IF([test "x$ac_cv_header_vulkan_vulkan_h" != "xyes"], [AC_MSG_ERROR([vulkan.h not found.])])
dnl Check for libraries
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG], [m4_fatal([pkg-config autoconf macros not found.])])
AC_ARG_VAR([PTHREAD_LIBS], [linker flags for pthreads])
AC_CHECK_LIB([pthread], [pthread_create],
[AC_SUBST(PTHREAD_LIBS, "-lpthread")],
[AC_MSG_ERROR(libpthread not found.)])
AC_ARG_VAR([XCB_LIBS], [linker flags for xcb])
AC_CHECK_LIB([xcb], [xcb_connect],
[AC_SUBST(XCB_LIBS, "-lxcb")],
[AC_MSG_ERROR([libxcb not found.])])
AC_CHECK_LIB([vulkan], [vkGetInstanceProcAddr], [], [AC_MSG_ERROR([libvulkan not found.])])
PKG_CHECK_MODULES([XCB], [xcb], [], [AC_MSG_ERROR[libxcb not found.]])
dnl Check for functions
VKD3D_CHECK_SYNC_ADD_AND_FETCH_FUNC
VKD3D_CHECK_SYNC_SUB_AND_FETCH_FUNC