diff options
author | Jim Meyering <meyering@redhat.com> | 2008-08-13 22:30:14 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-08-26 18:45:06 +0200 |
commit | 0c1fc1c715aa18605eb11c6c25867277824e8f8d (patch) | |
tree | ff9bcd27a498b8892e98015a7cd69fb299ed66ab /src/Makefile.am | |
parent | f03a67735a3143ff684fc0ddf4d4c4477019f079 (diff) | |
download | coreutils-0c1fc1c715aa18605eb11c6c25867277824e8f8d.tar.xz |
use new global, "Version", rather than macro, VERSION
With this change, a version-string update no longer
forces recompilation of 100+ src/*.o files.
* src/version.c (Version): New global. New file.
* src/version.h: Declare it.
* src/Makefile.am: Put it in a library that everyone links to.
(noinst_LIBRARIES, libver_a_SOURCES): Define.
(LDADD): Add libver.a.
(sc_tight_scope): Use perl (was sed), and a more relaxed regexp
to build the global-variable-name-recognizing regexp list.
* src/system.h: Include "version.h".
(case_GETOPT_VERSION_CHAR): Use Version rather than VERSION.
* src/basename.c (main): Use Version rather than VERSION.
* src/chroot.c (main): Likewise.
* src/cksum.c (main): Likewise.
* src/dd.c (main): Likewise.
* src/dirname.c (main): Likewise.
* src/echo.c (main): Likewise.
* src/hostid.c (main): Likewise.
* src/hostname.c (main): Likewise.
* src/link.c (main): Likewise.
* src/logname.c (main): Likewise.
* src/nice.c (main): Likewise.
* src/nohup.c (main): Likewise.
* src/printenv.c (main): Likewise.
* src/printf.c (main): Likewise.
* src/pwd.c (main): Likewise.
* src/setuidgid.c (main): Likewise.
* src/sleep.c (main): Likewise.
* src/sync.c (main): Likewise.
* src/test.c (main): Likewise.
* src/timeout.c (main): Likewise.
* src/true.c (main): Likewise.
* src/tsort.c (main): Likewise.
* src/unlink.c (main): Likewise.
* src/uptime.c (main): Likewise.
* src/users.c (main): Likewise.
* src/whoami.c (main): Likewise.
* src/yes.c (main): Likewise.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r-- | src/Makefile.am | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 359d18ec6..1d5900387 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,12 +69,15 @@ CLEANFILES = $(SCRIPTS) su AM_CPPFLAGS = -I$(top_srcdir)/lib +noinst_LIBRARIES = libver.a +libver_a_SOURCES = version.c version.h + # Sometimes, the expansion of $(LIBINTL) includes -lc which may # include modules defining variables like `optind', so libcoreutils.a # must precede $(LIBINTL) in order to ensure we use GNU getopt. # But libcoreutils.a must also follow $(LIBINTL), since libintl uses # replacement functions defined in libcoreutils.a. -LDADD = ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a +LDADD = libver.a ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a cat_LDADD = $(LDADD) df_LDADD = $(LDADD) @@ -435,8 +438,8 @@ sc_tight_scope: $(all_programs) { echo 'the above functions should have static scope' 1>&2; \ exit 1; } || : ; \ ( printf '^program_name$$\n'; \ - sed -n 's/^extern int \([^ ][^ ]*\);$$/^\1$$/p' \ - $(noinst_HEADERS) ) > $$t; \ + perl -ne '/^extern .*?\**(\w+);/ and print "^$$1\$$\n"' \ + *.h ) > $$t; \ nm -e *.$(OBJEXT) \ | sed -n 's/.* [BD] //p' \ | grep -Ev -f $$t && \ |