diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-05-30 18:18:11 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-05-30 18:19:06 -0400 |
commit | 20561acf93d32b7d7fdd59d054344b2e341d6aa0 (patch) | |
tree | 0e0abfdeda5d3bf4247416850a179c46b0628033 /src | |
parent | 512f3b03e3cddf7dc1901c0e062500133e534c1d (diff) | |
download | postgresql-20561acf93d32b7d7fdd59d054344b2e341d6aa0.tar.gz postgresql-20561acf93d32b7d7fdd59d054344b2e341d6aa0.zip |
On OS X, link libpython normally, ignoring the "framework" framework.
As of Xcode 5.0, Apple isn't including the Python framework as part of the
SDK-level files, which means that linking to it might fail depending on
whether Xcode thinks you've selected a specific SDK version. According to
their Tech Note 2328, they've basically deprecated the framework method of
linking to libpython and are telling people to link to the shared library
normally. (I'm pretty sure this is in direct contradiction to the advice
they were giving a few years ago, but whatever.) Testing says that this
approach works fine at least as far back as OS X 10.4.11, so let's just
rip out the framework special case entirely. We do still need a special
case to decide that OS X provides a shared library at all, unfortunately
(I wonder why the distutils check doesn't work ...). But this is still
less of a special case than before, so it's fine.
Back-patch to all supported branches, since we'll doubtless be hearing
about this more as more people update to recent Xcode.
Diffstat (limited to 'src')
-rw-r--r-- | src/pl/plpython/Makefile | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile index 46d2030d698..020861a4f8b 100644 --- a/src/pl/plpython/Makefile +++ b/src/pl/plpython/Makefile @@ -9,16 +9,19 @@ include $(top_builddir)/src/Makefile.global # asks Python directly. But because this has been broken in Debian # for a long time (http://bugs.debian.org/695979), and to support # older Python versions, we see if there is a file that is named like -# a shared library as a fallback. (Note that this is wrong on OS X, -# where DLSUFFIX is .so, but libpython is a .dylib. Python <2.5 is -# therefore not supported on OS X.) +# a shared library as a fallback. ifeq (1,$(python_enable_shared)) shared_libpython = yes else +ifeq ($(PORTNAME), darwin) +# OS X does supply a .dylib even though Py_ENABLE_SHARED does not get set +shared_libpython = yes +else ifneq (,$(wildcard $(python_libdir)/libpython*$(DLSUFFIX)*)) shared_libpython = yes endif endif +endif # Windows needs to convert backslashed paths to normal slashes, # and we have to remove -lpython from the link since we are building our own |