]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- #233253 - distutils/command/build_ext.py - the --define and --undef options
authorMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 16:09:32 +0000 (16:09 +0000)
committerMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 16:09:32 +0000 (16:09 +0000)
            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

Lib/distutils/command/build_ext.py
Misc/NEWS

index 70e8a73455c4be38ecf5c75726a9b7edbccd50ec..c1bce267555e9f4c31c09b2826774250dce95ab3 100644 (file)
@@ -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").
         """
index ed83f987976ff40797d82bfdbc9ff2c2be1e36df..b4ac693aa08b74238610b45e50777587e1bf2c55 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -155,6 +155,13 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=<id>&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?
 =========================