autoconf-patches
[Top][All Lists]
Advanced

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

m4 2.0 command line change


From: Eric Blake
Subject: m4 2.0 command line change
Date: Tue, 19 Sep 2006 19:59:16 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Yesterday, in CVS m4, I just added --debugfile as a new synonym for this option 
which better states what is going on (and matches the name of the debugfile 
macro, to boot).  And by deprecating the old spellings in CVS M4, it also gives 
M4 the freedom to redefine -o (after a couple of years of deprecation warnings, 
of course) to be more like `gcc -o' or `autom4te -o' where it specifies the 
output file instead of using stdout.  However, it also means that the autoconf 
testsuite fails loads of tests when using CVS m4 due to this new warning 
polluting stderr:

/usr/local/bin/m4: Warning: `--error-output' is deprecated, use `--debugfile' 
instead

I plan on adding --debugfile to M4 1.4.7, but leaving --error-output as a 
silent synonym there (so that a user can upgrade to M4 1.4.7 without breaking 
existing installations of autoconf 2.60 due to deprecation warnings).  This 
also means that M4 2.0 should not be released until after autoconf 2.61 (along 
with automake 1.10, libtool 2.0, gettext 0.15.1; wow - what a release 
dependency list!).

OK to commit this patch?  Not included in this patch, but easy to add, would be 
checking the results of $M4_DEBUGFILE in configure.ac to tell the user that 
their version of M4 is outdated (since only 1.4.7 or newer will support the 
option --debugfile).

2006-09-19  Eric Blake  <eric.b.blake <at> l-3com.com>

        * m4/m4.m4 (AC_PROG_GNU_M4): Check for m4 --debugfile support.
        * bin/Makefile.am (edit): Substitute M4_DEBUGFILE.
        * bin/autom4te.in (handle_m4): Favor --debugfile over misnamed
        --error-output, to avoid warnings with M4 2.0.

Index: m4/m4.m4
===================================================================
RCS file: /sources/autoconf/autoconf/m4/m4.m4,v
retrieving revision 1.4
diff -u -r1.4 m4.m4
--- m4/m4.m4    24 Aug 2006 22:56:47 -0000      1.4
+++ m4/m4.m4    19 Sep 2006 19:53:59 -0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2000 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2006 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,12 +18,23 @@
 # AC_PROG_GNU_M4
 # --------------
 # Check for GNU m4, at least 1.3 (supports frozen files).
+# Also, check whether --error-output (through 1.4.x) or --debugfile (2.0)
+# is supported, and AC_SUBST M4_DEBUGFILE accordingly.
 AC_DEFUN([AC_PROG_GNU_M4],
-[AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
-AC_CACHE_CHECK(whether m4 supports frozen files, ac_cv_prog_gnu_m4,
+[AC_PATH_PROGS([M4], [gm4 gnum4 m4], [m4])
+AC_CACHE_CHECK([whether m4 supports frozen files], [ac_cv_prog_gnu_m4],
 [ac_cv_prog_gnu_m4=no
 if test x"$M4" != x; then
   case `$M4 --help < /dev/null 2>&1` in
     *reload-state*) ac_cv_prog_gnu_m4=yes ;;
   esac
-fi])])
+fi])
+if test $ac_cv_prog_gnu_m4 = yes ; then
+  AC_CACHE_CHECK([how m4 supports trace files], [ac_cv_prog_gnu_m4_debugfile],
+[case `$M4 --help < /dev/null 2>&1` in
+  *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;;
+  *) ac_cv_prog_gnu_m4_debugfile=--error-output ;;
+esac])
+AC_SUBST([M4_DEBUGFILE], $ac_cv_prog_gnu_m4_debugfile)
+fi
+])
Index: bin/Makefile.am
===================================================================
RCS file: /sources/autoconf/autoconf/bin/Makefile.am,v
retrieving revision 1.25
diff -u -r1.25 Makefile.am
--- bin/Makefile.am     17 Jun 2006 08:08:19 -0000      1.25
+++ bin/Makefile.am     19 Sep 2006 19:53:59 -0000
@@ -2,7 +2,7 @@
 
 ## Makefile for Autoconf.
 
-## Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+## Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -46,6 +46,7 @@
        -e 's|@address@hidden|'`echo autoheader | sed '$(transform)'`'|g' \
        -e 's|@address@hidden|'`echo autom4te | sed '$(transform)'`'|g' \
        -e 's|@address@hidden|$(M4)|g' \
+       -e 's|@address@hidden|$(M4_DEBUGFILE)|g' \
        -e 's|@address@hidden|$(AWK)|g' \
        -e 's|@address@hidden|$(VERSION)|g' \
        -e 's|@address@hidden|$(PACKAGE_NAME)|g' \
Index: bin/autom4te.in
===================================================================
RCS file: /sources/autoconf/autoconf/bin/autom4te.in,v
retrieving revision 1.100
diff -u -r1.100 autom4te.in
--- bin/autom4te.in     23 Jun 2006 15:19:34 -0000      1.100
+++ bin/autom4te.in     19 Sep 2006 19:53:59 -0000
@@ -448,7 +448,7 @@
 {
   my ($req, @macro) = @_;
 
-  # GNU m4 appends when using --error-output.
+  # GNU m4 appends when using --debugfile/--error-output.
   unlink ($tcache . $req->id . "t");
 
   # Run m4.
@@ -461,7 +461,7 @@
           . join (' --include=', '', @include)
           . ' --debug=aflq'
           . (!exists $ENV{'AUTOM4TE_NO_FATAL'} ? ' --fatal-warning' : '')
-          . " --error-output=$tcache" . $req->id . "t"
+          . " @address@hidden" . $req->id . "t"
           . join (' --trace=',   '', sort @macro)
           . " " . files_to_options (@ARGV)
           . ' </dev/null'






reply via email to

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