Skip to content

Commit 010aa42

Browse files
committed
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.
1 parent 0fd7646 commit 010aa42

File tree

2 files changed

+40
-30
lines changed

2 files changed

+40
-30
lines changed

configure

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7542,23 +7542,28 @@ fi
75427542

75437543

75447544

7545-
# We need libpython as a shared library. With Python >=2.5, we check
7546-
# the Py_ENABLE_SHARED setting. OS X does supply a .dylib even
7547-
# though Py_ENABLE_SHARED does not get set. On Debian, the setting
7548-
# is not correct before the jessie release
7549-
# (http://bugs.debian.org/695979). We also want to support older
7550-
# Python versions. So as a fallback we see if there is a file that
7551-
# is named like a shared library.
7545+
# We need libpython as a shared library. With Python >=2.5, we
7546+
# check the Py_ENABLE_SHARED setting. On Debian, the setting is not
7547+
# correct before the jessie release (http://bugs.debian.org/695979).
7548+
# We also want to support older Python versions. So as a fallback
7549+
# we see if there is a file that is named like a shared library.
75527550

75537551
if test "$python_enable_shared" != 1; then
7554-
# We don't know the platform shared library extension here yet, so
7555-
# we try some candidates.
7556-
for dlsuffix in .so .dll .dylib .sl; do
7557-
if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then
7558-
python_enable_shared=1
7559-
break
7560-
fi
7561-
done
7552+
# OS X does supply a .dylib even though Py_ENABLE_SHARED does not
7553+
# get set. The file detection logic below doesn't succeed on
7554+
# older OS X versions, so make it explicit.
7555+
if test "$PORTNAME" = darwin; then
7556+
python_enable_shared=1
7557+
else
7558+
# We don't know the platform shared library extension here yet,
7559+
# so we try some candidates.
7560+
for dlsuffix in .so .dll .sl; do
7561+
if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then
7562+
python_enable_shared=1
7563+
break
7564+
fi
7565+
done
7566+
fi
75627567
fi
75637568

75647569
if test "$python_enable_shared" != 1; then

configure.in

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -902,23 +902,28 @@ if test "$with_python" = yes; then
902902
PGAC_PATH_PYTHON
903903
PGAC_CHECK_PYTHON_EMBED_SETUP
904904

905-
# We need libpython as a shared library. With Python >=2.5, we check
906-
# the Py_ENABLE_SHARED setting. OS X does supply a .dylib even
907-
# though Py_ENABLE_SHARED does not get set. On Debian, the setting
908-
# is not correct before the jessie release
909-
# (http://bugs.debian.org/695979). We also want to support older
910-
# Python versions. So as a fallback we see if there is a file that
911-
# is named like a shared library.
905+
# We need libpython as a shared library. With Python >=2.5, we
906+
# check the Py_ENABLE_SHARED setting. On Debian, the setting is not
907+
# correct before the jessie release (http://bugs.debian.org/695979).
908+
# We also want to support older Python versions. So as a fallback
909+
# we see if there is a file that is named like a shared library.
912910

913911
if test "$python_enable_shared" != 1; then
914-
# We don't know the platform shared library extension here yet, so
915-
# we try some candidates.
916-
for dlsuffix in .so .dll .dylib .sl; do
917-
if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then
918-
python_enable_shared=1
919-
break
920-
fi
921-
done
912+
# OS X does supply a .dylib even though Py_ENABLE_SHARED does not
913+
# get set. The file detection logic below doesn't succeed on
914+
# older OS X versions, so make it explicit.
915+
if test "$PORTNAME" = darwin; then
916+
python_enable_shared=1
917+
else
918+
# We don't know the platform shared library extension here yet,
919+
# so we try some candidates.
920+
for dlsuffix in .so .dll .sl; do
921+
if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then
922+
python_enable_shared=1
923+
break
924+
fi
925+
done
926+
fi
922927
fi
923928

924929
if test "$python_enable_shared" != 1; then

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy