summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2005-09-26 16:48:28 +0000
committerBruce Momjian2005-09-26 16:48:28 +0000
commit653481e8ec123b155bbe049b658a09b312e03179 (patch)
treed47b5f7a64e954e8513209e852c45771e6b7dd9b
parent3567f481c11d44659d23cf45b3b436552ec44a46 (diff)
Prevent threaded python build on BSD's, where it fails.
Marko Kreen
-rw-r--r--config/python.m415
-rwxr-xr-xconfigure20
2 files changed, 35 insertions, 0 deletions
diff --git a/config/python.m4 b/config/python.m4
index d6f5434275..9e2e74ae25 100644
--- a/config/python.m4
+++ b/config/python.m4
@@ -77,4 +77,19 @@ AC_MSG_RESULT([${python_libspec} ${python_additional_libs}])
AC_SUBST(python_libdir)[]dnl
AC_SUBST(python_libspec)[]dnl
AC_SUBST(python_additional_libs)[]dnl
+
+# threaded python is not supported on bsd's
+AC_MSG_CHECKING(whether Python is compiled with thread support)
+pythreads=`${PYTHON} -c "import sys; print int('thread' in sys.builtin_module_names)"`
+if test "$pythreads" = "1"; then
+ AC_MSG_RESULT(yes)
+ case $host_os in
+ openbsd*|freebsd*)
+ AC_MSG_ERROR([*** Threaded Python not supported on this platform ***])
+ ;;
+ esac
+else
+ AC_MSG_RESULT(no)
+fi
+
])# PGAC_CHECK_PYTHON_EMBED_SETUP
diff --git a/configure b/configure
index 23071b0304..e58189c81b 100755
--- a/configure
+++ b/configure
@@ -4743,6 +4743,26 @@ echo "$as_me:$LINENO: result: ${python_libspec} ${python_additional_libs}" >&5
echo "${ECHO_T}${python_libspec} ${python_additional_libs}" >&6
+# threaded python is not supported on bsd's
+echo "$as_me:$LINENO: checking whether Python is compiled with thread support" >&5
+echo $ECHO_N "checking whether Python is compiled with thread support... $ECHO_C" >&6
+pythreads=`${PYTHON} -c "import sys; print int('thread' in sys.builtin_module_names)"`
+if test "$pythreads" = "1"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ case $host_os in
+ openbsd*|freebsd*)
+ { { echo "$as_me:$LINENO: error: *** Threaded Python not supported on this platform ***" >&5
+echo "$as_me: error: *** Threaded Python not supported on this platform ***" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
fi