bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/348] move AC_LIBOBJ invocations to the module descriptions


From: Jim Meyering
Subject: Re: [PATCH 0/348] move AC_LIBOBJ invocations to the module descriptions
Date: Mon, 13 Jun 2011 18:10:15 +0200

Bruno Haible wrote:
> Jim Meyering wrote:
>> This looks like a fine improvement.
>> I reviewed only the first dozen or so.
>
> Thanks for the review. Most of the patches follow the same idiom.
>
>> This new policy looks particularly easy to violate accidentally.
>> What do you think about adding a syntax-check rule to help avoid that?
>
> Yes, this would be good. I don't know how to write such a syntax-check
> rule (it uses perl, right?). But I can tell you the file list to which it
> should be applied. Namely, all m4/*.m4 files, except
>
>   close.m4
>   dprintf.m4
>   dup2.m4
>   faccessat.m4
>   fchdir.m4
>   fclose.m4
>   fcntl.m4
>   fprintf-posix.m4
>   open.m4
>   printf-posix.m4
>   snprintf.m4
>   sprintf-posix.m4
>   stdio_h.m4
>   vasnprintf.m4
>   vasprintf.m4
>   vdprintf.m4
>   vfprintf-posix.m4
>   vprintf-posix.m4
>   vsnprintf.m4
>   vsprintf-posix.m4

Thanks for the list.
Once you've applied your 300+ changes,
I'll make sure that this rule passes:

>From 4246fedf03280c5876fe90ffba8f9722218be61d Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 13 Jun 2011 18:01:47 +0200
Subject: [PATCH] syntax-check: add a rule to help enforce the
 no-AC_LIBOBJ-in-m4/ policy

* Makefile (sc_prohibit_AC_LIBOBJ_in_m4): New rule.
---
 ChangeLog |    5 +++++
 Makefile  |   38 +++++++++++++++++++++++++++++++++-----
 2 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 19a3dff..ff58b67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-13  Jim Meyering  <address@hidden>
+
+       syntax-check: add a rule to help enforce the no-AC_LIBOBJ-in-m4/ policy
+       * Makefile (sc_prohibit_AC_LIBOBJ_in_m4): New rule.
+
 2011-06-13  Bruno Haible  <address@hidden>

        gnulib-tool: Addendum to 2011-06-08 commit.
diff --git a/Makefile b/Makefile
index c9bfc16..5191230 100644
--- a/Makefile
+++ b/Makefile
@@ -29,12 +29,40 @@ sc_prefer_ac_check_funcs_once:
                   in modules/ 1>&2; exit 1; } || :                     \
        else :; fi

-sc_prohibit_augmenting_PATH_via_TESTS_ENVIRONMENT:
+# Files in m4/ that (exceptionally) may use AC_LIBOBJ.
+# Do not include their ".m4" suffix.
+allow_AC_LIBOBJ =      \
+  close                        \
+  dprintf              \
+  dup2                 \
+  faccessat            \
+  fchdir               \
+  fclose               \
+  fcntl                        \
+  fprintf-posix                \
+  open                 \
+  printf-posix         \
+  snprintf             \
+  sprintf-posix                \
+  stdio_h              \
+  vasnprintf           \
+  vasprintf            \
+  vdprintf             \
+  vfprintf-posix       \
+  vprintf-posix                \
+  vsnprintf            \
+  vsprintf-posix
+
+allow_AC_LIBOBJ_or := $(shell echo $(allow_AC_LIBOBJ) | tr -s ' ' '|')
+
+sc_prohibit_AC_LIBOBJ_in_m4:
+       url=http://article.gmane.org/gmane.comp.lib.gnulib.bugs/26995;  \
        if test -d .git; then                                           \
-         url=http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/22874; \
-         git grep '^[   ]*TESTS_ENVIRONMENT += PATH=' modules          \
-           && { printf '%s\n' 'Do not augment PATH via TESTS_ENVIRONMENT;' \
-                "  see <$$url>" 1>&2; exit 1; } || :                   \
+         git ls-files m4                                               \
+            | grep -Ev '^m4/($(allow_AC_LIBOBJ_or))\.m4$$'             \
+            | xargs grep -w AC_LIBOBJ                                  \
+           && { printf '%s\n' 'Do not use AC_LIBOBJ in m4/*.m4;'       \
+                "see <$$url>"; exit 1; } || :;                         \
        else :; fi

 sc_pragma_columns:
--
1.7.6.rc0.293.g40857



reply via email to

[Prev in Thread] Current Thread [Next in Thread]