pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Clay McClure <clay@daemons.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6633: PL/Python build does not honor PYTHON on Mac OS X
Date: Wed, 09 May 2012 22:42:47 +0300
Message-ID: <1336592567.8747.12.camel@vanquo.pezone.net> (raw)
In-Reply-To: <CAOVqfW-=coQSFtFFkr4FJ_8UrpA=UhDDHHma7r=5fg1JgjBxnA@mail.gmail.com>
References: <E1SRT2W-0001xH-EF@wrigleys.postgresql.org>
	<19685.1336455735@sss.pgh.pa.us>
	<CAOVqfW-YfHxq=X-cPJnyo_AUXa1whxsRjSYySDwQo1HVkGzeeg@mail.gmail.com>
	<CAOVqfW-=coQSFtFFkr4FJ_8UrpA=UhDDHHma7r=5fg1JgjBxnA@mail.gmail.com>

On tis, 2012-05-08 at 11:33 -0400, Clay McClure wrote:
> "The gist of it is to grab python-config --prefix and store it in a
> variable, say py_prefix. If the file $py_prefix/Python exists, you are
> dealing with a Framework build and -framework Python is the
> appropriate method of linking. Otherwise, you have a UNIX-style build
> and -lpython is the appropriate method of linking."

Please try the attached patch.  It's completely untested, as I don't
have that platform, but as a guidance about how it might work.

Attachments:

plpython-macosx-framework-or-not.patch (text/x-patch, 1.8K) download diff --git i/config/python.m4 w/config/python.m4 index baa7136..d051203 100644 --- i/config/python.m4 +++ w/config/python.m4 @@ -79,6 +79,15 @@ fi python_additional_libs=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"` +case $host_os in darwin*) + python_prefix=`${PYTHON} -c "import distutils.sysconfig; print(distutils.sysconfig.PREFIX)"` + if test -f "$python_prefix/Python"; then + python_libspec='-framework Python' + python_additional_libs= + fi + ;; +esac + AC_MSG_RESULT([${python_libspec} ${python_additional_libs}]) AC_SUBST(python_libdir)[]dnl diff --git i/configure w/configure index 60db1f7..5859b51 100755 --- i/configure +++ w/configure @@ -7387,6 +7387,15 @@ fi python_additional_libs=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"` +case $host_os in darwin*) + python_prefix=`${PYTHON} -c "import distutils.sysconfig; print(distutils.sysconfig.PREFIX)"` + if test -f "$python_prefix/Python"; then + python_libspec='-framework Python' + python_additional_libs= + fi + ;; +esac + { $as_echo "$as_me:$LINENO: result: ${python_libspec} ${python_additional_libs}" >&5 $as_echo "${python_libspec} ${python_additional_libs}" >&6; } diff --git i/src/pl/plpython/Makefile w/src/pl/plpython/Makefile index af6b459..e6a72fb 100644 --- i/src/pl/plpython/Makefile +++ w/src/pl/plpython/Makefile @@ -23,9 +23,9 @@ endif # Darwin (OS X) has its own ideas about how to do this. ifeq ($(PORTNAME), darwin) +ifneq(,$(filter -framework,$(python_libspec))) shared_libpython = yes -override python_libspec = -framework Python -override python_additional_libs = +endif endif # If we don't have a shared library and the platform doesn't allow it

view thread (5+ messages)

Message-ID: <1336592567.8747.12.camel@vanquo.pezone.net>
Permalink:  ../1336592567.8747.12.camel@vanquo.pezone.net/
Also on:    postgresql.org/message-id/1336592567.8747.12.camel@vanquo.pezone.net

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: peter_e@gmx.net, clay@daemons.net, tgl@sss.pgh.pa.us
  Subject: Re: BUG #6633: PL/Python build does not honor PYTHON on Mac OS X
  In-Reply-To: <1336592567.8747.12.camel@vanquo.pezone.net>
  References: <E1SRT2W-0001xH-EF@wrigleys.postgresql.org> <19685.1336455735@sss.pgh.pa.us> <CAOVqfW-YfHxq=X-cPJnyo_AUXa1whxsRjSYySDwQo1HVkGzeeg@mail.gmail.com> <CAOVqfW-=coQSFtFFkr4FJ_8UrpA=UhDDHHma7r=5fg1JgjBxnA@mail.gmail.com> <1336592567.8747.12.camel@vanquo.pezone.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox