summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorRam Raja <rraja@redhat.com>2013-05-26 21:55:23 +0530
committerAnand Avati <avati@redhat.com>2013-05-28 22:37:42 -0700
commitb0540090648a7670ef52e6733d127656f5aca5ed (patch)
tree3ffdac5a3bfe4b36ba76290248b649b6b0d61598 /configure.ac
parent7d0cf52a344e476963fe97e71f86488d5bb17b1c (diff)
configure.ac: add build option for glupy
Check whether Python.h, glupy dependency, is installed in the system. ('Python.h' part of python-devel or python-dev package.) Allow following build options: --enable-glupy build glupy; If dependencies are not met, abort configure script run with error. --disable-glupy don't build glupy even if dependencies are met. default build glupy; If dependencies are not met, don't build glupy and allow configure script run with warning. glupy-specific dependencies: python2.x, python-devel/python-dev package Change-Id: Ia495dd00cac7d12ad76645c8576a0adc0cb5d590 BUG: 961856 Signed-off-by: Ram Raja <rraja@redhat.com> Reviewed-on: http://review.gluster.org/5093 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac64
1 files changed, 49 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index cc53b52583e..dbae42aa18a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -639,22 +639,55 @@ if test "x$LIBAIO" != "x"; then
BUILD_LIBAIO=yes
fi
+# glupy section
+BUILD_GLUPY=no
+have_python2=no
+have_Python_h=no
+
AM_PATH_PYTHON()
- if echo $PYTHON_VERSION | grep ^2; then
- BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"`
- BUILD_PYTHON_LIB=python$PYTHON_VERSION
- GLUPY_SUBDIR=glupy
- GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile
- GLUPY_SUBDIR_SRC_MAKEFILE=xlators/features/glupy/src/Makefile
- echo "building glupy with -isystem $BUILD_PYTHON_INC -l $BUILD_PYTHON_LIB"
- else
- AC_MSG_ERROR([only python 2.x is supported])
- fi
-AC_SUBST(BUILD_PYTHON_INC)
-AC_SUBST(BUILD_PYTHON_LIB)
-AC_SUBST(GLUPY_SUBDIR)
-AC_SUBST(GLUPY_SUBDIR_MAKEFILE)
-AC_SUBST(GLUPY_SUBDIR_SRC_MAKEFILE)
+if echo $PYTHON_VERSION | grep ^2; then
+ have_python2=yes
+fi
+AC_CHECK_HEADERS([python$PYTHON_VERSION/Python.h],[have_Python_h=yes],[])
+AC_ARG_ENABLE([glupy],
+ AS_HELP_STRING([--enable-glupy],
+ [build glupy]))
+case x$enable_glupy in
+ xyes)
+ if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
+ BUILD_GLUPY=yes
+ else
+ AC_MSG_ERROR([glupy requires python-devel/python-dev package and python2.x])
+ fi
+ ;;
+ xno)
+ ;;
+ *)
+ if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
+ BUILD_GLUPY=yes
+ else
+ AC_MSG_WARN([
+ ---------------------------------------------------------------------------------
+ cannot build glupy. python 2.x and python-devel/python-dev package are required.
+ ---------------------------------------------------------------------------------])
+ fi
+ ;;
+esac
+
+if test "x$BUILD_GLUPY" = "xyes"; then
+ BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"`
+ BUILD_PYTHON_LIB=python$PYTHON_VERSION
+ GLUPY_SUBDIR=glupy
+ GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile
+ GLUPY_SUBDIR_SRC_MAKEFILE=xlators/features/glupy/src/Makefile
+ echo "building glupy with -isystem $BUILD_PYTHON_INC -l $BUILD_PYTHON_LIB"
+ AC_SUBST(BUILD_PYTHON_INC)
+ AC_SUBST(BUILD_PYTHON_LIB)
+ AC_SUBST(GLUPY_SUBDIR)
+ AC_SUBST(GLUPY_SUBDIR_MAKEFILE)
+ AC_SUBST(GLUPY_SUBDIR_SRC_MAKEFILE)
+fi
+# end glupy section
AC_SUBST(GF_HOST_OS)
AC_SUBST([GF_GLUSTERFS_LIBS])
@@ -697,4 +730,5 @@ echo "Linux-AIO : $BUILD_LIBAIO"
echo "Enable Debug : $BUILD_DEBUG"
echo "systemtap : $BUILD_SYSTEMTAP"
echo "Block Device backend : $BUILD_BD_XLATOR"
+echo "glupy : $BUILD_GLUPY"
echo