On Thu, Aug 04, 2005 at 08:14:51PM +0200, Stefan Kaltenbrunner wrote:
> Tom Lane wrote:
> >Andrew Dunstan <[EMAIL PROTECTED]> writes:
> >>Tom Lane wrote:
> >>>The alternative is to say that plpython isn't supported on BSDen unless
> >>>you choose to build an unthreaded libpython.
> >>I'm OK with that, but if that's what's done I think we should check for 
> >>it up front at configure time and not let it fail at run time like we do 
> >>now.
> > 
> > If you can create a suitable configure test, it'd be fine with me.
> 
> Not sure if it is of any help but mod_python seems to be using this
> configure.in snippet to detect (and reject) a threaded python installation:

Ok, I converted this to patch against config/python.m4.

Also made it work  with python 2.3, 2.4 that return 'True' not '1'.

The error is thrown only on BSD's.  As I understand threaded
python works fine on other OS'es?

Error message may need clarifying.

-- 
marko

Index: config/python.m4
===================================================================
RCS file: /projects/cvsroot/pgsql/config/python.m4,v
retrieving revision 1.11
diff -c -c -r1.11 python.m4
*** config/python.m4    11 Oct 2004 19:32:16 -0000      1.11
--- config/python.m4    4 Aug 2005 19:43:45 -0000
***************
*** 77,80 ****
--- 77,95 ----
  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
+   *bsd*)
+     AC_MSG_ERROR([*** Threaded python not supported ***])
+     ;;
+   esac
+ else
+   AC_MSG_RESULT(no)
+ fi
+ 
  ])# PGAC_CHECK_PYTHON_EMBED_SETUP
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to