Blame m4/ax_pkg_check_modules.m4

Packit aa0600
# ===========================================================================
Packit aa0600
#   https://www.gnu.org/software/autoconf-archive/ax_pkg_check_modules.html
Packit aa0600
# ===========================================================================
Packit aa0600
#
Packit aa0600
# SYNOPSIS
Packit aa0600
#
Packit aa0600
#   AX_PKG_CHECK_MODULES(PREFIX, PUBLIC-MODULES, PRIVATE-MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [PUBLIC-VARIABLE], [PRIVATE-VARIABLE])
Packit aa0600
#
Packit aa0600
# DESCRIPTION
Packit aa0600
#
Packit aa0600
#   A wrapper around PKG_CHECK_MODULES which splits the list of modules into
Packit aa0600
#   public and private dependencies, and produces two variables listing the
Packit aa0600
#   dependencies across all invocations of AX_PKG_CHECK_MODULES. These two
Packit aa0600
#   variables are exposed via AC_SUBST, and should be used in a pkg-config
Packit aa0600
#   file as the substituted values for Requires and Requires.private.
Packit aa0600
#
Packit aa0600
#   The PREFIX, PUBLIC-MODULES and PRIVATE-MODULES arguments should be
Packit aa0600
#   specified as for PKG_CHECK_MODULES, with the concatenation of
Packit aa0600
#   PUBLIC-MODULES and PRIVATE-MODULES equaling the LIST-OF-MODULES from
Packit aa0600
#   PKG_CHECK_MODULES.  The ACTION-IF-FOUND and ACTION-IF-NOT-FOUND
Packit aa0600
#   arguments are optional, and should also be specified as for
Packit aa0600
#   PKG_CHECK_MODULES.  ACTION-IF-FOUND is evaluated if the full
Packit aa0600
#   LIST-OF-MODULES is found; ACTION-IF-NOT-FOUND similarly.
Packit aa0600
#
Packit aa0600
#   PUBLIC-VARIABLE defaults to AX_PACKAGE_REQUIRES, and PRIVATE-VARIABLE
Packit aa0600
#   defaults to AX_PACKAGE_REQUIRES_PRIVATE.  Both variables are AC_SUBST-ed
Packit aa0600
#   by this macro.
Packit aa0600
#
Packit aa0600
#   For example:
Packit aa0600
#
Packit aa0600
#     AX_PKG_CHECK_MODULES([GLIB],[glib-2.0 gio-2.0],[gthread-2.0])
Packit aa0600
#     AX_PKG_CHECK_MODULES([DBUS],[],[dbus-glib-1 >= 0.98 dbus-1])
Packit aa0600
#
Packit aa0600
#   results in the substitutions:
Packit aa0600
#
Packit aa0600
#     AX_PACKAGE_REQUIRES="glib-2.0 gio-2.0"
Packit aa0600
#     AX_PACKAGE_REQUIRES_PRIVATE="gthread-2.0 dbus-glib-1 >= 0.98 dbus-1"
Packit aa0600
#
Packit aa0600
#   and can be used with a template pkg-config file (.pc.in) using:
Packit aa0600
#
Packit aa0600
#     Requires: @AX_PACKAGE_REQUIRES@
Packit aa0600
#     Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
Packit aa0600
#
Packit aa0600
# LICENSE
Packit aa0600
#
Packit aa0600
#   Copyright (c) 2014 Philip Withnall <philip@tecnocode.co.uk>
Packit aa0600
#
Packit aa0600
#   Copying and distribution of this file, with or without modification, are
Packit aa0600
#   permitted in any medium without royalty provided the copyright notice
Packit aa0600
#   and this notice are preserved.  This file is offered as-is, without any
Packit aa0600
#   warranty.
Packit aa0600
Packit aa0600
#serial 4
Packit aa0600
Packit aa0600
AC_DEFUN([AX_PKG_CHECK_MODULES],[
Packit aa0600
    m4_define([ax_package_requires],
Packit aa0600
              [m4_default_quoted([$6],[AX_PACKAGE_REQUIRES])])
Packit aa0600
    m4_define([ax_package_requires_private],
Packit aa0600
              [m4_default_quoted([$7],[AX_PACKAGE_REQUIRES_PRIVATE])])
Packit aa0600
Packit aa0600
    ax_package_requires="$[]ax_package_requires m4_normalize($2)"
Packit aa0600
    ax_package_requires_private="$[]ax_package_requires_private m4_normalize($3)"
Packit aa0600
Packit aa0600
    PKG_CHECK_MODULES([$1],[$2 $3],[$4],[$5])
Packit aa0600
Packit aa0600
    # Substitute output.
Packit aa0600
    AC_SUBST(ax_package_requires)
Packit aa0600
    AC_SUBST(ax_package_requires_private)
Packit aa0600
])dnl AX_PKG_CHECK_MODULES