[Mesa-dev] [PATCH] configure: ax_check_python_mako_module.m4 sets output variable

Samuel Iglesias Gonsalvez siglesias at igalia.com
Mon Mar 2 23:56:20 PST 2015


This output variables gives more flexibility for future changes
in autoconf to detect if it is needed to auto-generate files and
check for the auto-generation dependencies.

It is still returning error when Python is not installed.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
---
 configure.ac                      | 9 ++++++++-
 m4/ax_check_python_mako_module.m4 | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2ba79ef..ff7d6c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,7 +114,14 @@ if test "x$INDENT" != "xcat"; then
     fi
 fi
 
-AX_CHECK_PYTHON_MAKO_MODULE(0.3.4)
+PYTHON_MAKO_REQUIRED=0.3.4
+
+AX_CHECK_PYTHON_MAKO_MODULE($PYTHON_MAKO_REQUIRED)
+if test -n "$PYTHON2" -a "x$acv_mako_found" = "xyes"; then
+    AC_MSG_RESULT(yes)
+else
+    AC_MSG_ERROR([Python mako module v$PYTHON_MAKO_REQUIRED or higher not found])
+fi
 
 AC_PROG_INSTALL
 
diff --git a/m4/ax_check_python_mako_module.m4 b/m4/ax_check_python_mako_module.m4
index 2fc029b..ee68a7c 100644
--- a/m4/ax_check_python_mako_module.m4
+++ b/m4/ax_check_python_mako_module.m4
@@ -54,8 +54,8 @@ else:
     " | $PYTHON2 -
 
     if test $? -ne 0 ; then
-       AC_MSG_ERROR(mako $1 or later is required.)
+       AC_SUBST(acv_mako_found, 'no')
     else
-        AC_MSG_RESULT(yes)
+       AC_SUBST(acv_mako_found, 'yes')
     fi
 ])
-- 
2.1.4



More information about the mesa-dev mailing list