Skip to content

Commit 67c2759

Browse files
author
Moshe Zadka
committed
- #233253 - distutils/command/build_ext.py - the --define and --undef options
didn't work, whether specified on the command-line or in setup.cfg. - distutils/command/build_ext.py - make docstrings raw - python#128930 - distutils/command/build_ext.py - split rpath argument Suggested by AMK, but had to be massaged a bit from the cvs diff
1 parent aafd60c commit 67c2759

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Lib/distutils/command/build_ext.py

+19-1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def finalize_options (self):
151151
self.library_dirs = []
152152
if self.rpath is None:
153153
self.rpath = []
154+
elif type(self.rpath) is StringType:
155+
self.rpath = string.split(self.rpath, os.pathsep)
154156

155157
# for extensions under windows use different directories
156158
# for Release and Debug builds.
@@ -161,6 +163,22 @@ def finalize_options (self):
161163
self.build_temp = os.path.join(self.build_temp, "Debug")
162164
else:
163165
self.build_temp = os.path.join(self.build_temp, "Release")
166+
167+
# The argument parsing will result in self.define being a string, but
168+
# it has to be a list of 2-tuples. All the preprocessor symbols
169+
# specified by the 'define' option will be set to '1'. Multiple
170+
# symbols can be separated with commas.
171+
172+
if self.define:
173+
defines = string.split(self.define, ',')
174+
self.define = map(lambda symbol: (symbol, '1'), defines)
175+
176+
# The option for macros to undefine is also a string from the
177+
# option parsing, but has to be a list. Multiple symbols can also
178+
# be separated with commas here.
179+
if self.undef:
180+
self.undef = string.split(self.undef, ',')
181+
164182
# finalize_options ()
165183

166184

@@ -528,7 +546,7 @@ def get_ext_fullname (self, ext_name):
528546
return self.package + '.' + ext_name
529547

530548
def get_ext_filename (self, ext_name):
531-
"""Convert the name of an extension (eg. "foo.bar") into the name
549+
r"""Convert the name of an extension (eg. "foo.bar") into the name
532550
of the file from which it will be loaded (eg. "foo/bar.so", or
533551
"foo\bar.pyd").
534552
"""

Misc/NEWS

+7
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=<id>&group_id=5470&atid
155155

156156
- pyexpat.c - removed memory leaks
157157

158+
- #233253 - distutils/command/build_ext.py - the --define and --undef options
159+
didn't work, whether specified on the command-line or in setup.cfg.
160+
161+
- distutils/command/build_ext.py - make docstrings raw
162+
163+
- #128930 - distutils/command/build_ext.py - split rpath argument
164+
158165
What's New in Python 2.0?
159166
=========================
160167

0 commit comments

Comments
 (0)