Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit ba4eb9568d8a11fb08b80dcaa578c2918cedfa84
Author: Peter Hatina <phatina(a)redhat.com>
Date: Sun Oct 7 11:30:53 2012 +0200
add autoconf check for pywbem module
---------------------------------------------------------------
configure.ac | 5 +++++
m4/python_module.m4 | 11 +++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 99cbca7..a9afd07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,14 @@
AC_PREREQ([2.60])
AC_INIT([cura-tools], [0.1], [phatina(a)redhat.com])
+AC_CONFIG_MACRO_DIR([m4])
+m4_include([m4/python_module.m4])
+
AM_INIT_AUTOMAKE([dist-bzip2])
AM_PATH_PYTHON([2.7])
+AC_PYTHON_MODULE([pywbem])
+
AC_CONFIG_FILES([
makefile
cli-tools/makefile
diff --git a/m4/python_module.m4 b/m4/python_module.m4
new file mode 100644
index 0000000..bdb0cdf
--- /dev/null
+++ b/m4/python_module.m4
@@ -0,0 +1,11 @@
+AC_DEFUN([AC_PYTHON_MODULE], [
+ AC_MSG_CHECKING(python module: $1)
+ python -c "import $1" 2> /dev/null
+ if test $? -eq 0; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(failed to find required module $1)
+ exit 1
+ fi
+])