|
|
|
@ -298,15 +298,79 @@ EOF |
|
|
|
|
|
|
|
|
|
AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
|
PKG_PROG_PKG_CONFIG |
|
|
|
|
PKG_CHECK_MODULES([$1], [$1], [ |
|
|
|
|
PKG_CHECK_MODULES([$1], [$2], [ |
|
|
|
|
if test -n "$3"; then |
|
|
|
|
$1_found=0; |
|
|
|
|
for p in ${$1_CFLAGS}; do |
|
|
|
|
if test -e ${p#-I}/$3; then |
|
|
|
|
$1_found=1 |
|
|
|
|
break |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
|
if test ${$1_found} -eq 0; then |
|
|
|
|
for p in /usr/include ${$1_CFLAGS}; do |
|
|
|
|
$1_file=$(find ${p#-I} -name $3) |
|
|
|
|
if test -e ${$1_file}; then |
|
|
|
|
$1_CFLAGS="${$1_CFLAGS} -I${$1_file%/*}" |
|
|
|
|
$1_found=1 |
|
|
|
|
break |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
|
fi |
|
|
|
|
if test ${$1_found} -eq 0; then |
|
|
|
|
AC_MSG_WARN([Header file $3 not found in $1_CFLAGS = ${$1_CFLAGS}]) |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
AM_CPPFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|
AM_CXXFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|
LIBS+=" ${$1_LIBS}" |
|
|
|
|
], [ |
|
|
|
|
AC_MSG_ERROR([Required package $1 not found]) |
|
|
|
|
AC_MSG_WARN([Recommended package $2 for feature $1 not installed]) |
|
|
|
|
if test -n "$4"; then |
|
|
|
|
for pkg in $4; do |
|
|
|
|
PKG_CHECK_MODULES([$1], [$pkg], [ |
|
|
|
|
if test -n "$3"; then |
|
|
|
|
$1_found=0; |
|
|
|
|
for p in ${$1_CFLAGS}; do |
|
|
|
|
if test -e ${p#-I}/$3; then |
|
|
|
|
$1_found=1 |
|
|
|
|
break |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
|
if test ${$1_found} -eq 0; then |
|
|
|
|
for p in /usr/include ${$1_CFLAGS}; do |
|
|
|
|
$1_file=$(find ${p#-I} -name $3) |
|
|
|
|
if test -e ${$1_file}; then |
|
|
|
|
$1_CFLAGS="${$1_CFLAGS} -I${$1_file%/*}" |
|
|
|
|
$1_found=1 |
|
|
|
|
break |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
|
fi |
|
|
|
|
if test ${$1_found} -eq 0; then |
|
|
|
|
AC_MSG_WARN([Header file $3 not found in $1_CFLAGS = ${$1_CFLAGS}]) |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
AM_CPPFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|
AM_CXXFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|
LIBS+=" ${$1_LIBS}" |
|
|
|
|
], [ |
|
|
|
|
AC_MSG_WARN([Recommended package $pkg for feature $1 not installed]) |
|
|
|
|
]) |
|
|
|
|
done |
|
|
|
|
fi |
|
|
|
|
]) |
|
|
|
|
AC_SUBST(AM_CPPFLAGS) |
|
|
|
|
AC_SUBST(AM_CXXFLAGS) |
|
|
|
|
if test -n "$3"; then |
|
|
|
|
old_CPPFLAGS=${CPPFLAGS} |
|
|
|
|
CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}" |
|
|
|
|
AC_CHECK_HEADER([$3], [ |
|
|
|
|
], [ |
|
|
|
|
AC_MSG_ERROR([Required header $3 for feature $1 not found]) |
|
|
|
|
]) |
|
|
|
|
CPPFLAGS=${old_CPPFLAGS} |
|
|
|
|
fi |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
AC_DEFUN([AX_PKG_CHECK], [ |
|
|
|
|