[Distutils] some small bugs

Rene Liebscher R.Liebscher@gmx.de
Wed Aug 30 06:33:03 2000


This is a multi-part message in MIME format.
--------------E3F8885FAEBEE2CB962E4988
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

It seems I attached the patches to a wrong mail.
Here they are.

Kind regards

Rene Liebscher
--------------E3F8885FAEBEE2CB962E4988
Content-Type: text/plain; charset=us-ascii;
 name="bcppcompiler.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bcppcompiler.patch"

diff -BurN --exclude=*.pyc --minimal distutils.orig/distutils/bcppcompiler.py distutils.patched/distutils/bcppcompiler.py
--- distutils.orig/distutils/bcppcompiler.py	Mon Aug 14 15:13:04 2000
+++ distutils.patched/distutils/bcppcompiler.py	Wed Aug 30 11:18:07 2000
@@ -224,17 +224,6 @@
             else:
                 ld_args = self.ldflags_shared[:]
 
-            # Borland C++ has problems with '/' in paths
-            objects = map(os.path.normpath, objects)
-            startup_obj = 'c0d32'
-            objects.insert(0, startup_obj)
-
-            # either exchange python15.lib in the python libs directory against
-            # a Borland-like one, or create one with name bcpp_python15.lib 
-            # there and remove the pragmas from config.h  
-            libraries.append ('import32')
-            libraries.append ('cw32mt')
-
             # Create a temporary exports file for use by the linker
             head, tail = os.path.split (output_filename)
             modname, ext = os.path.splitext (tail)
@@ -246,6 +235,17 @@
             self.execute(write_file, (def_file, contents),
                          "writing %s" % def_file)
 
+            # Borland C++ has problems with '/' in paths
+            objects = map(os.path.normpath, objects)
+            startup_obj = 'c0d32'
+            objects.insert(0, startup_obj)
+
+            # either exchange python15.lib in the python libs directory against
+            # a Borland-like one, or create one with name bcpp_python15.lib 
+            # there and remove the pragmas from config.h  
+            libraries.append ('import32')
+            libraries.append ('cw32mt')
+
             # Start building command line flags and options.
 
             for l in library_dirs:
@@ -377,9 +377,9 @@
         # seems to have a different format for static libraries.
         if debug:
             dlib = (lib + "_d")
-            try_names = ("bcpp_" + dlib, "bcpp_" + lib, dlib, lib)
+            try_names = (dlib + "_bcpp", lib + "_bcpp", dlib, lib)
         else:
-            try_names = ("bcpp_" + lib, lib)
+            try_names = (lib + "_bcpp", lib)
 
         for dir in dirs:
             for name in try_names:

--------------E3F8885FAEBEE2CB962E4988
Content-Type: text/plain; charset=us-ascii;
 name="sysconfig.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sysconfig.patch"

diff -BurN --exclude=*.pyc --minimal distutils.orig/distutils/sysconfig.py distutils.patched/distutils/sysconfig.py
--- distutils.orig/distutils/sysconfig.py	Thu Aug  3 11:00:00 2000
+++ distutils.patched/distutils/sysconfig.py	Wed Aug 30 11:18:50 2000
@@ -254,6 +254,15 @@
         python_exp = os.path.join(python_lib, 'config', 'python.exp')
 
         g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp)
+    if sys.platform == 'beos':
+        # Linker script is in the config directory.
+        # In the Makefile it is relative to the srcdir, which after
+        # installation no longer makes sense
+        python_lib = get_python_lib(standard_lib=1)
+        linkerscript_name = os.path.basename(string.split(g['LDSHARED'],' ')[0])
+        linkerscript = os.path.join(python_lib, 'config', linkerscript_name)
+        g['LDSHARED'] = ("%s -L%s/lib -lpython%s" 
+                                   % (linkerscript,sys.prefix,sys.version[0:3]))
 
 
 def _init_nt():

--------------E3F8885FAEBEE2CB962E4988
Content-Type: text/plain; charset=us-ascii;
 name="cygwin.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cygwin.patch"

diff -BurN --exclude=*.pyc --minimal distutils.orig/distutils/cygwinccompiler.py distutils.patched/distutils/cygwinccompiler.py
--- distutils.orig/distutils/cygwinccompiler.py	Mon Aug 14 15:13:04 2000
+++ distutils.patched/distutils/cygwinccompiler.py	Wed Aug 30 11:18:07 2000
@@ -18,7 +18,7 @@
 #
 #   see also http://starship.python.net/crew/kernr/mingw32/Notes.html
 #
-# * We use put export_symbols in a def-file, and don't use 
+# * We put export_symbols in a def-file, and don't use 
 #   --export-all-symbols because it doesn't worked reliable in some
 #   tested configurations. And because other windows compilers also
 #   need their symbols specified this no serious problem.
@@ -32,7 +32,7 @@
 #   (ld doesn't support -shared, so we use dllwrap)   
 # * cygwin gcc 2.95.2/ld 2.10.90/dllwrap 2.10.90 works now
 #   - its dllwrap doesn't work, there is a bug in binutils 2.10.90
-#     see also .....
+#     see also http://sources.redhat.com/ml/cygwin/2000-06/msg01274.html
 #   - using gcc -mdll instead dllwrap doesn't work without -static because 
 #     it tries to link against dlls instead their import libraries. (If
 #     it finds the dll first.)

--------------E3F8885FAEBEE2CB962E4988
Content-Type: text/plain; charset=us-ascii;
 name="bdist_wininst.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bdist_wininst.patch"

diff -BurN --exclude=*.pyc --minimal distutils.orig/distutils/command/bdist_wininst.py distutils.patched/distutils/command/bdist_wininst.py
--- distutils.orig/distutils/command/bdist_wininst.py	Wed Aug 30 11:03:53 2000
+++ distutils.patched/distutils/command/bdist_wininst.py	Wed Aug 30 11:29:38 2000
@@ -64,6 +64,15 @@
 
     def run (self):
 
+        if (sys.platform <> "win32" and 
+            ( self.distribution.has_ext_modules()
+            or self.distribution.has_c_libraries()
+            or self.distribution.has_scripts())):
+                raise DistutilsPlatformError (
+# first line is shorter because it is preceeded by the exception class
+"""*** If your module contains compiled 
+extensions, you have to build the win32 installer on a win32 platform. ***""")
+
         self.run_command ('build')
 
         install = self.reinitialize_command('install')
@@ -109,7 +118,8 @@
         # a file is (at least) useful for debugging bdist_wininst.
 
         metadata = self.distribution.metadata
-        ini_name = "%s.ini" % metadata.get_fullname()
+        ini_name = os.path.join(self.dist_dir,
+                                      "%s.ini" % metadata.get_fullname())
 
         self.announce ("creating %s" % ini_name)
         inifile = open (ini_name, "w")
@@ -149,6 +159,8 @@
     def create_exe (self, arcname, fullname):
         import struct#, zlib
 
+        self.mkpath(self.dist_dir)
+        
         cfgdata = open (self.create_inifile()).read()
 
         installer_name = os.path.join(self.dist_dir,

--------------E3F8885FAEBEE2CB962E4988--