ccc patch

Hi, all.

It seems that the r46501 commit broke ccc for a few people, because it
bumped the minimum Python version up from 2.4 to 2.5. With the attached
patch, I have been able to get ccc working with version 2.3.4. (This is on
a RHEL4 system.)

Thanks,
Sam Bishop

make-ccc-work-with-python2.3.patch (1.23 KB)

- components = path.rpartition(".")
+ components = path.split(".")[-1]

This is not correct. rpartition returns 3-tuple, for example ('test',
'.', 'c') for 'test.c'.

Applied, after fixing the above problem.

Sanghyeon Seo wrote:

- components = path.rpartition(".")
+ components = path.split(".")[-1]

This is not correct. rpartition returns 3-tuple, for example ('test',
'.', 'c') for 'test.c'.

Applied, after fixing the above problem.

ccc now creates object files without an extension, and this breaks
./configure checks with ccc:
$ /home/edwin/llvm-svn/llvm/tools/clang/utils/ccc -c conftest.c
clang -emit-llvm-bc -x c -o conftesto conftest.c

Output of configuring ClamAV with
CC=/home/edwin/llvm-svn/llvm/tools/clang/utils/ccc:
.....
checking limits.h usability... no
checking limits.h presence... yes
configure: WARNING: limits.h: present but cannot be compiled
configure: WARNING: limits.h: check for missing prerequisite headers?
configure: WARNING: limits.h: see the Autoconf documentation
configure: WARNING: limits.h: section "Present But Cannot Be Compiled"
configure: WARNING: limits.h: proceeding with the preprocessor's result
configure: WARNING: limits.h: in the future, the compiler will take
precedence
.....

This patch fixes the problem:
Index: utils/ccc

Török Edwin wrote:

ccc now creates object files without an extension, and this breaks
  
Also, ccc creates output objects in same directory as the source file,
and not in the current directory.
This doesn't work with VPATH builds in autotooled builds.

A better patch to address both this, the missing extension problem, and
the wrong return code problem:
$ svn diff utils/ccc
Index: utils/ccc