From b2ae8c571bcfeaa4e373352debd7c30f68c907db Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 26 Mar 2015 12:09:50 +0100 Subject: build-sys: python is optional, don't fail when missing Signed-off-by: Karel Zak --- configure.ac | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 29ec86d76..b278eacc9 100644 --- a/configure.ac +++ b/configure.ac @@ -1789,6 +1789,7 @@ AC_ARG_WITH([python], ) have_python=no +have_libpython=no AS_IF([test "x$with_python" != xno], [ # We follow distributions default and look for PKG module name "python" # (minimal version is 2) but if major version is explicitly specified by @@ -1796,14 +1797,18 @@ AS_IF([test "x$with_python" != xno], [ # "python3". AS_IF([test "x$withval" != xno -a "x$withval" != xyes -a "x$withval" != xcheck], [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"]) + + # check for python interpreter AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no]) AS_CASE([$with_python:$have_python], [yes:no], - [AC_MSG_ERROR([python selected but libpython not found])], + [AC_MSG_ERROR([python selected but python interpreter not found])], [check:no], - [AC_MSG_WARN([libpython not found, do not build python bindings])], + [AC_MSG_WARN([python interpreter not found, do not build python bindings])], [*:yes], - [PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION])] + # check for python development stuff + [PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], + [have_libpython=yes], [have_libpython=no])] ) ]) @@ -1813,7 +1818,7 @@ AC_ARG_ENABLE([pylibmount], [], [UL_DEFAULT_ENABLE([pylibmount], [check])] ) UL_BUILD_INIT([pylibmount]) -UL_REQUIRES_HAVE([pylibmount], [python], [libpython]) +UL_REQUIRES_HAVE([pylibmount], [libpython], [libpython]) UL_REQUIRES_BUILD([pylibmount], [libmount]) AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"]) -- cgit v1.2.3-55-g7522