summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-08-25 17:08:52 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-08-25 17:08:52 +0200
commitf54f2ad39caace08e1aa3c37578d117b4d8ce0a6 (patch)
tree49c0527c967e28a44e4748aa0beeccbca1b3a2c6 /configure.ac
parent6f614828817112658ccb771a2ed3b5a2eef4801e (diff)
Add configure test for Python modules
This uses the AX_PYTHON_MODULE test to check for availability of used Python modules. All third-party modules and modules that are not a builtin for Python 2.5 are tested. This also splits the tests for the utils and pynslcd.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac45
1 files changed, 38 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index a586173..1a9dfdb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,8 +60,6 @@ AC_PROG_RANLIB
AM_PROG_CC_C_O
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_LN_S
-AM_PATH_PYTHON(2.5,, [:])
-AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"])
AM_PROG_AR
# checks for tool to convert docbook to man
@@ -72,6 +70,14 @@ then
fi
AM_CONDITIONAL([GENMAN], [test "x${DOCBOOK2X_MAN}" != x])
+# check for Python and modules
+AM_PATH_PYTHON(2.5,, [:])
+AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"])
+if test "x$PYTHON" != "x:"
+then
+ AX_PYTHON_MODULE(argparse)
+fi
+
# check for debugging options
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
@@ -137,11 +143,11 @@ AC_ARG_ENABLE(utils,
[enable_utils="auto"])
if test "x$enable_utils" = "xauto"
then
- if test "x$PYTHON" = "x:"
+ if test "x$PYTHON" != "x:" && test "$HAVE_PYMOD_ARGPARSE" = "yes"
then
- enable_utils="no"
- else
enable_utils="yes"
+ else
+ enable_utils="no"
fi
fi
AC_MSG_RESULT($enable_utils)
@@ -577,6 +583,18 @@ then
LIBS="$pam_save_LIBS"
fi
+# utils-specific tests
+if test "x$enable_utils" = "xyes"
+then
+ # check Python interpreter
+ AM_PATH_PYTHON(2.5,, AC_MSG_ERROR([Python is required]))
+ AX_PYTHON_MODULE(argparse)
+ if test "x$HAVE_PYMOD_ARGPARSE" != "xyes"
+ then
+ AC_MSG_ERROR(Required Python modules missing)
+ fi
+fi
+
# nslcd daemon-specific tests
if test "x$enable_nslcd" = "xyes"
then
@@ -799,11 +817,24 @@ then
AC_SUBST(nslcd_LIBS)
fi
-# Python-specific tests
-if test "x$enable_pynslcd" = "xyes" || test "x$enable_utils" = "xyes"
+# pynslcd-specific tests
+if test "x$enable_pynslcd" = "xyes"
then
# check Python interpreter
AM_PATH_PYTHON(2.5,, AC_MSG_ERROR([Python is required]))
+ AX_PYTHON_MODULE(daemon)
+ AX_PYTHON_MODULE(fcntl)
+ AX_PYTHON_MODULE(fnmatch)
+ AX_PYTHON_MODULE(ldap)
+ AX_PYTHON_MODULE(sqlite3)
+ if test "x$HAVE_PYMOD_DAEMON" != "xyes" || \
+ test "x$HAVE_PYMOD_FCNTL" != "xyes" || \
+ test "x$HAVE_PYMOD_FNMATCH" != "xyes" || \
+ test "x$HAVE_PYMOD_LDAP" != "xyes" || \
+ test "x$HAVE_PYMOD_SQLITE3" != "xyes"
+ then
+ AC_MSG_ERROR(Required Python modules missing)
+ fi
fi
AM_CONDITIONAL([NSS_FLAVOUR_GLIBC], [test "x${with_nss_flavour}" = xglibc])