summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-12 03:02:18 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:49:43 +0100
commit6d2edec0a27c674798c118076c2816b3ffdd78e5 (patch)
treecc19c8ec8e2c14c3d1c51d469b3b134bf444677a /source4/scripting
parentb8850f326befab8a745e2b880214159908e7ec58 (diff)
downloadsamba-6d2edec0a27c674798c118076c2816b3ffdd78e5.tar.gz
samba-6d2edec0a27c674798c118076c2816b3ffdd78e5.tar.bz2
samba-6d2edec0a27c674798c118076c2816b3ffdd78e5.zip
r26411: Double check Python installation - make sure we can compile and link using it.
(This used to be commit 3d8fc5808ced6f54274701d80fe2d42423bf9fee)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/config.m416
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/scripting/python/config.m4 b/source4/scripting/python/config.m4
index 5e982556fc..64a8c70b41 100644
--- a/source4/scripting/python/config.m4
+++ b/source4/scripting/python/config.m4
@@ -119,9 +119,23 @@ AC_SUBST(PYTHON_EXTRA_LDFLAGS)
SMB_EXT_LIB(LIBPYTHON, [$PYTHON_LDFLAGS], [$PYTHON_CPPFLAGS])
+
if test x$working_python = xyes
then
- SMB_ENABLE(LIBPYTHON,YES)
+ ac_save_LIBS="$LIBS"
+ ac_save_CFLAGS="$CFLAGS"
+ LIBS="$LIBS $PYTHON_LDFLAGS"
+ CFLAGS="$CFLAGS $PYTHON_CPPFLAGS"
+
+ AC_TRY_LINK([
+#include <Python.h>
+#include <stdlib.h>],
+[Py_InitModule(NULL, NULL);],
+ [SMB_ENABLE(LIBPYTHON,YES)],
+ [SMB_ENABLE(LIBPYTHON,NO)])
+
+ LIBS="$ac_save_LIBS"
+ CFLAGS="$ac_save_CFLAGS"
else
SMB_ENABLE(LIBPYTHON,NO)
fi