summaryrefslogtreecommitdiff
path: root/top/maint.mk
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-01-09 11:41:00 +0100
committerJim Meyering <meyering@redhat.com>2010-01-09 11:41:00 +0100
commitbc3991768078b437cbbbe93bc1cd2eab0ca98000 (patch)
treea63fd3ba4ef5e2dc0c952dd5988cfb117f6399b8 /top/maint.mk
parent581419c98c50af5daefcbb07ca1cbc16539db072 (diff)
downloadgnulib-bc3991768078b437cbbbe93bc1cd2eab0ca98000.tar.gz
maint.mk: extend proper_name_utf8-vs-LIBICONV-checking rule
* top/maint.mk (sc_proper_name_utf8_requires_ICONV): Adapt to work also when $(LIBICONV) is part of LDADD, rather than ${prog}_LDADD.
Diffstat (limited to 'top/maint.mk')
-rw-r--r--top/maint.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/top/maint.mk b/top/maint.mk
index 3cd1a93bf0..3651543267 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -524,14 +524,20 @@ sc_prohibit_S_IS_definition:
msg='do not define S_IS* macros; include <sys/stat.h>' \
$(_prohibit_regexp)
-# Each program that uses proper_name_utf8 must link with
-# one of the ICONV libraries.
+# Each program that uses proper_name_utf8 must link with one of the
+# ICONV libraries. Otherwise, some ICONV library must appear in LDADD.
+# The perl -0777 invocation below extracts the possibly-multi-line
+# definition of LDADD from the appropriate Makefile.am and exits 0
+# when it contains "ICONV".
sc_proper_name_utf8_requires_ICONV:
@progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
if test "x$$progs" != x; then \
fail=0; \
for p in $$progs; do \
dir=$$(dirname "$$p"); \
+ perl -0777 \
+ -ne 'exit !(/^LDADD =(.+?[^\\]\n)/ms && $$1 =~ /ICONV/)' \
+ $$dir/Makefile.am && continue; \
base=$$(basename "$$p" .c); \
grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
|| { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \