summaryrefslogtreecommitdiff
path: root/Lib/distutils/command
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-03-17 20:15:41 +0000
committerAndrew M. Kuchling <amk@amk.ca>2001-03-17 20:15:41 +0000
commit2de370c26b47ce18a8f3d74acc36ecc4910cface (patch)
tree6840d52bdf741579ea2c88e9a6134d37150d5973 /Lib/distutils/command
parent41b7af1c27fb3e23ab272ac24702420dee23b3dd (diff)
downloadcpython-2de370c26b47ce18a8f3d74acc36ecc4910cface.tar.gz
Fix bug #233253: the --define and --undef options didn't work, whether
specified on the command-line or in setup.cfg. The option processing leaves them as strings, but they're supposed to be lists.
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r--Lib/distutils/command/build_ext.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index 866697577d..f732373ea3 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -177,6 +177,21 @@ class build_ext (Command):
# building python standard extensions
self.library_dirs.append('.')
+ # 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 ()