[Distutils] static libs, unixccompiler.py, darwin

Just van Rossum just@letterror.com
Tue Feb 5 16:31:02 2002


A while back I posted about Darwin (OSX) needs to run ranlib when creating
static libraries. I've created a patch and wanted to run it by you guys. Does
the patch below look reasonable? Thanks,

Just


Index: unixccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/unixccompiler.py,v
retrieving revision 1.38
diff -c -3 -r1.38 unixccompiler.py
*** unixccompiler.py    2001/12/11 05:04:24     1.38
--- unixccompiler.py    2002/02/05 21:26:44
***************
*** 17,23 ****
  
  __revision__ = "$Id: unixccompiler.py,v 1.38 2001/12/11 05:04:24 fdrake Exp $"
  
! import string, re, os
  from types import *
  from copy import copy
  from distutils import sysconfig
--- 17,23 ----
  
  __revision__ = "$Id: unixccompiler.py,v 1.38 2001/12/11 05:04:24 fdrake Exp $"
  
! import string, re, os, sys
  from types import *
  from copy import copy
  from distutils import sysconfig
***************
*** 61,66 ****
--- 61,69 ----
                     'archiver'     : ["ar", "-cr"],
                     'ranlib'       : None,
                    }
+ 
+     if sys.platform.startswith("darwin"):
+         executables['ranlib'] = ["ranlib"]
  
      # Needed for the filename generation methods provided by the base
      # class, CCompiler.  NB. whoever instantiates/uses a particular