]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merge from the trunk... just contains bugfixes, according to Jack and Just.
authorThomas Wouters <thomas@python.org>
Thu, 19 Jul 2001 11:14:41 +0000 (11:14 +0000)
committerThomas Wouters <thomas@python.org>
Thu, 19 Jul 2001 11:14:41 +0000 (11:14 +0000)
Lib/distutils/mwerkscompiler.py

index 2edc8259bfd456bde7b82811eedaa5672f84f463..46e16e2e9423b0e4c08bd80bf1f73608f36578c5 100644 (file)
@@ -62,10 +62,13 @@ class MWerksCompiler (CCompiler) :
                  debug=0,
                  extra_preargs=None,
                  extra_postargs=None):
+         (output_dir, macros, include_dirs) = \
+            self._fix_compile_args (output_dir, macros, include_dirs)
          self.__sources = sources
          self.__macros = macros
          self.__include_dirs = include_dirs
          # Don't need extra_preargs and extra_postargs for CW
+         return []
          
     def link (self,
               target_desc,
@@ -80,6 +83,11 @@ class MWerksCompiler (CCompiler) :
               extra_preargs=None,
               extra_postargs=None,
               build_temp=None):
+        # First fixup.
+        (objects, output_dir) = self._fix_object_args (objects, output_dir)
+        (libraries, library_dirs, runtime_library_dirs) = \
+            self._fix_lib_args (libraries, library_dirs, runtime_library_dirs)
+
         # First examine a couple of options for things that aren't implemented yet
         if not target_desc in (self.SHARED_LIBRARY, self.SHARED_OBJECT):
             raise DistutilsPlatformError, 'Can only make SHARED_LIBRARY or SHARED_OBJECT targets on the Mac'
@@ -114,6 +122,8 @@ class MWerksCompiler (CCompiler) :
         # into the project.
         if output_filename[-8:] == '.ppc.slb':
             basename = output_filename[:-8]
+        elif output_filename[-11:] == '.carbon.slb':
+            basename = output_filename[:-11]
         else:
             basename = os.path.strip(output_filename)[0]
         projectname = basename + '.mcp'
@@ -162,7 +172,7 @@ class MWerksCompiler (CCompiler) :
                 if value is None:
                     fp.write('#define %s\n'%name)
                 else:
-                    fp.write('#define %s "%s"\n'%(name, value))
+                    fp.write('#define %s %s\n'%(name, value))
             fp.close()
             settings['prefixname'] = prefixname
 
@@ -198,6 +208,11 @@ class MWerksCompiler (CCompiler) :
         if not os.path.isabs(filename):
            curdir = os.getcwd()
            filename = os.path.join(curdir, filename)
-        return filename
+        # Finally remove .. components
+        components = string.split(filename, ':')
+        for i in range(1, len(components)):
+           if components[i] == '..':
+              components[i] = ''
+        return string.join(components, ':')