diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2015-05-01 23:12:45 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2015-05-01 23:12:45 -0400 |
commit | 010aa420b9dd5393490c8793f43949dca269a753 (patch) | |
tree | 7576324b25bb15ab6b8b8bfd6be8247faba226b6 | |
parent | 0fd764647a9910a340359bb319929b70317b2ae4 (diff) | |
download | postgresql-010aa420b9dd5393490c8793f43949dca269a753.tar.gz postgresql-010aa420b9dd5393490c8793f43949dca269a753.zip |
Fix shared libpython detection on OS X
Apparently, looking for an appropriately named file doesn't work on some
older versions, so put the back the explicit platform detection.
-rwxr-xr-x | configure | 35 | ||||
-rw-r--r-- | configure.in | 35 |
2 files changed, 40 insertions, 30 deletions
diff --git a/configure b/configure index 98f6516c9a8..17105fa9e95 100755 --- a/configure +++ b/configure @@ -7542,23 +7542,28 @@ fi - # We need libpython as a shared library. With Python >=2.5, we check - # the Py_ENABLE_SHARED setting. OS X does supply a .dylib even - # though Py_ENABLE_SHARED does not get set. On Debian, the setting - # is not correct before the jessie release - # (http://bugs.debian.org/695979). We also want to support older - # Python versions. So as a fallback we see if there is a file that - # is named like a shared library. + # We need libpython as a shared library. With Python >=2.5, we + # check the Py_ENABLE_SHARED setting. On Debian, the setting is not + # correct before the jessie release (http://bugs.debian.org/695979). + # We also want to support older Python versions. So as a fallback + # we see if there is a file that is named like a shared library. if test "$python_enable_shared" != 1; then - # We don't know the platform shared library extension here yet, so - # we try some candidates. - for dlsuffix in .so .dll .dylib .sl; do - if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then - python_enable_shared=1 - break - fi - done + # OS X does supply a .dylib even though Py_ENABLE_SHARED does not + # get set. The file detection logic below doesn't succeed on + # older OS X versions, so make it explicit. + if test "$PORTNAME" = darwin; then + python_enable_shared=1 + else + # We don't know the platform shared library extension here yet, + # so we try some candidates. + for dlsuffix in .so .dll .sl; do + if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then + python_enable_shared=1 + break + fi + done + fi fi if test "$python_enable_shared" != 1; then diff --git a/configure.in b/configure.in index 0080515c0c6..6cc47cd5d57 100644 --- a/configure.in +++ b/configure.in @@ -902,23 +902,28 @@ if test "$with_python" = yes; then PGAC_PATH_PYTHON PGAC_CHECK_PYTHON_EMBED_SETUP - # We need libpython as a shared library. With Python >=2.5, we check - # the Py_ENABLE_SHARED setting. OS X does supply a .dylib even - # though Py_ENABLE_SHARED does not get set. On Debian, the setting - # is not correct before the jessie release - # (http://bugs.debian.org/695979). We also want to support older - # Python versions. So as a fallback we see if there is a file that - # is named like a shared library. + # We need libpython as a shared library. With Python >=2.5, we + # check the Py_ENABLE_SHARED setting. On Debian, the setting is not + # correct before the jessie release (http://bugs.debian.org/695979). + # We also want to support older Python versions. So as a fallback + # we see if there is a file that is named like a shared library. if test "$python_enable_shared" != 1; then - # We don't know the platform shared library extension here yet, so - # we try some candidates. - for dlsuffix in .so .dll .dylib .sl; do - if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then - python_enable_shared=1 - break - fi - done + # OS X does supply a .dylib even though Py_ENABLE_SHARED does not + # get set. The file detection logic below doesn't succeed on + # older OS X versions, so make it explicit. + if test "$PORTNAME" = darwin; then + python_enable_shared=1 + else + # We don't know the platform shared library extension here yet, + # so we try some candidates. + for dlsuffix in .so .dll .sl; do + if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then + python_enable_shared=1 + break + fi + done + fi fi if test "$python_enable_shared" != 1; then |