summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-05-09 12:08:21 +0200
committerJim Meyering <meyering@redhat.com>2010-05-09 12:08:21 +0200
commitcab21195422804046a7f2b18de2282a46a2e8f39 (patch)
treebd62f7ec1d9066556e52116566d28e8db8346bf5 /cfg.mk
parent9e42ecceff823a9f966b798bda5b33463d199277 (diff)
downloadcoreutils-cab21195422804046a7f2b18de2282a46a2e8f39.tar.xz
tests: improve the always_defined_macros check
* cfg.mk (sc_always_defined_macros): Adjust its helpers not to depend on the existence of ./lib. Instead, extract symbols directly from gnulib/lib/*.in.h files.
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk30
1 files changed, 14 insertions, 16 deletions
diff --git a/cfg.mk b/cfg.mk
index 9eb1c9e85..6153f5308 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -106,32 +106,29 @@ sc_x_sc_dist_check:
) | sort | uniq -u)" \
&& { echo 'Makefile.am: $(sce) mismatch' >&2; exit 1; } || :;
-gl_generated_headers_ = \
- $$(cd $(gnulib_dir)/lib && echo *.in.h|sed 's,sys_,sys/,g;s/\.in\.h/.h/g')
-
-headers_with_interesting_macro_defs = \
- exit.h \
+# ==================================================================
+gl_other_headers_ ?= \
intprops.h \
- lchown.h \
openat.h \
stat-macros.h
+# Perl -lne code to extract "significant" cpp-defined symbols from a
+# gnulib header file, eliminating a few common false-positives.
gl_extract_significant_defines_ = \
- /^\# *define ([^_ (][^ (]*)\s*(\(|\w+)/ && $$2 !~ /(?:rpl_|_used_without_)/ \
+ /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/ && $$2 !~ /(?:rpl_|_used_without_)/\
and print $$1
# Create a list of regular expressions matching the names
-# of macros that are guaranteed by parts of gnulib to be defined.
+# of macros that are guaranteed to be defined by parts of gnulib.
.re-defmac:
@gen_h=$(gl_generated_headers_); \
- (cd $(srcdir)/lib; \
- for f in $(headers_with_interesting_macro_defs) $$gen_h; do \
- test -f $$f && \
- perl -lne '$(gl_extract_significant_defines_)' $$f; \
- done; \
- ) | sort -u \
- | grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX' \
- | sed 's/^/^# *define /' \
+ (cd $(gnulib_dir)/lib; \
+ for f in *.in.h $(gl_other_headers_); do \
+ perl -lne '$(gl_extract_significant_defines_)' $$f; \
+ done; \
+ ) | sort -u \
+ | grep -Ev '^ATTRIBUTE_NORETURN' \
+ | sed 's/^/^# *define /' \
> $@-t
@mv $@-t $@
@@ -151,6 +148,7 @@ sc_always_defined_macros: .re-defmac
&& { echo '$(ME): define the above via some gnulib .h file' \
1>&2; exit 1; } || :; \
fi
+# ==================================================================
# Create a list of regular expressions matching the names
# of files included from system.h. Exclude a couple.