xcb_util_common.m4 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # XCB_UTIL_COMMON(xcb-required-version, xcb-proto-required-version)
  2. # -----------------------------------------------------------------
  3. #
  4. # Defines default options for xcb-util libraries. xorg/util/macros >=
  5. # 1.16.0 is required for cross-platform compiler flags and to build
  6. # library documentation.
  7. #
  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])])
  11. AC_REQUIRE([AC_PROG_LIBTOOL])
  12. # Define header files and pkgconfig paths
  13. xcbincludedir='${includedir}/xcb'
  14. AC_SUBST(xcbincludedir)
  15. pkgconfigdir='${libdir}/pkgconfig'
  16. AC_SUBST(pkgconfigdir)
  17. # Check xcb version
  18. PKG_CHECK_MODULES(XCB, xcb >= [$1])
  19. # Check version of xcb-proto that xcb was compiled against
  20. xcbproto_required=[$2]
  21. AC_MSG_CHECKING([whether libxcb was compiled against xcb-proto >= $xcbproto_required])
  22. xcbproto_version=`$PKG_CONFIG --variable=xcbproto_version xcb`
  23. AX_COMPARE_VERSION([$xcbproto_version],[ge],[$xcbproto_required], xcbproto_ok="yes",
  24. xcbproto_ok="no")
  25. AC_MSG_RESULT([$xcbproto_ok])
  26. if test $xcbproto_ok = no; then
  27. AC_MSG_ERROR([libxcb was compiled against xcb-proto $xcbproto_version; it needs to be compiled against version $xcbproto_required or higher])
  28. fi
  29. # Call macros from Xorg util-macros
  30. m4_ifndef([XORG_MACROS_VERSION],
  31. [m4_fatal([must install xorg-macros 1.16.0 or later before running autoconf/autogen])])
  32. XORG_MACROS_VERSION([1.16.0])
  33. XORG_DEFAULT_OPTIONS
  34. XORG_ENABLE_DEVEL_DOCS
  35. XORG_WITH_DOXYGEN
  36. ]) # XCB_UTIL_COMMON