summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2013-11-17 01:51:48 +0100
committerAnand Avati <avati@redhat.com>2013-11-19 13:31:36 -0800
commit00aafce07140a96e641ad5d1f701932823738aaa (patch)
tree6b32bba99cff615eac096166addfcab30ea3a631 /configure.ac
parent5d2439657f7f81f1dcdc45e960c91ce4196ae118 (diff)
Python build flag detection
Ask python-config for proper python build flags BUG: 764655 Change-Id: I7aede0f93637c61dbafc43580bff46af60f0f0d3 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/6283 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.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index af78ee5..ae4046c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -802,6 +802,12 @@ AM_PATH_PYTHON()
if echo $PYTHON_VERSION | grep ^2; then
have_python2=yes
fi
+saved_CFLAGS=$CFLAGS
+saved_CPPFLAGS=$CPPFLAGS
+saved_LDFLAGS=$LDFLAGS
+CFLAGS=`${PYTHON}-config --cflags`
+CPPFLAGS=$CFLAGS
+LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
AC_CHECK_HEADERS([python$PYTHON_VERSION/Python.h],[have_Python_h=yes],[])
AC_ARG_ENABLE([glupy],
AS_HELP_STRING([--enable-glupy],
@@ -810,6 +816,9 @@ case x$enable_glupy in
xyes)
if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
BUILD_GLUPY=yes
+ saved_CFLAGS="$saved_CFLAGS $CFLAGS"
+ saved_CPPFLAGS="$saved_CPPFLAGS $CPPFLAGS"
+ saved_LDFLAGS="$saved_LDFLAGS $LDFLAGS"
else
AC_MSG_ERROR([glupy requires python-devel/python-dev package and python2.x])
fi
@@ -819,6 +828,9 @@ case x$enable_glupy in
*)
if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
BUILD_GLUPY=yes
+ saved_CFLAGS="$saved_CFLAGS $CFLAGS"
+ saved_CPPFLAGS="$saved_CPPFLAGS $CPPFLAGS"
+ saved_LDFLAGS="$saved_LDFLAGS $LDFLAGS"
else
AC_MSG_WARN([
---------------------------------------------------------------------------------
@@ -827,6 +839,9 @@ case x$enable_glupy in
fi
;;
esac
+CFLAGS=$saved_CFLAGS
+CPPFLAGS=$saved_CPPFLAGS
+LDFLAGS=$saved_LDFLAGS
if test "x$BUILD_GLUPY" = "xyes"; then
BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"`