summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2010-01-11 23:23:44 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2010-01-11 23:23:44 (GMT)
commit343e2ff51b8640238dbf3109494a64e6b50f1901 (patch)
treedb34e2b23409ccb8eea3dab2c08fbe6d9603fb8a /Lib/distutils
parent27e48ef369aa370382d4ead0729b467ee4742c6d (diff)
downloadcpython-343e2ff51b8640238dbf3109494a64e6b50f1901.zip
cpython-343e2ff51b8640238dbf3109494a64e6b50f1901.tar.gz
cpython-343e2ff51b8640238dbf3109494a64e6b50f1901.tar.bz2
Merged revisions 77427 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77427 | tarek.ziade | 2010-01-12 00:15:52 +0100 (Tue, 12 Jan 2010) | 9 lines Merged revisions 77424 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77424 | tarek.ziade | 2010-01-11 23:50:29 +0100 (Mon, 11 Jan 2010) | 1 line Fixed #5372: .o files are now always rebuilt because file age test don't work in some case ........ ................
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/ccompiler.py82
1 files changed, 5 insertions, 77 deletions
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index 875f96f..34c77a3 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -311,10 +311,7 @@ class CCompiler:
def _setup_compile(self, outdir, macros, incdirs, sources, depends,
extra):
- """Process arguments and decide which source files to compile.
-
- Merges _fix_compile_args() and _prep_compile().
- """
+ """Process arguments and decide which source files to compile."""
if outdir is None:
outdir = self.output_dir
elif not isinstance(outdir, str):
@@ -343,41 +340,6 @@ class CCompiler:
output_dir=outdir)
assert len(objects) == len(sources)
- # XXX should redo this code to eliminate skip_source entirely.
- # XXX instead create build and issue skip messages inline
-
- if self.force:
- skip_source = {} # rebuild everything
- for source in sources:
- skip_source[source] = 0
- elif depends is None:
- # If depends is None, figure out which source files we
- # have to recompile according to a simplistic check. We
- # just compare the source and object file, no deep
- # dependency checking involving header files.
- skip_source = {} # rebuild everything
- for source in sources: # no wait, rebuild nothing
- skip_source[source] = 1
-
- n_sources, n_objects = newer_pairwise(sources, objects)
- for source in n_sources: # no really, only rebuild what's
- skip_source[source] = 0 # out-of-date
- else:
- # If depends is a list of files, then do a different
- # simplistic check. Assume that each object depends on
- # its source and all files in the depends list.
- skip_source = {}
- # L contains all the depends plus a spot at the end for a
- # particular source file
- L = depends[:] + [None]
- for i in range(len(objects)):
- source = sources[i]
- L[-1] = source
- if newer_group(L, objects[i]):
- skip_source[source] = 0
- else:
- skip_source[source] = 1
-
pp_opts = gen_preprocess_options(macros, incdirs)
build = {}
@@ -386,10 +348,7 @@ class CCompiler:
obj = objects[i]
ext = os.path.splitext(src)[1]
self.mkpath(os.path.dirname(obj))
- if skip_source[src]:
- log.debug("skipping %s (%s up-to-date)", src, obj)
- else:
- build[obj] = src, ext
+ build[obj] = (src, ext)
return macros, objects, extra, pp_opts, build
@@ -446,40 +405,9 @@ class CCompiler:
objects = self.object_filenames(sources, output_dir=output_dir)
assert len(objects) == len(sources)
- if self.force:
- skip_source = {} # rebuild everything
- for source in sources:
- skip_source[source] = 0
- elif depends is None:
- # If depends is None, figure out which source files we
- # have to recompile according to a simplistic check. We
- # just compare the source and object file, no deep
- # dependency checking involving header files.
- skip_source = {} # rebuild everything
- for source in sources: # no wait, rebuild nothing
- skip_source[source] = 1
-
- n_sources, n_objects = newer_pairwise(sources, objects)
- for source in n_sources: # no really, only rebuild what's
- skip_source[source] = 0 # out-of-date
- else:
- # If depends is a list of files, then do a different
- # simplistic check. Assume that each object depends on
- # its source and all files in the depends list.
- skip_source = {}
- # L contains all the depends plus a spot at the end for a
- # particular source file
- L = depends[:] + [None]
- for i in range(len(objects)):
- source = sources[i]
- L[-1] = source
- if newer_group(L, objects[i]):
- skip_source[source] = 0
- else:
- skip_source[source] = 1
-
- return objects, skip_source
-
+ # Return an empty dict for the "which source files can be skipped"
+ # return value to preserve API compatibility.
+ return objects, {}
def _fix_object_args(self, objects, output_dir):
"""Typecheck and fix up some arguments supplied to various methods.