diff --git a/m4/papi.m4 b/m4/papi.m4 --- a/m4/papi.m4 +++ b/m4/papi.m4 @@ -24,12 +24,13 @@ AC_DEFUN([AC_CHECK_PAPI], else PKG_CHECK_MODULES( [papi], - [papi], + [papi >= 5.6.0], [ AC_MSG_CHECKING([the PAPI installation prefix]) AC_MSG_RESULT([retrieved from pkg-config]) papi_CPPFLAGS="${papi_CFLAGS}" ac_use_papi=yes + ac_papi_version_correct=yes ], [ AC_MSG_CHECKING([the PAPI installation prefix]) AC_MSG_RESULT([not available]) @@ -67,27 +68,29 @@ AC_DEFUN([AC_CHECK_PAPI], fi if test x"${ac_use_papi}" = x"yes" ; then - if test x"${ac_cv_use_papi_prefix}" != x"" ; then - papiBinary=${ac_cv_use_papi_prefix}/bin/papi_version - else - papiBinary=papi_version - fi - papiVersion=`$papiBinary | sed 's/[[^0-9.]]*\([[0-9.]]*\).*/\1/'` + if test x"${ac_papi_version_correct}" != x"yes" ; then + if test x"${ac_cv_use_papi_prefix}" != x"" ; then + papiBinary=${ac_cv_use_papi_prefix}/bin/papi_version + else + papiBinary=papi_version + fi + papiVersion=`$papiBinary | sed 's/[[^0-9.]]*\([[0-9.]]*\).*/\1/'` - AX_COMPARE_VERSION( - [[${papiVersion}]], - [[ge]], - [[5.6.0]], - [[ac_papi_version_correct=yes]], - [[ac_papi_version_correct=no]] - ) + AX_COMPARE_VERSION( + [[${papiVersion}]], + [[ge]], + [[5.6.0]], + [[ac_papi_version_correct=yes]], + [[ac_papi_version_correct=no]] + ) - if test x"${ac_papi_version_correct}" != x"yes" ; then - AC_MSG_ERROR([PAPI version must be >= 5.6.0.]) - ac_use_papi=no - else - AC_MSG_CHECKING([if the PAPI version >= 5.6.0.]) - AC_MSG_RESULT([${ac_papi_version_correct}]) + if test x"${ac_papi_version_correct}" != x"yes" ; then + AC_MSG_ERROR([PAPI version must be >= 5.6.0.]) + ac_use_papi=no + else + AC_MSG_CHECKING([if the PAPI version >= 5.6.0.]) + AC_MSG_RESULT([${ac_papi_version_correct}]) + fi fi fi