]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
cosmetics: better use of m4 quoting and m4sugar macros
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 15 Mar 2011 16:36:40 +0000 (17:36 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 17 Mar 2011 22:24:38 +0000 (23:24 +0100)
* m4/dmalloc.m4: Better use of m4 quoting.  Bump serial number.
* m4/gcj.m4: Likewise.
* m4/init.m4: Likewise.
* m4/install-sh.m4: Likewise.
* m4/lex.m4: Likewise.
* m4/multi.m4: Likewise.
* m4/option.m4: Likewise.
* m4/python.m4: Likewise.
* m4/sanity.m4: Likewise.
* m4/cond.m4: Likewise.  Also, prefer the m4sugar macro 'm4_if'
over the plain m4 macro 'ifelse'.
* m4/depend.m4: Likewise.

12 files changed:
ChangeLog
m4/cond.m4
m4/depend.m4
m4/dmalloc.m4
m4/gcj.m4
m4/init.m4
m4/install-sh.m4
m4/lex.m4
m4/multi.m4
m4/options.m4
m4/python.m4
m4/sanity.m4

index ee6c69c9b0af6fc4ca2699576e533ba9c96dfc6d..f2955580d5f1c2269b74059971b2a33c0b9b1c65 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2011-03-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       cosmetics: better use of m4 quoting and m4sugar macros
+       * m4/dmalloc.m4: Better use of m4 quoting.  Bump serial number.
+       * m4/gcj.m4: Likewise.
+       * m4/init.m4: Likewise.
+       * m4/install-sh.m4: Likewise.
+       * m4/lex.m4: Likewise.
+       * m4/multi.m4: Likewise.
+       * m4/option.m4: Likewise.
+       * m4/python.m4: Likewise.
+       * m4/sanity.m4: Likewise.
+       * m4/cond.m4: Likewise.  Also, prefer the m4sugar macro 'm4_if'
+       over the plain m4 macro 'ifelse'.
+       * m4/depend.m4: Likewise.
+
 2011-03-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tests: add test about deprecated use of AC_INIT
index fd248b2f7392e1691fa774a5adba274a3bd5dce7..7fa5dfd7188caee866a44ba877c3c94711db213e 100644 (file)
@@ -1,21 +1,21 @@
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008, 2011
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
+# serial 10
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
index a5726c6469235b67d1b38a0b877f5fd9b79dd60a..cf1b3d8800fbeb1607fc63643bcdeeb2ea16c03a 100644 (file)
@@ -6,7 +6,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 13
+# serial 14
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -31,12 +31,12 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
index 5d48a248a20e43eb825ab412bad72065dbf40c4b..82743fd396351a7f0fbbb40537bc97c77b2debb2 100644 (file)
@@ -3,14 +3,14 @@
 ## From Franc,ois Pinard               ##
 ## ----------------------------------- ##
 
-# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2010
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2010,
+# 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 AC_DEFUN([AM_WITH_DMALLOC],
 [AC_MSG_CHECKING([if malloc debugging is wanted])
@@ -18,14 +18,14 @@ AC_ARG_WITH([dmalloc],
 [AS_HELP_STRING([--with-dmalloc],
                 [use dmalloc, as in http://www.dmalloc.com])],
 [if test "$withval" = yes; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(WITH_DMALLOC,1,
+  AC_MSG_RESULT([yes])
+  AC_DEFINE([WITH_DMALLOC], [1],
            [Define if using the dmalloc debugging malloc package])
   LIBS="$LIBS -ldmalloc"
   LDFLAGS="$LDFLAGS -g"
 else
-  AC_MSG_RESULT(no)
-fi], [AC_MSG_RESULT(no)])
+  AC_MSG_RESULT([no])
+fi], [AC_MSG_RESULT([no])])
 ])
 
 AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])
index 9e930e0367f4161fa0a44670dc2a6d7d824be0df..c53a1bfc631a6347555fcee47b0fc4e8301bcfae 100644 (file)
--- a/m4/gcj.m4
+++ b/m4/gcj.m4
@@ -1,18 +1,19 @@
 # Check for Java compiler.                                  -*- Autoconf -*-
 # For now we only handle the GNU compiler.
 
-# Copyright (C) 1999, 2000, 2003, 2005, 2009  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2005, 2009, 2011 Free Software
+# Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([AM_PROG_GCJ],[
-AC_CHECK_TOOLS(GCJ, gcj, gcj)
+AC_DEFUN([AM_PROG_GCJ],
+[AC_CHECK_TOOLS([GCJ], [gcj], [gcj])
 test -z "$GCJ" && AC_MSG_ERROR([no acceptable gcj found in \$PATH])
 if test "x${GCJFLAGS-unset}" = xunset; then
    GCJFLAGS="-g -O2"
 fi
-AC_SUBST(GCJFLAGS)
+AC_SUBST([GCJFLAGS])
 _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(GCJ)])
 ])
