improve package detection

This commit is contained in:
Marc Wäckerlin
2015-07-13 14:57:04 +00:00
parent 27b9a14ca9
commit bfc6c41505

View File

@@ -412,13 +412,13 @@ AC_DEFUN([AX_PKG_REQUIRE], [
old_CPPFLAGS=${CPPFLAGS}
CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADER([$3], [
$1_found=yes
$1_found=${tmp_package}
], [
for x in ${$1_CFLAGS}; do
AC_MSG_NOTICE([search for $3 in ${x[#]-I}])
for f in $(find ${x[#]-I} -name "$3"); do
if test -f "$f"; then
$1_found=yes
$1_found=${tmp_package}
$1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}])
break;
@@ -434,7 +434,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AC_MSG_NOTICE([search for $3 in $x])
for f in $(find ${x} -name "$3"); do
if test -f "$f"; then
$1_found=yes
$1_found=${tmp_package}
$1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}])
break;