mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-24 02:17:22 +08:00
* Makefile.maint (headers_with_interesting_macro_defs): Define.
(.re-defmac, sc_always_defined_macros): New rules.
This commit is contained in:
parent
e0b2cb892a
commit
443d509578
@ -1,5 +1,8 @@
|
||||
2006-10-14 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* Makefile.maint (headers_with_interesting_macro_defs): Define.
|
||||
(.re-defmac, sc_always_defined_macros): New rules.
|
||||
|
||||
* src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions.
|
||||
Instead, include "exit.h". This hereby retires the work-around for
|
||||
"Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0".
|
||||
|
@ -219,6 +219,40 @@ sc_root_tests:
|
||||
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
headers_with_interesting_macro_defs = \
|
||||
exit.h \
|
||||
fcntl_.h \
|
||||
fnmatch_.h \
|
||||
intprops.h \
|
||||
inttypes_.h \
|
||||
lchown.h \
|
||||
openat.h \
|
||||
stat-macros.h \
|
||||
stdint_.h
|
||||
|
||||
# Create a list of regular expressions matching the names
|
||||
# of macros that are guaranteed by parts of gnulib to be defined.
|
||||
.re-defmac:
|
||||
@(cd $(srcdir)/lib; \
|
||||
for f in $(headers_with_interesting_macro_defs); do \
|
||||
test -f $$f && \
|
||||
sed -n '/^# *define \([^_ (][^ (]*\)[ (].*/s//\1/p' $$f; \
|
||||
done; \
|
||||
) | sort -u \
|
||||
| grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX' \
|
||||
| sed 's/^/^# *define /' \
|
||||
> $@-t
|
||||
@mv $@-t $@
|
||||
|
||||
# Don't define macros that we already get from gnulib header files.
|
||||
sc_always_defined_macros: .re-defmac
|
||||
@if test -f $(srcdir)/src/system.h; then \
|
||||
trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15; \
|
||||
grep -f .re-defmac $$($(CVS_LIST)) \
|
||||
&& { 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.
|
||||
.re-list:
|
||||
|
Loading…
Reference in New Issue
Block a user