summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>2008-09-12 21:23:43 +0200
committerJim Meyering <meyering@redhat.com>2008-09-14 17:42:48 +0200
commite10e4b669715aa2ca8059987c9ae08b2a1ad7a14 (patch)
tree9d3c779eff3730ff5c32417c064d7dbcffaefe85 /src
parentcddcb5d468e5aae408cea018002e2fdfd3b983a8 (diff)
downloadcoreutils-e10e4b669715aa2ca8059987c9ae08b2a1ad7a14.tar.xz
various VPATH-related fixes
* maint.mk (VC_LIST): Prepend '$(srcdir)/'. (patch-check): Fix to make it work with a VPATH build. * src/Makefile.am (sc_tight_scope): Likewise. * man/Makefile.am (.x.1): Do not make outputs unwritable.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index dee26a4b1..80313ae4b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -442,11 +442,14 @@ s2 = '/^\#define AUTHORS \\\\/{;n;$(sed_filter);p;q;}'
sc_tight_scope: $(all_programs)
@t=exceptions-$$$$; \
trap "s=$$?; rm -f $$t; exit $$s" 0 1 2 13 15; \
+ src=`for f in $(SOURCES); do \
+ test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
+ hdr=`for f in $(noinst_HEADERS); do \
+ test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
( printf 'main\nusage\n'; \
- grep -h -A1 '^extern .*[^;]$$' $(SOURCES) \
+ grep -h -A1 '^extern .*[^;]$$' $$src \
| grep -vE '^(extern |--)' | sed 's/ .*//'; \
- perl -ne '/^extern \S+ (\S*) \(/ and print "$$1\n"' \
- $(noinst_HEADERS); \
+ perl -ne '/^extern \S+ (\S*) \(/ and print "$$1\n"' $$hdr; \
) | $(ASSORT) -u | sed 's/^/^/;s/$$/$$/' > $$t; \
nm -e *.$(OBJEXT) \
| sed -n 's/.* T //p' \
@@ -455,7 +458,7 @@ sc_tight_scope: $(all_programs)
exit 1; } || : ; \
( printf '^program_name$$\n'; \
perl -ne '/^extern .*?\**(\w+);/ and print "^$$1\$$\n"' \
- *.h ) > $$t; \
+ $$hdr *.h ) | $(ASSORT) -u > $$t; \
nm -e *.$(OBJEXT) \
| sed -n 's/.* [BD] //p' \
| grep -Ev -f $$t && \