Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 5229A9E8852 for ; Wed, 9 May 2012 16:43:05 -0300 (ADT) Received: from mailout-de.gmx.net ([213.165.64.23]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SSCmu-0001K0-3l for pgsql-bugs@postgresql.org; Wed, 09 May 2012 19:43:04 +0000 Received: (qmail invoked by alias); 09 May 2012 19:42:50 -0000 Received: from a88-115-214-103.elisa-laajakaista.fi (EHLO [10.0.0.104]) [88.115.214.103] by mail.gmx.net (mp069) with SMTP; 09 May 2012 21:42:50 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX1/+cM1rYav+aBoAKMGhMzaQSkH0IbE0YrdINJAHwX /xZt6zr540bVXp Message-ID: <1336592567.8747.12.camel@vanquo.pezone.net> Subject: Re: BUG #6633: PL/Python build does not honor PYTHON on Mac OS X From: Peter Eisentraut To: Clay McClure Cc: Tom Lane , pgsql-bugs@postgresql.org Date: Wed, 09 May 2012 22:42:47 +0300 In-Reply-To: References: <19685.1336455735@sss.pgh.pa.us> Content-Type: multipart/mixed; boundary="=-E4eE+/ULPyyeAd1WXzde" X-Mailer: Evolution 3.2.2-1 Mime-Version: 1.0 X-Y-GMX-Trusted: 0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/49 X-Sequence-Number: 33020 --=-E4eE+/ULPyyeAd1WXzde Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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. --=-E4eE+/ULPyyeAd1WXzde Content-Disposition: attachment; filename="plpython-macosx-framework-or-not.patch" Content-Type: text/x-patch; name="plpython-macosx-framework-or-not.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 --=-E4eE+/ULPyyeAd1WXzde--