[cig-commits] r15019 - cs/autoconf/trunk
leif at geodynamics.org
leif at geodynamics.org
Tue May 19 16:41:35 PDT 2009
Author: leif
Date: 2009-05-19 16:41:34 -0700 (Tue, 19 May 2009)
New Revision: 15019
Modified:
cs/autoconf/trunk/cit_python.m4
Log:
Added CIT_CHECK_PYTHON_SHARED, which checks whether -lpythonX.X is a
shared library.
Modified: cs/autoconf/trunk/cit_python.m4
===================================================================
--- cs/autoconf/trunk/cit_python.m4 2009-05-19 20:39:22 UTC (rev 15018)
+++ cs/autoconf/trunk/cit_python.m4 2009-05-19 23:41:34 UTC (rev 15019)
@@ -21,7 +21,7 @@
# CIT_CHECK_PYTHON_HEADER
-# ---------------------
+# -----------------------
# Checking the existence of Python.h
AC_DEFUN([CIT_CHECK_PYTHON_HEADER], [
# $Id$
@@ -35,8 +35,41 @@
])dnl CIT_CHECK_PYTHON_HEADER
+# CIT_CHECK_PYTHON_SHARED
+# -----------------------
+# Check whether -lpythonX.X is a shared library.
+AC_DEFUN([CIT_CHECK_PYTHON_SHARED], [
+# $Id$
+AC_REQUIRE([CIT_PYTHON_CONFIG])
+AC_MSG_CHECKING([whether -lpython$PYTHON_VERSION is a shared library])
+cit_save_CPPFLAGS=$CPPFLAGS
+cit_save_LDFLAGS=$LDFLAGS
+cit_save_LIBS=$LIBS
+CPPFLAGS="$PYTHON_CPPFLAGS $cit_save_CPPFLAGS"
+LDFLAGS="$PYTHON_LDFLAGS $cit_save_LDFLAGS"
+LIBS="$PYTHON_LIBS $cit_save_LIBS"
+AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include "Python.h"
+]], [[
+ int status;
+ Py_Initialize();
+ status = PyRun_SimpleString("import binascii") != 0;
+ Py_Finalize();
+ return status;
+]])], [
+ AC_MSG_RESULT(yes)
+], [
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([-lpython$PYTHON_VERSION is not a shared library])
+])
+CPPFLAGS=$cit_save_CPPFLAGS
+LDFLAGS=$cit_save_LDFLAGS
+LIBS=$cit_save_LIBS
+])dnl CIT_CHECK_PYTHON_SHARED
+
+
# CIT_PYTHON_CONFIG
-# --------------------
+# -----------------
AC_DEFUN([CIT_PYTHON_CONFIG], [
# $Id$
AC_REQUIRE([AM_PATH_PYTHON])
More information about the CIG-COMMITS
mailing list