[ccache] permit ccache to build with clang
joel at rosdahl.net
Sat Sep 22 09:43:02 MDT 2012
On 18 September 2012 18:21, Eitan Adler <lists at eitanadler.com> wrote:
> I needed the following patch for ccache to build with clang.
> -all_cppflags = @DEFS@ @extra_cppflags@ -DSYSCONFDIR=$(sysconfdir) -I.
> -I$(srcdir) $(CPPFLAGS)
(Your patch doesn't apply since it's garbled. The above two lines
should be one.)
> +all_cppflags = @DEFS@ @extra_cppflags@ -DSYSCONFDIR=$(sysconfdir) $(CPPFLAGS)
This breaks out-of-source builds:
% mkdir build
% cd build
% ../configure CC=clang
% make test
clang -DHAVE_CONFIG_H -DSYSCONFDIR=/usr/local/etc -MD -MP -MF
.deps/test_main.c.d -g -O2 -Wall -W -Werror -c -o test/main.o
../test/main.c:20:10: fatal error: 'test/framework.h' file not found
1 error generated.
make: *** [test/main.o] Error 1
So, I can't apply it. I think it's quite silly of clang to warn about
unused -I options; it would be a hassle to add -I options potentially
tailored for each source code file.
More information about the ccache