even more support for weird and sloppy packages

master
Marc Wäckerlin 10 years ago
parent 6ac5bece8c
commit 3d3cbf41f4
  1. 15
      ChangeLog
  2. 34
      ax_init_standard_project.m4

@ -1,3 +1,18 @@
2015-06-23 09:02 marc
* ax_init_standard_project.m4, configure.ac: even more improved way
to find the necessary include path
2015-06-23 08:48 marc
* ax_init_standard_project.m4: even more improved way to find the
necessary include path
2015-06-23 08:06 marc
* ChangeLog, ax_init_standard_project.m4: improved way to find the
necessary include path, even if module writers did a sloppy job
2015-06-19 07:18 marc 2015-06-19 07:18 marc
* ChangeLog, ax_init_standard_project.m4: don't scan subpathes of * ChangeLog, ax_init_standard_project.m4: don't scan subpathes of

@ -372,9 +372,9 @@ EOF
# fails if not found # fails if not found
AC_DEFUN([AX_PKG_REQUIRE], [ AC_DEFUN([AX_PKG_REQUIRE], [
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
$1_found=0 $1_found=no
PKG_CHECK_MODULES([$1], [$2], [ PKG_CHECK_MODULES([$1], [$2], [
$1_found=1 $1_found=$2
PKG_REQUIREMENTS+=" $2" PKG_REQUIREMENTS+=" $2"
], [ ], [
if test -n "$4"; then if test -n "$4"; then
@ -382,7 +382,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [
for pkg in $4; do for pkg in $4; do
PKG_CHECK_MODULES([$1], [$pkg], [ PKG_CHECK_MODULES([$1], [$pkg], [
PKG_REQUIREMENTS+=" $pkg" PKG_REQUIREMENTS+=" $pkg"
$1_found=1 $1_found=$pkg
break; break;
], [ ], [
AC_MSG_WARN([Recommended package $pkg for feature $1 not installed]) AC_MSG_WARN([Recommended package $pkg for feature $1 not installed])
@ -394,30 +394,48 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS) AC_SUBST(PKG_REQUIREMENTS)
if test -n "$3"; then if test -n "$3"; then
$1_found=0 tmp_package=${$1_found}
$1_found=no
old_CPPFLAGS=${CPPFLAGS} old_CPPFLAGS=${CPPFLAGS}
CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}" CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADER([$3], [ AC_CHECK_HEADER([$3], [
$1_found=1 $1_found=yes
], [ ], [
for x in ${$1_CFLAGS}; do for x in ${$1_CFLAGS}; do
AC_MSG_NOTICE([search for $3 in ${x[#]-I}]) AC_MSG_NOTICE([search for $3 in ${x[#]-I}])
for f in $(find ${x[#]-I} -name "$3"); do for f in $(find ${x[#]-I} -name "$3"); do
if test -f "$f"; then if test -f "$f"; then
$1_found=1 $1_found=yes
$1_CFLAGS+=" -I${f%/*}" $1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}]) AC_MSG_NOTICE([added path ${f%/*}])
break; break;
fi fi
done done
if test ${$1_found} -eq 1; then if test "${$1_found}" != "no"; then
break; break;
fi fi
done done
if test "${$1_found}" = "no"; then
tmp_includedir=$(pkg-config --variable=includedir $tmp_package)
for x in ${tmp_includedir}; do
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_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}])
break;
fi
done
if test "${$1_found}" != "no"; then
break;
fi
done
fi
]) ])
CPPFLAGS=${old_CPPFLAGS} CPPFLAGS=${old_CPPFLAGS}
fi fi
if test ${$1_found} -eq 0; then if test "${$1_found}" = "no"; then
if test -n "$3"; then if test -n "$3"; then
if test -n "$4"; 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 $2 or $4])

Loading…
Cancel
Save