Blame m4/ax_pkg_check_modules.m4

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