[Python-checkins] CVS: python/dist/src/Lib/distutils/command bdist.py,1.22,1.23 bdist_dumb.py,1.17,1.18 build_ext.py,1.78,1.79 install.py,1.60,1.61

M.-A. Lemburg lemburg@users.sourceforge.net
Thu, 31 Jan 2002 10:56:06 -0800


Update of /cvsroot/python/python/dist/src/Lib/distutils/command
In directory usw-pr-cvs1:/tmp/cvs-serv11495/Lib/distutils/command

Modified Files:
	bdist.py bdist_dumb.py build_ext.py install.py 
Log Message:
OS/2 patches by Andrew I MacIntyre for distutils.

Closes patch #435381.



Index: bdist.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** bdist.py	2002/01/12 11:27:42	1.22
--- bdist.py	2002/01/31 18:55:58	1.23
***************
*** 58,62 ****
      # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
      default_format = { 'posix': 'gztar',
!                        'nt': 'zip', }
  
      # Establish the preferred order (for the --help-formats option).
--- 58,63 ----
      # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
      default_format = { 'posix': 'gztar',
!                        'nt': 'zip',
!                        'os2': 'zip', }
  
      # Establish the preferred order (for the --help-formats option).

Index: bdist_dumb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_dumb.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** bdist_dumb.py	2002/01/12 11:27:42	1.17
--- bdist_dumb.py	2002/01/31 18:55:59	1.18
***************
*** 38,42 ****
  
      default_format = { 'posix': 'gztar',
!                        'nt': 'zip', }
  
  
--- 38,43 ----
  
      default_format = { 'posix': 'gztar',
!                        'nt': 'zip',
!                        'os2': 'zip' }
  
  
***************
*** 89,92 ****
--- 90,99 ----
          archive_basename = "%s.%s" % (self.distribution.get_fullname(),
                                        self.plat_name)
+ 
+         # OS/2 objects to any ":" characters in a filename (such as when
+         # a timestamp is used in a version) so change them to hyphens.
+         if os.name == "os2":
+             archive_basename = archive_basename.replace(":", "-")
+ 
          self.make_archive(os.path.join(self.dist_dir, archive_basename),
                            self.format,

Index: build_ext.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_ext.py,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** build_ext.py	2002/01/18 20:30:53	1.78
--- build_ext.py	2002/01/31 18:56:00	1.79
***************
*** 168,171 ****
--- 168,176 ----
                  self.build_temp = os.path.join(self.build_temp, "Release")
  
+         # OS/2 (EMX) doesn't support Debug vs Release builds, but has the 
+         # import libraries in its "Config" subdirectory
+         if os.name == 'os2':
+             self.library_dirs.append(os.path.join(sys.exec_prefix, 'Config'))
+ 
          # for extensions under Cygwin Python's library directory must be
          # appended to library_dirs
***************
*** 555,558 ****
--- 560,567 ----
                  return "swig.exe"
  
+         elif os.name == "os2":
+             # assume swig available in the PATH.
+             return "swig.exe"
+ 
          else:
              raise DistutilsPlatformError, \
***************
*** 579,582 ****
--- 588,594 ----
          from distutils.sysconfig import get_config_var
          ext_path = string.split(ext_name, '.')
+         # OS/2 has an 8 character module (extension) limit :-(
+         if os.name == "os2":
+             ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
          # extensions in debug_mode are named 'module_d.pyd' under windows
          so_ext = get_config_var('SO')
***************
*** 600,604 ****
          """Return the list of libraries to link against when building a
          shared extension.  On most platforms, this is just 'ext.libraries';
!         on Windows, we add the Python library (eg. python20.dll).
          """
          # The python library is always needed on Windows.  For MSVC, this
--- 612,616 ----
          """Return the list of libraries to link against when building a
          shared extension.  On most platforms, this is just 'ext.libraries';
!         on Windows and OS/2, we add the Python library (eg. python20.dll).
          """
          # The python library is always needed on Windows.  For MSVC, this
***************
*** 613,616 ****
--- 625,641 ----
              if self.debug:
                  template = template + '_d'
+             pythonlib = (template %
+                    (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
+             # don't extend ext.libraries, it may be shared with other
+             # extensions, it is a reference to the original list
+             return ext.libraries + [pythonlib]
+         elif sys.platform == "os2emx":
+             # EMX/GCC requires the python library explicitly, and I
+             # believe VACPP does as well (though not confirmed) - AIM Apr01
+             template = "python%d%d"
+             # debug versions of the main DLL aren't supported, at least 
+             # not at this time - AIM Apr01
+             #if self.debug:
+             #    template = template + '_d'
              pythonlib = (template %
                     (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))

Index: install.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/install.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** install.py	2001/12/06 20:57:12	1.60
--- install.py	2002/01/31 18:56:00	1.61
***************
*** 56,59 ****
--- 56,66 ----
          'scripts': '$base/Scripts',
          'data'   : '$base',
+         },
+     'os2': {
+         'purelib': '$base/Lib/site-packages',
+         'platlib': '$base/Lib/site-packages',
+         'headers': '$base/Include/$dist_name',
+         'scripts': '$base/Scripts',
+         'data'   : '$base',
          }
      }