From aecfe7caadc7d7ed622e703b44f454bec98dd2c1 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 20 Oct 2018 13:19:57 +0200 Subject: Improve distcheck - Build with more warnings. - Added an extra build with clang. - Build with -Werror to actually catch the errors. --- Makefile.in | 1 + dev.mk.in | 26 ++++++++++---------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Makefile.in b/Makefile.in index 175e4404..2f41cb75 100644 --- a/Makefile.in +++ b/Makefile.in @@ -122,6 +122,7 @@ clean: conf.c: confitems_lookup.c envtoconfitems_lookup.c +src/snprintf.o: CFLAGS += @no_implicit_fallthrough_warning@ $(zlib_objs): CPPFLAGS += -include config.h $(zlib_objs): CFLAGS += @no_implicit_fallthrough_warning@ diff --git a/dev.mk.in b/dev.mk.in index fde4e770..0a311fe5 100644 --- a/dev.mk.in +++ b/dev.mk.in @@ -136,8 +136,8 @@ $(dist_archives): $(dist_files) tar -c $$tarcompression -f $(CURDIR)/$@ $(dist_dir)) && \ rm -rf $$tmpdir -.PHONY: distcheck -distcheck: $(firstword $(dist_archives)) +# $(1): extra configure options +define do_distcheck tmpdir=$$(mktemp -d /tmp/tmp-ccache-distcheck.XXXXXX) && \ (cd $$tmpdir && \ tar xf $(CURDIR)/$< && \ @@ -145,24 +145,18 @@ distcheck: $(firstword $(dist_archives)) chmod -R a-w $(dist_dir) && \ chmod u+w $(dist_dir)/build && \ cd $(dist_dir)/build && \ - ../configure --prefix=$$tmpdir/root && \ - $(MAKE) install && \ + ../configure --enable-more-warnings --prefix=$$tmpdir/root $(1) && \ + $(MAKE) install CFLAGS=-Werror V=1 && \ $(MAKE) installcheck) && \ chmod -R u+w $$tmpdir/$(dist_dir) && \ rm -rf $$tmpdir +endef - tmpdir=$$(mktemp -d /tmp/tmp-ccache-distcheck.XXXXXX) && \ - (cd $$tmpdir && \ - tar xf $(CURDIR)/$< && \ - mkdir -p $(dist_dir)/build && \ - chmod -R a-w $(dist_dir) && \ - chmod u+w $(dist_dir)/build && \ - cd $(dist_dir)/build && \ - ../configure --prefix=$$tmpdir/root --with-bundled-zlib && \ - $(MAKE) install && \ - $(MAKE) installcheck) && \ - chmod -R u+w $$tmpdir/$(dist_dir) && \ - rm -rf $$tmpdir +.PHONY: distcheck +distcheck: $(firstword $(dist_archives)) + $(call do_distcheck, --without-bundled-zlib) + $(call do_distcheck, --with-bundled-zlib) + $(call do_distcheck, CC=clang) .PHONY: docs docs: $(generated_docs) -- cgit v1.2.1