summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2018-10-13 14:02:47 +0200
committerJoel Rosdahl <joel@rosdahl.net>2018-10-13 14:02:47 +0200
commit59145179a793820f25c55b286d70d1d278f275d5 (patch)
treee1f9b4630c25fac7499ca6f2b9ecc3bae73018d4
parent86feae3fa74924e13a5b9218d958ea79cb36f496 (diff)
downloadccache-59145179a793820f25c55b286d70d1d278f275d5.tar.gz
Pass -Wno-implicit-fallthrough when compiling bundled zlib
It’s of no use to get warnings for 3pp code.
-rw-r--r--Makefile.in1
-rw-r--r--configure.ac10
-rw-r--r--dev.mk.in2
3 files changed, 7 insertions, 6 deletions
diff --git a/Makefile.in b/Makefile.in
index 308fd562..dcec0af0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -114,6 +114,7 @@ clean:
conf.c: confitems_lookup.c envtoconfitems_lookup.c
$(zlib_objs): CPPFLAGS += -include config.h
+$(zlib_objs): CFLAGS += @no_implicit_fallthrough_warning@
src/zlib/libz.a: $(zlib_objs)
$(AR) cr $@ $(zlib_objs)
diff --git a/configure.ac b/configure.ac
index 5481e113..8dfba4bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@ case $host in
esac
AC_SUBST(extra_libs)
-AC_SUBST(extra_cflags)
+AC_SUBST(no_implicit_fallthrough_warning)
AC_SUBST(getopt_long_c)
AC_SUBST(include_dev_mk)
AC_SUBST(test_suites)
@@ -200,13 +200,13 @@ if test ! -f $srcdir/dev_mode_disabled && test "$RUN_FROM_BUILD_FARM" != yes; th
version=`(git --git-dir=$srcdir/.git describe --dirty 2>/dev/null || echo vunknown) | sed -e 's/v//' -e 's/-/+/' -e 's/-/_/g'`
echo "extern const char CCACHE_VERSION@<:@@:>@; const char CCACHE_VERSION@<:@@:>@ = \"$version\";" >src/version.c
- dnl Check for -Wimplicit-fallthrough and disable if exists
- AC_MSG_CHECKING([whether C compiler supports -Wimplicit-fallthrough])
+ dnl Check for -Wno-implicit-fallthrough
+ AC_MSG_CHECKING([whether C compiler supports -Wno-implicit-fallthrough])
saved_cflags=$CFLAGS
- CFLAGS=-Wimplicit-fallthrough
+ CFLAGS=-Wno-implicit-fallthrough
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
- [extra_cflags="-Wno-error=implicit-fallthrough"],
+ [no_implicit_fallthrough_warning="-Wno-implicit-fallthrough"],
[AC_MSG_RESULT([no])]
)
CFLAGS=$saved_cflags
diff --git a/dev.mk.in b/dev.mk.in
index 9bd341ec..4ca34a46 100644
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -1,6 +1,6 @@
# GNU make syntax reigns in this file.
-all_cflags += -Werror @extra_cflags@
+all_cflags += -Werror
all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$<)).d
A2X = a2x