summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-09-21 16:33:03 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-09-22 08:35:01 -0400
commit091df02f920b5f5a658962d3add6f965d84375ac (patch)
tree123266b34d4a9c448248430d7e840561b7bfecb0
parent8a01230d3b5c048658e2157c6ff68b3680aafd26 (diff)
downloadsssd-091df02f920b5f5a658962d3add6f965d84375ac.tar.gz
sssd-091df02f920b5f5a658962d3add6f965d84375ac.tar.xz
sssd-091df02f920b5f5a658962d3add6f965d84375ac.zip
Make configure script compatible with older python versions
Older python versions (such as that used in RHEL5) do not have a python-config executable to report CFLAGS and LIBS. In order to support such versions of python, we will duplicate the logic that python-config would have performed directly in our configure script
-rw-r--r--server/external/python.m423
1 files changed, 16 insertions, 7 deletions
diff --git a/server/external/python.m4 b/server/external/python.m4
index 37eeac24f..db5986385 100644
--- a/server/external/python.m4
+++ b/server/external/python.m4
@@ -1,17 +1,26 @@
dnl Check for python-config and substitute needed CFLAGS and LDFLAGS
dnl Usage:
dnl AM_PYTHON_CONFIG
+
AC_DEFUN([AM_PYTHON_CONFIG],
[ AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LIBS)
- AC_PATH_PROG(PYTHON_CONFIG, python-config)
- AC_MSG_CHECKING(for working python-config)
- if test -x "$PYTHON_CONFIG"; then
- PYTHON_CFLAGS="`$PYTHON_CONFIG --includes`"
- PYTHON_CFLAGS=$PYTHON_CFLAGS" -fno-strict-aliasing"
- PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
- AC_MSG_RESULT([yes])
+dnl We need to check for python build flags using distutils.sysconfig
+dnl We cannot use python-config, as it was not available on older
+dnl versions of python
+ AC_PATH_PROG(PYTHON, python)
+ AC_MSG_CHECKING([for working python])
+ if test -x "$PYTHON"; then
+ PYTHON_CFLAGS="`$PYTHON -c \"from distutils import sysconfig; \
+ print '-I' + sysconfig.get_python_inc() + \
+ ' -I' + sysconfig.get_python_inc(plat_specific=True) + ' ' + \
+ sysconfig.get_config_var('BASECFLAGS')\"`"
+ PYTHON_LIBS="`$PYTHON -c \"from distutils import sysconfig; \
+ print \\\" \\\".join(sysconfig.get_config_var('LIBS').split() + \
+ sysconfig.get_config_var('SYSLIBS').split()) + \
+ ' -lpython' + sysconfig.get_config_var('VERSION')\"`"
+ AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([no. Please install python devel package])
fi