summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
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 af78ee59f6c..ae4046c298d 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()"`