From 5daaf7cd967da08a031cb40e3b668a173b4673a1 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Wed, 26 Feb 2003 18:52:07 +0000 Subject: [PATCH] [Bug #668662] Patch from Pearu Pearson: if a C source file is specified with an absolute path, the object file is also written to an absolute path. The patch drops the drive and leading '/' from the source path, so a path like /path/to/foo.c results in an object file like build/temp.i686linux/path/to/foo.o. --- ccompiler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ccompiler.py b/ccompiler.py index bfcf1279..46fb743d 100644 --- a/ccompiler.py +++ b/ccompiler.py @@ -932,6 +932,8 @@ def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): obj_names = [] for src_name in source_filenames: base, ext = os.path.splitext(src_name) + base = os.path.splitdrive(base)[1] # Chop off the drive + base = base[os.path.isabs(base):] # If abs, chop off leading / if ext not in self.src_extensions: raise UnknownFileError, \ "unknown file type '%s' (from '%s')" % (ext, src_name)