diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-03-11 13:33:43 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-03-11 13:33:43 -0500 |
commit | 7f495b9848265b93e4365f1bcc8bc1a318cdb4ce (patch) | |
tree | 735dcaf1bf705fcacf34cecdc51553557c1e22c2 /Makefile.am | |
parent | 5d331c192fe754377a5cc779de669bd020cbdd4c (diff) | |
download | systemd-7f495b9848265b93e4365f1bcc8bc1a318cdb4ce.tar.gz |
build-sys: add check that our headers are ANSI compatible
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 9cee98ec5a..0f1f79e62d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6161,7 +6161,6 @@ DISTCHECK_CONFIGURE_FLAGS += \ endif .PHONY: dist-check-help - dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS) for i in $(abspath $^); do \ if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \ @@ -6170,6 +6169,18 @@ dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS) exit 1; \ fi; done +include_compilers = "$(CC)" "$(CC) -ansi" "$(CC) -std=iso9899:1990" +public_headers = $(filter-out src/systemd/_sd-common.h, $(pkginclude_HEADERS) $(include_HEADERS)) +.PHONY: dist-check-includes +dist-check-includes: $(public_headers) + @res=0; \ + for i in $(abspath $^); do \ + for cc in $(include_compilers); do \ + echo "$$cc -o/dev/null -c -x c -include "$$i" - </dev/null"; \ + $$cc -o/dev/null -c -x c -include "$$i" - </dev/null || res=1; \ + done; \ + done; exit $$res + .PHONY: hwdb-update hwdb-update: ( cd $(top_srcdir)/hwdb && \ |