index 365c9ac890d1056183904e2ce5a2738d61064d3a..ccc196548641159f51f0c1dfdfebae5da0f9957a 100644 (file)
@@ -1,13 +1,13 @@
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 16
+# serial 17
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -58,23 +58,25 @@ m4_ifval([$2],
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
@@ -88,17 +90,17 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
                             [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-                 [_AM_DEPENDENCIES(CC)],
+                 [_AM_DEPENDENCIES([CC])],
                  [define([AC_PROG_CC],
-                         defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+                         defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                 [_AM_DEPENDENCIES(CXX)],
+                 [_AM_DEPENDENCIES([CXX])],
                  [define([AC_PROG_CXX],
-                         defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+                         defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                 [_AM_DEPENDENCIES(OBJC)],
+                 [_AM_DEPENDENCIES([OBJC])],
                  [define([AC_PROG_OBJC],
-                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
 ])
 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
index b15371521c091ebc7fe64a6c345191adf9add76c..a9b81e0c760ee826db2cd1a6abcb14b74ac93ff9 100644 (file)
@@ -1,5 +1,6 @@
 ##                                                          -*- Autoconf -*-
-# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
+# Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -18,4 +19,4 @@ if test x"${install_sh}" != xset; then
     install_sh="\${SHELL} $am_aux_dir/install-sh"
   esac
 fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
index 022f6a8b6a40e63a8636f1a1ed8ddd123101fa03..50129267981847c05cedcdd43a2832085fee4314 100644 (file)
--- a/m4/lex.m4
+++ b/m4/lex.m4
@@ -1,20 +1,20 @@
 ## Replacement for AC_PROG_LEX.                            -*-  Autoconf -*-
 ## by Alexandre Oliva <oliva@dcc.unicamp.br>
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2011 Free
+# Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # AM_PROG_LEX
 # -----------
 # Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
 # "missing" invocation, for better error output.
 AC_DEFUN([AM_PROG_LEX],
-[AC_PREREQ(2.50)dnl
+[AC_PREREQ([2.50])dnl
 AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
 AC_REQUIRE([AC_PROG_LEX])dnl
 if test "$LEX" = :; then
index dce367524dacb9eabdfcf2cca82c6f74bff269b3..bc01dcf7b29cc465129cdefdab680b80d43bc6e9 100644 (file)
@@ -1,12 +1,12 @@
 ##                                                          -*- Autoconf -*-
-# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
+# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2011
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
+# serial 8
 
 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
 # ---------------------------------------------------
@@ -37,7 +37,7 @@ if test "$srcdir" = "."; then
 else
   multi_basedir="$srcdir/$2"
 fi
-AC_SUBST(multi_basedir)
+AC_SUBST([multi_basedir])
 
 # Even if the default multilib is not a cross compilation,
 # it may be that some of the other multilibs are.
index 6824d84fad344478dd60a361ac7194be94c244a8..efdc49d1c17fc02bf2cee4046c4cd88dac6a6a68 100644 (file)
@@ -1,13 +1,13 @@
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -18,7 +18,7 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 # --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
 # ------------------------
index 2410436dba4bd9a6007dd300c9e8a2512ef1d332..41338238088dd6ed238f4c8accfeac6d1e613ced 100644 (file)
@@ -3,8 +3,8 @@
 ## From Andrew Dalke
 ## Updated by James Henstridge
 ## ------------------------
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009,
+# 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -55,9 +55,9 @@ AC_DEFUN([AM_PATH_PYTHON],
       # If the user set $PYTHON, use it and don't search something else.
       AC_MSG_CHECKING([whether $PYTHON version is >= $1])
       AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
-                             [AC_MSG_RESULT(yes)],
-                             [AC_MSG_RESULT(no)
-                              AC_MSG_ERROR(Python interpreter is too old)])
+                             [AC_MSG_RESULT([yes])],
+                             [AC_MSG_RESULT([no])
+                              AC_MSG_ERROR([Python interpreter is too old])])
       am_display_PYTHON=$PYTHON
     else
       # Otherwise, try each interpreter until we find one that satisfies
index a9cac5c9e731338f092caa28b7aab5df35cf05d5..b718ac4057fd8eb8df185b63c71d99ecc8929030 100644 (file)
@@ -7,7 +7,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
+# serial 9
 
 # AM_SANITY_CHECK
 # ---------------
@@ -66,7 +66,7 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)
+AC_MSG_RESULT([yes])
 # If we didn't sleep, we still need to ensure time stamps of config.status and
 # generated files are strictly newer.
 am_sleep_pid=