|
|
|
@ -373,7 +373,7 @@ EOF |
|
|
|
|
# require a specific package, with fallback: test for a header |
|
|
|
|
# - parameter: |
|
|
|
|
# $1 = unique id (no special characters) |
|
|
|
|
# $2 = module name |
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
# $3 = a header file to find (optional) |
|
|
|
|
# $4 = alternative module names (space separated, optional) |
|
|
|
|
# |
|
|
|
@ -385,12 +385,13 @@ EOF |
|
|
|
|
AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
|
PKG_PROG_PKG_CONFIG |
|
|
|
|
$1_found=no |
|
|
|
|
PKG_CHECK_MODULES([$1], [$2], [ |
|
|
|
|
$1_found=$2 |
|
|
|
|
PKG_REQUIREMENTS+=" $2" |
|
|
|
|
secondpar="m4_default([$2], [$1])" |
|
|
|
|
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [ |
|
|
|
|
$1_found=$secondpar |
|
|
|
|
PKG_REQUIREMENTS+=" $secondpar" |
|
|
|
|
], [ |
|
|
|
|
if test -n "$4"; then |
|
|
|
|
AC_MSG_WARN([Recommended package $2 for feature $1 not installed, trying $4]) |
|
|
|
|
AC_MSG_WARN([Recommended package $secondpar for feature $1 not installed, trying $4]) |
|
|
|
|
for pkg in $4; do |
|
|
|
|
PKG_CHECK_MODULES([$1], [$pkg], [ |
|
|
|
|
PKG_REQUIREMENTS+=" $pkg" |
|
|
|
@ -450,12 +451,12 @@ AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
|
if test "${$1_found}" = "no"; then |
|
|
|
|
if test -n "$3"; then |
|
|
|
|
if test -n "$4"; then |
|
|
|
|
AC_MSG_ERROR([Feature $1 not found, need header $3 in modules $2 or $4]) |
|
|
|
|
AC_MSG_ERROR([Feature $1 not found, need header $3 in modules $secondpar or $4]) |
|
|
|
|
else |
|
|
|
|
AC_MSG_ERROR([Feature $1 not found, need header $3 in module $2]) |
|
|
|
|
AC_MSG_ERROR([Feature $1 not found, need header $3 in module $secondpar]) |
|
|
|
|
fi |
|
|
|
|
else |
|
|
|
|
AC_MSG_ERROR([Feature $1 not found please install module $2]) |
|
|
|
|
AC_MSG_ERROR([Feature $1 not found please install module $secondpar]) |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
AM_CPPFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|