[Python-checkins] python/dist/src/Lib/distutils cygwinccompiler.py,1.21,1.22

jlt63@users.sourceforge.net jlt63@users.sourceforge.net
Wed, 09 Apr 2003 09:04:01 -0700


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory sc8-pr-cvs1:/tmp/cvs-serv31414

Modified Files:
	cygwinccompiler.py 
Log Message:
Patch #709178: remove -static option from cygwinccompiler

Currently, the cygwinccompiler.py compiler handling in 
distutils is invoking the cygwin and mingw compilers 
with the -static option. 

Logically, this means that the linker should choose to 
link to static libraries instead of shared/dynamically 
linked libraries. 

Current win32 binutils expect import libraries to have 
a .dll.a suffix and static libraries to have .a suffix. 
If -static is passed, it will skip the .dll.a 
libraries. This is pain if one has a tree with both 
static and dynamic libraries using this naming 
convention, and wish to use the dynamic libraries. 

The -static option being passed in distutils is to get 
around a bug in old versions of binutils where it would 
get confused when it found the DLLs themselves. 

The decision to use static or shared libraries is site 
or package specific, and should be left to the setup 
script or to command line options.


Index: cygwinccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/cygwinccompiler.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** cygwinccompiler.py	19 Nov 2002 13:12:27 -0000	1.21
--- cygwinccompiler.py	9 Apr 2003 16:03:57 -0000	1.22
***************
*** 34,43 ****
  #   - its dllwrap doesn't work, there is a bug in binutils 2.10.90
  #     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.)
- #     By specifying -static we force ld to link against the import libraries,
- #     this is windows standard and there are normally not the necessary symbols
- #     in the dlls.
  #   *** only the version of June 2000 shows these problems
  
--- 34,37 ----
***************
*** 99,103 ****
                               compiler_so='gcc -mcygwin -mdll -O -Wall',
                               linker_exe='gcc -mcygwin',
!                              linker_so=('%s -mcygwin -mdll -static' %
                                          self.linker_dll))
  
--- 93,97 ----
                               compiler_so='gcc -mcygwin -mdll -O -Wall',
                               linker_exe='gcc -mcygwin',
!                              linker_so=('%s -mcygwin -mdll' %
                                          self.linker_dll))
  
***************
*** 279,283 ****
                               compiler_so='gcc -mno-cygwin -mdll -O -Wall',
                               linker_exe='gcc -mno-cygwin',
!                              linker_so='%s -mno-cygwin -mdll -static %s'
                                          % (self.linker_dll, entry_point))
          # Maybe we should also append -mthreads, but then the finished
--- 273,277 ----
                               compiler_so='gcc -mno-cygwin -mdll -O -Wall',
                               linker_exe='gcc -mno-cygwin',
!                              linker_so='%s -mno-cygwin -mdll %s'
                                          % (self.linker_dll, entry_point))
          # Maybe we should also append -mthreads, but then the finished