[Python-checkins] CVS: distutils/distutils unixccompiler.py,1.20,1.21
Greg Ward
python-dev@python.org
2000年4月13日 20:48:18 -0400 (EDT)
Update of /projects/cvsroot/distutils/distutils
In directory kaluha:/tmp/cvs-serv27189
Modified Files:
unixccompiler.py
Log Message:
Cleaned up use of sysconfig module a bit: don't import more names
than we actually use, and do actually use AR and SO.
Run ranlib on static libraries. (Should probably have a platform-check
so we don't run ranlib when it's not necessary, ie. on most modern
Unices.)
Index: unixccompiler.py
===================================================================
RCS file: /projects/cvsroot/distutils/distutils/unixccompiler.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** unixccompiler.py 2000年03月26日 21:40:19 1.20
--- unixccompiler.py 2000年04月14日 00:48:15 1.21
***************
*** 16,26 ****
# created 1999年07月05日, Greg Ward
! __revision__ = "$Id: unixccompiler.py,v 1.20 2000年03月26日 21:40:19 gward Exp $"
import string, re, os
from types import *
from copy import copy
! from distutils.sysconfig import \
! CC, CCSHARED, CFLAGS, OPT, LDSHARED, LDFLAGS, RANLIB, AR, SO
from distutils.ccompiler import CCompiler, gen_preprocess_options, gen_lib_options
--- 16,25 ----
# created 1999年07月05日, Greg Ward
! __revision__ = "$Id: unixccompiler.py,v 1.21 2000年04月14日 00:48:15 gward Exp $"
import string, re, os
from types import *
from copy import copy
! from distutils import sysconfig
from distutils.ccompiler import CCompiler, gen_preprocess_options, gen_lib_options
***************
*** 60,64 ****
obj_extension = ".o"
static_lib_extension = ".a"
! shared_lib_extension = ".so"
static_lib_format = shared_lib_format = "lib%s%s"
--- 59,63 ----
obj_extension = ".o"
static_lib_extension = ".a"
! shared_lib_extension = sysconfig.SO
static_lib_format = shared_lib_format = "lib%s%s"
***************
*** 66,71 ****
# across the major Unices. Might have to move down into the
# constructor if we need platform-specific guesswork.
! archiver = "ar"
archiver_options = "-cr"
--- 65,71 ----
# across the major Unices. Might have to move down into the
# constructor if we need platform-specific guesswork.
! archiver = sysconfig.AR
archiver_options = "-cr"
+ ranlib = sysconfig.RANLIB
***************
*** 91,99 ****
(self.cc, self.ccflags) = \
! _split_command (CC + ' ' + OPT)
! self.ccflags_shared = string.split (CCSHARED)
(self.ld_shared, self.ldflags_shared) = \
! _split_command (LDSHARED)
self.ld_exec = self.cc
--- 91,99 ----
(self.cc, self.ccflags) = \
! _split_command (sysconfig.CC + ' ' + sysconfig.OPT)
! self.ccflags_shared = string.split (sysconfig.CCSHARED)
(self.ld_shared, self.ldflags_shared) = \
! _split_command (sysconfig.LDSHARED)
self.ld_exec = self.cc
***************
*** 158,161 ****
--- 158,167 ----
output_filename] +
objects + self.objects)
+
+ # Not many Unices required ranlib anymore -- SunOS 4.x is,
+ # I think the only major Unix that does. Probably should
+ # have some platform intelligence here to skip ranlib if
+ # it's not needed.
+ self.spawn ([self.ranlib, output_filename])
else:
self.announce ("skipping %s (up-to-date)" % output_filename)