summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/sysconfig.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-04-10 12:39:36 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-04-10 12:39:36 (GMT)
commit10acfd00b28a2aad7b73d35afdbc64b0baebea20 (patch)
tree9ab088c0b68465a844b045b6cfc9ddbefdfa84f0 /Lib/distutils/sysconfig.py
parentb04dee935c0f6d3104e43f25251968c665e6e3dd (diff)
downloadcpython-10acfd00b28a2aad7b73d35afdbc64b0baebea20.zip
cpython-10acfd00b28a2aad7b73d35afdbc64b0baebea20.tar.gz
cpython-10acfd00b28a2aad7b73d35afdbc64b0baebea20.tar.bz2
Patch #1429775: Link Python modules to libpython on linux if
--enable-shared. Fixes #832799.
Diffstat (limited to 'Lib/distutils/sysconfig.py')
-rw-r--r--Lib/distutils/sysconfig.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 0feb14a..eafd49e 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -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.