[Python-checkins] CVS: distutils/distutils cygwinccompiler.py,1.4,1.5

Greg Ward python-dev@python.org
Sat, 12 Aug 2000 17:43:58 -0700


Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv5461

Modified Files:
	cygwinccompiler.py 
Log Message:
Rene Liebscher:
  * use self.debug_print() for debug messages
  * uses now copy.copy() to copy lists
  * added 'shared_lib_extension=".dll"', ... , this is necessary if you
    want use the compiler class outside of the standard distutils build
    process.
  * changed result type of check_config_h() from int to string


Index: cygwinccompiler.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/cygwinccompiler.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** cygwinccompiler.py	2000/08/02 01:31:56	1.4
--- cygwinccompiler.py	2000/08/13 00:43:56	1.5
***************
*** 45,49 ****
  __revision__ = "$Id$"
  
! import os,sys
  from distutils.unixccompiler import UnixCCompiler
  from distutils.file_util import write_file
--- 45,49 ----
  __revision__ = "$Id$"
  
! import os,sys,copy
  from distutils.unixccompiler import UnixCCompiler
  from distutils.file_util import write_file
***************
*** 52,58 ****
  
      compiler_type = 'cygwin'
!     gcc_version = None
!     dllwrap_version = None
!     ld_version = None
     
      def __init__ (self,
--- 52,61 ----
  
      compiler_type = 'cygwin'
!     obj_extension = ".o"
!     static_lib_extension = ".a"
!     shared_lib_extension = ".dll"
!     static_lib_format = "lib%s%s"
!     shared_lib_format = "%s%s"
!     exe_extension = ".exe"
     
      def __init__ (self,
***************
*** 63,67 ****
          UnixCCompiler.__init__ (self, verbose, dry_run, force)
  
!         if check_config_h()<=0:
              self.warn(
                  "Python's config.h doesn't seem to support your compiler. "
--- 66,72 ----
          UnixCCompiler.__init__ (self, verbose, dry_run, force)
  
!         check_result = check_config_h()
!         self.debug_print("Python's GCC status: %s" % check_result)
!         if check_result[:2] <> "OK":
              self.warn(
                  "Python's config.h doesn't seem to support your compiler. "
***************
*** 70,74 ****
          (self.gcc_version, self.ld_version, self.dllwrap_version) = \
              get_versions()
!         sys.stderr.write(self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" %
                           (self.gcc_version, 
                            self.ld_version, 
--- 75,79 ----
          (self.gcc_version, self.ld_version, self.dllwrap_version) = \
              get_versions()
!         self.debug_print(self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" %
                           (self.gcc_version, 
                            self.ld_version, 
***************
*** 118,124 ****
                              build_temp=None):
          
!         # use separate copies, so can modify the lists
!         extra_preargs = list(extra_preargs or [])
!         libraries = list(libraries or [])
          
          # Additional libraries
--- 123,129 ----
                              build_temp=None):
          
!         # use separate copies, so we can modify the lists
!         extra_preargs = copy.copy(extra_preargs or [])
!         libraries = copy.copy(libraries or [])
          
          # Additional libraries
***************
*** 242,250 ****
      """
      # return values
!     #  2: OK, python was compiled with GCC
!     #  1: OK, python's config.h mentions __GCC__
!     #  0: uncertain, because we couldn't check it
!     # -1: probably not OK, because we didn't found it in config.h
!     # You could check check_config_h()>0 => OK
  
      from distutils import sysconfig
--- 247,255 ----
      """
      # return values
!     #  "OK, python was compiled with GCC"
!     #  "OK, python's config.h mentions __GCC__"
!     #  "uncertain, because we couldn't check it"
!     #  "not OK, because we didn't found __GCC__ in config.h"
!     # You could check check_config_h()[:2] == "OK"
  
      from distutils import sysconfig
***************
*** 255,259 ****
          pass # go to the next test
      else:
!         return 2
      
      try:
--- 260,264 ----
          pass # go to the next test
      else:
!         return "OK, python was compiled with GCC"
      
      try:
***************
*** 266,277 ****
          # is somewhere a #ifdef __GNUC__ or something similar
          if -1 == string.find(s,"__GNUC__"):
!             return -1  
          else:
!             return 1
      except IOError:
          # if we can't read this file, we cannot say it is wrong
          # the compiler will complain later about this file as missing
          pass
!     return 0
  
  def get_versions():
--- 271,282 ----
          # is somewhere a #ifdef __GNUC__ or something similar
          if -1 == string.find(s,"__GNUC__"):
!             return "not OK, because we didn't found __GCC__ in config.h"
          else:
!             return "OK, python's config.h mentions __GCC__"
      except IOError:
          # if we can't read this file, we cannot say it is wrong
          # the compiler will complain later about this file as missing
          pass
!     return "uncertain, because we couldn't check it"
  
  def get_versions():