[ccache] permit ccache to build with clang

Eitan Adler lists at eitanadler.com
Tue Sep 18 10:21:07 MDT 2012


Hi,

I needed the following patch for ccache to build with clang. Without
this I get the following error:

[7905 eitan at radar ~/svn/ccache ]%gmake
 (git)-[master]-
clang -DHAVE_CONFIG_H  -DSYSCONFDIR=/usr/local/etc -I. -I.  -MD -MP
-MF .deps/main.c.d -g -O2 -Wall -W -Werror -c -o main.o main.c
clang: error: argument unused during compilation: '-I .'
clang: error: argument unused during compilation: '-I .'
gmake: *** [main.o] Error 1


commit 106e2aa8c74007c3bbca186464bc602081db094d
Author: Eitan Adler <lists at eitanadler.com>
Date:   Tue Sep 18 12:19:10 2012 -0400

    Permit ccache to build with clang

diff --git a/Makefile.in b/Makefile.in
index b561a3e..125ec89 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -19,7 +19,7 @@ LIBS = @LIBS@
 RANLIB = @RANLIB@

 all_cflags = $(CFLAGS)
-all_cppflags = @DEFS@ @extra_cppflags@ -DSYSCONFDIR=$(sysconfdir) -I.
-I$(srcdir) $(CPPFLAGS)
+all_cppflags = @DEFS@ @extra_cppflags@ -DSYSCONFDIR=$(sysconfdir) $(CPPFLAGS)
 all_ldflags = @extra_ldflags@ $(LDFLAGS)
 all_libs = @extra_libs@ $(LIBS)

diff --git a/snprintf.c b/snprintf.c
index e1b86f2..6f6a233 100644
--- a/snprintf.c
+++ b/snprintf.c
@@ -142,7 +142,7 @@
  *    included throughout the project files:
  *
  *    	#if HAVE_CONFIG_H
- *    	#include <config.h>
+ *    	#include "config.h"
  *    	#endif
  *    	#if HAVE_STDARG_H
  *    	#include <stdarg.h>
@@ -165,7 +165,7 @@
  */

 #if HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
 #endif	/* HAVE_CONFIG_H */

 #if TEST_SNPRINTF

-- 
Eitan Adler


More information about the ccache mailing list