fence-agents: master - [build]: Add build requirements to autoconf

Marek GrĂ¡c marx at fedoraproject.org
Thu Oct 23 12:53:58 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=5a87866c70e3dc77798d3e6fd77e2607757d26b5
Commit:        5a87866c70e3dc77798d3e6fd77e2607757d26b5
Parent:        4dc849439b0db09d2e16422c1bba13add93a1bc1
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Thu Oct 23 14:53:26 2014 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Thu Oct 23 14:53:26 2014 +0200

[build]: Add build requirements to autoconf

---
 autogen.sh               |    2 +-
 configure.ac             |    6 ++++++
 make/ac_python_module.m4 |   30 ++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 3c5e1d9..ee22af8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 # Run this to generate all the initial makefiles, etc.
 mkdir -p m4
-autoreconf -i -v && echo Now run ./configure and make
+autoreconf -i -I make -v && echo Now run ./configure and make
diff --git a/configure.ac b/configure.ac
index b603878..e066f2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,6 +159,11 @@ LOGDIR=${localstatedir}/log/cluster
 CLUSTERVARRUN=${localstatedir}/run/cluster
 CLUSTERDATA=${datadir}/cluster
 
+AC_PYTHON_MODULE(suds, 1)
+AC_PYTHON_MODULE(pexpect, 1)
+AC_PYTHON_MODULE(pycurl, 1)
+AC_PYTHON_MODULE(requests, 1)
+
 ## path to 3rd-party binaries
 AC_PATH_PROG([IPMITOOL_PATH], [ipmitool], [/usr/bin/ipmitool])
 AC_PATH_PROG([AMTTOOL_PATH], [amttool], [/usr/bin/amttool])
@@ -254,6 +259,7 @@ CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS \
 CPPFLAGS="-I\$(top_builddir)/make -I\$(top_srcdir)/make -I. $ENV_CPPFLAGS"
 LDFLAGS="$ENV_LDFLAGS"
 
+
 AC_CONFIG_FILES([Makefile
 		 fence/Makefile
 		 fence/agents/Makefile
diff --git a/make/ac_python_module.m4 b/make/ac_python_module.m4
new file mode 100644
index 0000000..32b9d72
--- /dev/null
+++ b/make/ac_python_module.m4
@@ -0,0 +1,30 @@
+dnl @synopsis AC_PYTHON_MODULE(modname[, fatal])
+dnl
+dnl Checks for Python module.
+dnl
+dnl If fatal is non-empty then absence of a module will trigger an
+dnl error.
+dnl
+dnl @category InstalledPackages
+dnl @author Andrew Collier <colliera at nu.ac.za>.
+dnl @version 2004-07-14
+dnl @license AllPermissive
+
+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)
+		eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
+	else
+		AC_MSG_RESULT(no)
+		eval AS_TR_CPP(HAVE_PYMOD_$1)=no
+		#
+		if test -n "$2"
+		then
+			AC_MSG_ERROR(failed to find required module $1)
+			exit 1
+		fi
+	fi
+])


More information about the cluster-commits mailing list