diff --git a/ChangeLog b/ChangeLog index 39d8f23..965e3a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 * ChangeLog, ax_init_standard_project.m4: don't scan subpathes of diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index 8de0217..1b48313 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -372,9 +372,9 @@ EOF # fails if not found AC_DEFUN([AX_PKG_REQUIRE], [ PKG_PROG_PKG_CONFIG - $1_found=0 + $1_found=no PKG_CHECK_MODULES([$1], [$2], [ - $1_found=1 + $1_found=$2 PKG_REQUIREMENTS+=" $2" ], [ if test -n "$4"; then @@ -382,7 +382,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [ for pkg in $4; do PKG_CHECK_MODULES([$1], [$pkg], [ PKG_REQUIREMENTS+=" $pkg" - $1_found=1 + $1_found=$pkg break; ], [ 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(PKG_REQUIREMENTS) if test -n "$3"; then - $1_found=0 + tmp_package=${$1_found} + $1_found=no old_CPPFLAGS=${CPPFLAGS} CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}" AC_CHECK_HEADER([$3], [ - $1_found=1 + $1_found=yes ], [ 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=1 + $1_found=yes $1_CFLAGS+=" -I${f%/*}" AC_MSG_NOTICE([added path ${f%/*}]) break; fi done - if test ${$1_found} -eq 1; then + if test "${$1_found}" != "no"; then break; fi 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} fi - if test ${$1_found} -eq 0; then + 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])