From: Stefano Lattarini Date: Tue, 15 Mar 2011 16:36:40 +0000 (+0100) Subject: cosmetics: better use of m4 quoting and m4sugar macros X-Git-Tag: ng-0.5a~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c5d9e8f2d52ee108d6d8d885ce8856da8021917;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index ee6c69c9b..f2955580d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2011-03-17 Stefano Lattarini + + 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 tests: add test about deprecated use of AC_INIT diff --git a/m4/cond.m4 b/m4/cond.m4 index fd248b2f7..7fa5dfd71 100644 --- a/m4/cond.m4 +++ b/m4/cond.m4 @@ -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 diff --git a/m4/depend.m4 b/m4/depend.m4 index a5726c646..cf1b3d880 100644 --- a/m4/depend.m4 +++ b/m4/depend.m4 @@ -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], diff --git a/m4/dmalloc.m4 b/m4/dmalloc.m4 index 5d48a248a..82743fd39 100644 --- a/m4/dmalloc.m4 +++ b/m4/dmalloc.m4 @@ -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]) diff --git a/m4/gcj.m4 b/m4/gcj.m4 index 9e930e036..c53a1bfc6 100644 --- 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)]) ]) diff --git a/m4/init.m4 b/m4/init.m4 index 365c9ac89..ccc196548 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -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 diff --git a/m4/install-sh.m4 b/m4/install-sh.m4 index b15371521..a9b81e0c7 100644 --- a/m4/install-sh.m4 +++ b/m4/install-sh.m4 @@ -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])]) diff --git a/m4/lex.m4 b/m4/lex.m4 index 022f6a8b6..501292679 100644 --- a/m4/lex.m4 +++ b/m4/lex.m4 @@ -1,20 +1,20 @@ ## Replacement for AC_PROG_LEX. -*- Autoconf -*- ## by Alexandre Oliva -# 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 diff --git a/m4/multi.m4 b/m4/multi.m4 index dce367524..bc01dcf7b 100644 --- a/m4/multi.m4 +++ b/m4/multi.m4 @@ -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. diff --git a/m4/options.m4 b/m4/options.m4 index 6824d84fa..efdc49d1c 100644 --- a/m4/options.m4 +++ b/m4/options.m4 @@ -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) # ------------------------ diff --git a/m4/python.m4 b/m4/python.m4 index 2410436db..413382380 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -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 diff --git a/m4/sanity.m4 b/m4/sanity.m4 index a9cac5c9e..b718ac405 100644 --- a/m4/sanity.m4 +++ b/m4/sanity.m4 @@ -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=