]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tighten m4 AC_ quoting check
authorJim Meyering <meyering@redhat.com>
Fri, 26 Dec 2008 14:33:34 +0000 (15:33 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 1 Jan 2009 01:15:07 +0000 (02:15 +0100)
* maint.mk (sc_m4_quote_check): Renamed from m4-check.
Also search for AC_DEFINE and AC_DEFINE_UNQUOTED.
Also search in configure.ac.
* configure.ac: Quote first argument of AC_DEFINE.
* jm-macros.m4 (coreutils_MACROS): Quote the first argument to AC_DEFINE.

configure.ac
m4/jm-macros.m4
maint.mk

index f165893a065de392c8df750d612a4f68f12b0a38..4a77c8b3ce34f5dc9e763b734a986cbb28d040af 100644 (file)
@@ -133,7 +133,7 @@ else
 fi])dnl
 AC_MSG_RESULT($utils_cv_localtime_cache)
 if test $utils_cv_localtime_cache = yes; then
-  AC_DEFINE(LOCALTIME_CACHE, 1, [FIXME])
+  AC_DEFINE([LOCALTIME_CACHE], 1, [FIXME])
 fi
 
 # SCO-ODT-3.0 is reported to need -los to link programs using initgroups
@@ -146,7 +146,7 @@ AC_CHECK_FUNCS(syslog)
 if test $ac_cv_func_syslog = no; then
   # syslog is not in the default libraries.  See if it's in some other.
   for lib in bsd socket inet; do
-    AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG, 1, [FIXME])
+    AC_CHECK_LIB($lib, syslog, [AC_DEFINE([HAVE_SYSLOG], 1, [FIXME])
       LIBS="$LIBS -l$lib"; break])
   done
 fi
@@ -189,7 +189,7 @@ AC_CACHE_VAL(su_cv_func_ut_host_in_utmp,
 AC_MSG_RESULT($su_cv_func_ut_host_in_utmp)
 if test $su_cv_func_ut_host_in_utmp = yes; then
   have_ut_host=1
-  AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
+  AC_DEFINE([HAVE_UT_HOST], 1, [FIXME])
 fi
 
 if test -z "$have_ut_host"; then
@@ -201,8 +201,8 @@ if test -z "$have_ut_host"; then
     [su_cv_func_ut_host_in_utmpx=no])])
   AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx)
   if test $su_cv_func_ut_host_in_utmpx = yes; then
-    AC_DEFINE(HAVE_UTMPX_H, 1, [FIXME])
-    AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
+    AC_DEFINE([HAVE_UTMPX_H], 1, [FIXME])
+    AC_DEFINE([HAVE_UT_HOST], 1, [FIXME])
   fi
 fi
 
@@ -228,7 +228,7 @@ yes
    su_cv_sys_termios_needs_xopen_source=no))])
   AC_MSG_RESULT($su_cv_sys_termios_needs_xopen_source)
   test $su_cv_sys_termios_needs_xopen_source = yes &&
-    AC_DEFINE(TERMIOS_NEEDS_XOPEN_SOURCE, 1, [FIXME])
+    AC_DEFINE([TERMIOS_NEEDS_XOPEN_SOURCE], 1, [FIXME])
 
   AC_MSG_CHECKING(c_line in struct termios)
   AC_CACHE_VAL(su_cv_sys_c_line_in_termios,
@@ -241,7 +241,7 @@ yes
     [su_cv_sys_c_line_in_termios=no])])
   AC_MSG_RESULT($su_cv_sys_c_line_in_termios)
   test $su_cv_sys_c_line_in_termios = yes \
-    && AC_DEFINE(HAVE_C_LINE, 1, [FIXME])
+    && AC_DEFINE([HAVE_C_LINE], 1, [FIXME])
 fi
 
 # FIXME: note that this macro appears above, too.
@@ -267,7 +267,7 @@ if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \
   AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_pty_h)
 
   test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
-      && AC_DEFINE(GWINSZ_IN_SYS_PTY, 1,
+      && AC_DEFINE([GWINSZ_IN_SYS_PTY], 1,
                    [Define if your system defines TIOCGWINSZ in sys/pty.h.])
 fi
 
index a53be5b38a111099e9852ce2c5fe17a01efe2e83..38e19fcb5c5c4d954718a98fb4abef12c74653d7 100644 (file)
@@ -36,9 +36,9 @@ AC_DEFUN([coreutils_MACROS],
   AC_REQUIRE([AC_FUNC_FSEEKO])
 
   # By default, argmatch should fail calling usage (1).
-  AC_DEFINE(ARGMATCH_DIE, [usage (1)],
+  AC_DEFINE([ARGMATCH_DIE], [usage (1)],
            [Define to the function xargmatch calls on failures.])
-  AC_DEFINE(ARGMATCH_DIE_DECL, [void usage (int _e)],
+  AC_DEFINE([ARGMATCH_DIE_DECL], [void usage (int _e)],
            [Define to the declaration of the xargmatch failure function.])
 
   # used by ls
index 3efcd8fe56727452d20773c5ce18d900f3c640ff..9ae8cdad86a524c1e1ab4d072b725f871f05dfc5 100644 (file)
--- a/maint.mk
+++ b/maint.mk
@@ -74,7 +74,7 @@ syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
 .PHONY: $(syntax-check-rules)
 
 local-checks-available = \
-  po-check copyright-check m4-check author_mark_check \
+  po-check copyright-check author_mark_check \
   patch-check $(syntax-check-rules) \
   makefile_path_separator_check \
   makefile-check check-AUTHORS
@@ -473,9 +473,10 @@ changelog-check:
          exit 1;                                                       \
        fi
 
-m4-check:
-       @grep -n 'AC_DEFUN([^[]' m4/*.m4 \
-         && { echo '$(ME): quote the first arg to AC_DEFUN' 1>&2; \
+sc_m4_quote_check:
+       @grep -nE '(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]'              \
+           $$($(VC_LIST_EXCEPT) | grep -E '(^configure\.ac|\.m4)$$')   \
+         && { echo '$(ME): quote the first arg to AC_DEF*' 1>&2;       \
               exit 1; } || :
 
 fix_po_file_diag = \