From 327847b98765e29a10f70e2b7512bd9acd6a0570 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 25 Dec 2007 16:36:50 -0600 Subject: r26597: Attempt to provide alternative for hosts that don't have python-config. (This used to be commit fa5d1923efe5c1dc7ef12757b41f8d8eafcb1288) --- source4/scripting/python/config.m4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source4') 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]) -- cgit