summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/python/config.m410
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/scripting/python/config.m4 b/source4/scripting/python/config.m4
index b6ca7966df..a629aa8f92 100644
--- a/source4/scripting/python/config.m4
+++ b/source4/scripting/python/config.m4
@@ -19,10 +19,16 @@ if test -z "$PYTHON_CONFIG"; then
AC_MSG_WARN([No python-config found])
else
working_python=yes
+ PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
+ PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags`
fi
-PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
-PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags`
+if test $working_python = no && test x$PYTHON != x
+then
+ PYTHON_CFLAGS=`$PYTHON -c "from distutils import sysconfig; print '-I%s -I%s %s' % (sysconfig.get_python_inc(), sysconfig.get_python_inc(plat_specific=True), sysconfig.get_config_var('CFLAGS'))"`
+ PYTHON_LDFLAGS=`$PYTHON -c "from distutils import sysconfig; print '%s %s -lpython%s -L%s' % (sysconfig.get_config_var('LIBS'), sysconfig.get_config_var('SYSLIBS'), sysconfig.get_config_var('VERSION'), sysconfig.get_config_var('LIBPL'))"`
+ working_python=yes
+fi
SMB_EXT_LIB(EXT_LIB_PYTHON, [$PYTHON_LDFLAGS], [$PYTHON_CFLAGS])