-PKG_CHECK_MODULES(LIBDRI2, libdri2)
-PKG_CHECK_MODULES(X11, x11)
-PKG_CHECK_MODULES(CAPI, capi-base-common)
-# PKG_CHECK_MODULES(CAPI, capi-base-common >= 0.1.1)
+PKG_CHECK_MODULES(WL_CLIENT, wayland-client)
+PKG_CHECK_MODULES(WL_SERVER, wayland-server)
+PKG_CHECK_MODULES(WL_SCANNER, wayland-scanner)
+PKG_CHECK_MODULES(LIBPNG, libpng)
+PKG_CHECK_MODULES(LIBPIXMAN, pixman-1)
+PKG_CHECK_MODULES(GMOCK, gmock)
+
+LIBTBM_CFLAGS+="$LIBTBM_CFALGS $HAL_API_TBM_CFLAGS $LIBDRM_CFLAGS $CAPI_CFLAGS $WL_CLIENT_CFLAGS $WL_SERVER_CFLAGS $LIBPNG_CFLAGS $LIBPIXMAN_CFLAGS "
+LIBTBM_LIBS+="$LIBTBM_LIBS $HAL_API_TBM_LIBS $LIBDRM_LIBS $CAPI_LIBS $WL_CLIENT_LIBS $WL_SERVER_LIBS $LIBPNG_LIBS $LIBPIXMAN_LIBS "
+
+LIBTBM_TEST_CFLAGS="$GMOCK_CFLAGS"
+LIBTBM_TEST_LIBS="$GMOCK_LIBS"
+
+PKG_CHECK_EXISTS([dlog], [have_dlog="yes"], [have_dlog="no"])
+AC_MSG_CHECKING([Have dlog logger])
+AC_MSG_RESULT([${have_dlog}])
+if test "x${have_dlog}" = "xyes"; then
+ AC_DEFINE([HAVE_DLOG], [1], [Define to 1 if you have dlog])
+
+ PKG_CHECK_MODULES(DLOG, dlog)
+
+ LIBTBM_CFLAGS+="$DLOG_CFLAGS "
+ LIBTBM_LIBS+="$DLOG_LIBS "
+fi