mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Patch #1429775: Link Python modules to libpython on linux if
--enable-shared. Fixes #832799.
This commit is contained in:
parent
b04dee935c
commit
10acfd00b2
3 changed files with 26 additions and 4 deletions
|
|
@ -213,8 +213,8 @@ def parse_config_h(fp, g=None):
|
|||
"""
|
||||
if g is None:
|
||||
g = {}
|
||||
define_rx = re.compile("#define ([A-Z][A-Z0-9_]+) (.*)\n")
|
||||
undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n")
|
||||
define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
|
||||
undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")
|
||||
#
|
||||
while 1:
|
||||
line = fp.readline()
|
||||
|
|
@ -351,6 +351,17 @@ def _init_posix():
|
|||
|
||||
raise DistutilsPlatformError(my_msg)
|
||||
|
||||
# load the installed pyconfig.h:
|
||||
try:
|
||||
filename = get_config_h_filename()
|
||||
parse_config_h(file(filename), g)
|
||||
except IOError, msg:
|
||||
my_msg = "invalid Python installation: unable to open %s" % filename
|
||||
if hasattr(msg, "strerror"):
|
||||
my_msg = my_msg + " (%s)" % msg.strerror
|
||||
|
||||
raise DistutilsPlatformError(my_msg)
|
||||
|
||||
# On MacOSX we need to check the setting of the environment variable
|
||||
# MACOSX_DEPLOYMENT_TARGET: configure bases some choices on it so
|
||||
# it needs to be compatible.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue