summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-04-14 00:48:15 (GMT)
committerGreg Ward <gward@python.net>2000-04-14 00:48:15 (GMT)
commit1c79330e64e0f3f73bbfe9f0504425520ec44dff (patch)
tree97120c77402b9edf8baca0bc0acde5384d1924b6 /Lib/distutils
parentb6f5adaa12ce47ba514a14de74c5f2bf4c3479e6 (diff)
downloadcpython-1c79330e64e0f3f73bbfe9f0504425520ec44dff.zip
cpython-1c79330e64e0f3f73bbfe9f0504425520ec44dff.tar.gz
cpython-1c79330e64e0f3f73bbfe9f0504425520ec44dff.tar.bz2
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.)
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/unixccompiler.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index ec766f5..0944461 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -20,8 +20,7 @@ __revision__ = "$Id$"
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 import sysconfig
from distutils.ccompiler import CCompiler, gen_preprocess_options, gen_lib_options
# XXX Things not currently handled:
@@ -59,14 +58,15 @@ class UnixCCompiler (CCompiler):
src_extensions = [".c",".C",".cc",".cxx",".cpp"]
obj_extension = ".o"
static_lib_extension = ".a"
- shared_lib_extension = ".so"
+ shared_lib_extension = sysconfig.SO
static_lib_format = shared_lib_format = "lib%s%s"
# Command to create a static library: seems to be pretty consistent
# across the major Unices. Might have to move down into the
# constructor if we need platform-specific guesswork.
- archiver = "ar"
+ archiver = sysconfig.AR
archiver_options = "-cr"
+ ranlib = sysconfig.RANLIB
def __init__ (self,
@@ -90,11 +90,11 @@ class UnixCCompiler (CCompiler):
# UnixCCompiler!
(self.cc, self.ccflags) = \
- _split_command (CC + ' ' + OPT)
- self.ccflags_shared = string.split (CCSHARED)
+ _split_command (sysconfig.CC + ' ' + sysconfig.OPT)
+ self.ccflags_shared = string.split (sysconfig.CCSHARED)
(self.ld_shared, self.ldflags_shared) = \
- _split_command (LDSHARED)
+ _split_command (sysconfig.LDSHARED)
self.ld_exec = self.cc
@@ -157,6 +157,12 @@ class UnixCCompiler (CCompiler):
self.archiver_options,
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)