From: Moshe Zadka Date: Sat, 31 Mar 2001 16:09:32 +0000 (+0000) Subject: - #233253 - distutils/command/build_ext.py - the --define and --undef options X-Git-Tag: v2.0.1c1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67c2759c5a35b99272d2ed1c5b0c4f2a3e246d90;p=thirdparty%2FPython%2Fcpython.git - #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 - #128930 - distutils/command/build_ext.py - split rpath argument Suggested by AMK, but had to be massaged a bit from the cvs diff --- diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 70e8a73455c4..c1bce267555e 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -151,6 +151,8 @@ class build_ext (Command): self.library_dirs = [] if self.rpath is None: self.rpath = [] + elif type(self.rpath) is StringType: + self.rpath = string.split(self.rpath, os.pathsep) # for extensions under windows use different directories # for Release and Debug builds. @@ -161,6 +163,22 @@ class build_ext (Command): self.build_temp = os.path.join(self.build_temp, "Debug") else: self.build_temp = os.path.join(self.build_temp, "Release") + + # The argument parsing will result in self.define being a string, but + # it has to be a list of 2-tuples. All the preprocessor symbols + # specified by the 'define' option will be set to '1'. Multiple + # symbols can be separated with commas. + + if self.define: + defines = string.split(self.define, ',') + self.define = map(lambda symbol: (symbol, '1'), defines) + + # The option for macros to undefine is also a string from the + # option parsing, but has to be a list. Multiple symbols can also + # be separated with commas here. + if self.undef: + self.undef = string.split(self.undef, ',') + # finalize_options () @@ -528,7 +546,7 @@ class build_ext (Command): return self.package + '.' + ext_name def get_ext_filename (self, ext_name): - """Convert the name of an extension (eg. "foo.bar") into the name + r"""Convert the name of an extension (eg. "foo.bar") into the name of the file from which it will be loaded (eg. "foo/bar.so", or "foo\bar.pyd"). """ diff --git a/Misc/NEWS b/Misc/NEWS index ed83f987976f..b4ac693aa08b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -155,6 +155,13 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=&group_id=5470&atid - pyexpat.c - removed memory leaks +- #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 + +- #128930 - distutils/command/build_ext.py - split rpath argument + What's New in Python 2.0? =========================