1 # XCB_UTIL_COMMON(xcb-required-version, xcb-proto-required-version)
2 # -----------------------------------------------------------------
4 # Defines default options for xcb-util libraries. xorg/util/macros >=
5 # 1.6.0 is required for cross-platform compiler flags and to build
6 # library documentation.
8 AC_DEFUN([XCB_UTIL_COMMON], [
9 m4_ifndef([AX_COMPARE_VERSION],
10 [m4_fatal([could not find AX_COMPARE_VERSION in macros search path])])
12 AC_REQUIRE([AC_PROG_LIBTOOL])
14 # Define header files and pkgconfig paths
15 xcbincludedir='${includedir}/xcb'
16 AC_SUBST(xcbincludedir)
17 pkgconfigdir='${libdir}/pkgconfig'
18 AC_SUBST(pkgconfigdir)
21 PKG_CHECK_MODULES(XCB, xcb >= [$1])
23 # Check version of xcb-proto that xcb was compiled against
24 xcbproto_required=[$2]
26 AC_MSG_CHECKING([whether libxcb was compiled against xcb-proto >= $xcbproto_required])
27 xcbproto_version=`$PKG_CONFIG --variable=xcbproto_version xcb`
28 AX_COMPARE_VERSION([$xcbproto_version],[ge],[$xcbproto_required], xcbproto_ok="yes",
30 AC_MSG_RESULT([$xcbproto_ok])
32 if test $xcbproto_ok = no; then
33 AC_MSG_ERROR([libxcb was compiled against xcb-proto $xcbproto_version; it needs to be compiled against version $xcbproto_required or higher])
36 # Call macros from Xorg util-macros
37 m4_ifndef([XORG_MACROS_VERSION],
38 [m4_fatal([must install xorg-macros 1.6.0 or later before running autoconf/autogen])])
40 XORG_MACROS_VERSION([1.6.0])
42 XORG_ENABLE_DEVEL_DOCS