Skip to content

Commit d3a0c8d

Browse files
committed
Prevent threaded python build on BSD's, where it fails.
Marko Kreen
1 parent 3ff1dc5 commit d3a0c8d

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

config/python.m4

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Autoconf macros for configuring the build of Python extension modules
33
#
4-
# $PostgreSQL: pgsql/config/python.m4,v 1.11 2004/10/11 19:32:16 tgl Exp $
4+
# $PostgreSQL: pgsql/config/python.m4,v 1.12 2005/09/26 16:48:28 momjian Exp $
55
#
66

77
# PGAC_PATH_PYTHON
@@ -77,4 +77,19 @@ AC_MSG_RESULT([${python_libspec} ${python_additional_libs}])
7777
AC_SUBST(python_libdir)[]dnl
7878
AC_SUBST(python_libspec)[]dnl
7979
AC_SUBST(python_additional_libs)[]dnl
80+
81+
# threaded python is not supported on bsd's
82+
AC_MSG_CHECKING(whether Python is compiled with thread support)
83+
pythreads=`${PYTHON} -c "import sys; print int('thread' in sys.builtin_module_names)"`
84+
if test "$pythreads" = "1"; then
85+
AC_MSG_RESULT(yes)
86+
case $host_os in
87+
openbsd*|freebsd*)
88+
AC_MSG_ERROR([*** Threaded Python not supported on this platform ***])
89+
;;
90+
esac
91+
else
92+
AC_MSG_RESULT(no)
93+
fi
94+
8095
])# PGAC_CHECK_PYTHON_EMBED_SETUP

configure

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4743,6 +4743,26 @@ echo "$as_me:$LINENO: result: ${python_libspec} ${python_additional_libs}" >&5
47434743
echo "${ECHO_T}${python_libspec} ${python_additional_libs}" >&6
47444744

47454745

4746+
# threaded python is not supported on bsd's
4747+
echo "$as_me:$LINENO: checking whether Python is compiled with thread support" >&5
4748+
echo $ECHO_N "checking whether Python is compiled with thread support... $ECHO_C" >&6
4749+
pythreads=`${PYTHON} -c "import sys; print int('thread' in sys.builtin_module_names)"`
4750+
if test "$pythreads" = "1"; then
4751+
echo "$as_me:$LINENO: result: yes" >&5
4752+
echo "${ECHO_T}yes" >&6
4753+
case $host_os in
4754+
openbsd*|freebsd*)
4755+
{ { echo "$as_me:$LINENO: error: *** Threaded Python not supported on this platform ***" >&5
4756+
echo "$as_me: error: *** Threaded Python not supported on this platform ***" >&2;}
4757+
{ (exit 1); exit 1; }; }
4758+
;;
4759+
esac
4760+
else
4761+
echo "$as_me:$LINENO: result: no" >&5
4762+
echo "${ECHO_T}no" >&6
4763+
fi
4764+
4765+
47464766
fi
47474767

47484768

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy