Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.7KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_pkg_check_modules.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_PKG_CHECK_MODULES(PREFIX, PUBLIC-MODULES, PRIVATE-MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [PUBLIC-VARIABLE], [PRIVATE-VARIABLE])
  8. #
  9. # DESCRIPTION
  10. #
  11. # A wrapper around PKG_CHECK_MODULES which splits the list of modules into
  12. # public and private dependencies, and produces two variables listing the
  13. # dependencies across all invocations of AX_PKG_CHECK_MODULES. These two
  14. # variables are exposed via AC_SUBST, and should be used in a pkg-config
  15. # file as the substituted values for Requires and Requires.private.
  16. #
  17. # The PREFIX, PUBLIC-MODULES and PRIVATE-MODULES arguments should be
  18. # specified as for PKG_CHECK_MODULES, with the concatenation of
  19. # PUBLIC-MODULES and PRIVATE-MODULES equaling the LIST-OF-MODULES from
  20. # PKG_CHECK_MODULES. The ACTION-IF-FOUND and ACTION-IF-NOT-FOUND
  21. # arguments are optional, and should also be specified as for
  22. # PKG_CHECK_MODULES. ACTION-IF-FOUND is evaluated if the full
  23. # LIST-OF-MODULES is found; ACTION-IF-NOT-FOUND similarly.
  24. #
  25. # PUBLIC-VARIABLE defaults to AX_PACKAGE_REQUIRES, and PRIVATE-VARIABLE
  26. # defaults to AX_PACKAGE_REQUIRES_PRIVATE. Both variables are AC_SUBST-ed
  27. # by this macro.
  28. #
  29. # For example:
  30. #
  31. # AX_PKG_CHECK_MODULES([GLIB],[glib-2.0 gio-2.0],[gthread-2.0])
  32. # AX_PKG_CHECK_MODULES([DBUS],[],[dbus-glib-1 >= 0.98 dbus-1])
  33. #
  34. # results in the substitutions:
  35. #
  36. # AX_PACKAGE_REQUIRES="glib-2.0 gio-2.0"
  37. # AX_PACKAGE_REQUIRES_PRIVATE="gthread-2.0 dbus-glib-1 >= 0.98 dbus-1"
  38. #
  39. # and can be used with a template pkg-config file (.pc.in) using:
  40. #
  41. # Requires: @AX_PACKAGE_REQUIRES@
  42. # Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
  43. #
  44. # LICENSE
  45. #
  46. # Copyright (c) 2014 Philip Withnall <philip@tecnocode.co.uk>
  47. #
  48. # Copying and distribution of this file, with or without modification, are
  49. # permitted in any medium without royalty provided the copyright notice
  50. # and this notice are preserved. This file is offered as-is, without any
  51. # warranty.
  52. #serial 4
  53. AC_DEFUN([AX_PKG_CHECK_MODULES],[
  54. m4_define([ax_package_requires],
  55. [m4_default_quoted([$6],[AX_PACKAGE_REQUIRES])])
  56. m4_define([ax_package_requires_private],
  57. [m4_default_quoted([$7],[AX_PACKAGE_REQUIRES_PRIVATE])])
  58. ax_package_requires="$[]ax_package_requires m4_normalize($2)"
  59. ax_package_requires_private="$[]ax_package_requires_private m4_normalize($3)"
  60. PKG_CHECK_MODULES([$1],[$2 $3],[$4],[$5])
  61. # Substitute output.
  62. AC_SUBST(ax_package_requires)
  63. AC_SUBST(ax_package_requires_private)
  64. ])dnl AX_PKG_CHECK_MODULES