autoconf-patches
[Top][All Lists]
Advanced

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

01-autoreconf.patch


From: Akim Demaille
Subject: 01-autoreconf.patch
Date: Wed, 16 Oct 2002 08:32:25 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        
        * bin/autoconf.as: Kill dead options.
        * bin/autoupdate.in (&parse_args): Kill old options.
        * bin/autoreconf.in (&parse_args): Remove dead options.
        Factor some code.
        (&autoreconf): Report the directories we enter *and leave*, so
        that error messages can be easily located, and use GNU Make
        format, so that Emacs' compile mode understands us.
        * lib/Autom4te/General.pm (&update_file): Use `verbose' to report
        if some file was changed instead of `print'.
        * bin/autoheader.in: Suggest AC_DEFINE with 3 args when needed.
        (&parse_args): Remove the dead options.
        * tests/atspecific.m4 (AT_CHECK_AUTOHEADER): Adjust to the new
        autoheader's quiet mode.
        (AT_CHECK_AUTOUPDATE): Likewise.
        * tests/tools.at (autoupdate): Adjust.
        * tests/semantics.at (AC_C_BIGENDIAN): Likewise.
        
Index: NEWS
--- NEWS Sun, 13 Oct 2002 10:08:25 +0200 akim
+++ NEWS Tue, 15 Oct 2002 20:34:39 +0200 akim
@@ -1,6 +1,13 @@
 * Major changes in Autoconf 2.54a                       -*- outline -*-
 
 
+** autoreconf
+
+- Is more robust to different Gettext installations.
+
+- Produces messages (when --verbose) to be understood by Emacs'
+  compile mode.
+
 ** Macros
 
 - AC_CHECK_HEADER/AC_CHECK_HEADERS
Index: bin/autoconf.in
--- bin/autoconf.in Sat, 14 Sep 2002 14:56:56 +0200 akim
+++ bin/autoconf.in Tue, 15 Oct 2002 20:46:45 +0200 akim
@@ -93,15 +93,15 @@ Usage: $0 [OPTION] ... [TEMPLATE-FILE]
 \`configure'.
 
 Operation modes:
-  -h, --help               print this help, then exit
-  -V, --version            print version number, then exit
-  -v, --verbose            verbosely report processing
-  -d, --debug              don't remove temporary files
+  -h, --help                  print this help, then exit
+  -V, --version               print version number, then exit
+  -v, --verbose               verbosely report processing
+  -d, --debug                 don't remove temporary files
   -B, --prepend-include=DIR   prepend directory DIR to search path
   -I, --include=DIR           append directory DIR to search path
-  -f, --force              consider all files obsolete
-  -o, --output=FILE        save output in FILE (stdout is the default)
-  -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [syntax]
+  -f, --force                 consider all files obsolete
+  -o, --output=FILE           save output in FILE (stdout is the default)
+  -W, --warnings=CATEGORY     report the warnings falling in CATEGORY [syntax]
 
 Warning categories include:
   \`cross'         cross compilation issues
@@ -197,18 +197,6 @@ Tracing:
        test $# = 1 && eval "$exit_missing_arg"
        AUTOM4TE="$AUTOM4TE $option $2"
        shift 2 ;;
-
-    # Obsolete options.
-    --localdir=* | -l?* | --autoconf-dir=* | -A?* | --macrodir=* | -m?* )
-       echo "$me: warning: $option is obsolete, use --include" >&2
-       AUTOM4TE="$AUTOM4TE --include=$optarg"
-       shift ;;
-    --localdir | -l | --autoconf-dir | -A | --macrodir | -m )
-       echo "$me: warning: $option is obsolete, use --include" >&2
-       test $# = 1 && eval "$exit_missing_arg"
-       shift
-       AUTOM4TE="$AUTOM4TE --include=$1"
-       shift ;;
 
     --trace=* | -t?* )
        traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'"
Index: bin/autoheader.in
--- bin/autoheader.in Sat, 28 Sep 2002 17:20:48 +0200 akim
+++ bin/autoheader.in Tue, 15 Oct 2002 20:22:32 +0200 akim
@@ -104,7 +104,7 @@ sub parse_args ()
 {
   my $srcdir;
 
-  getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => address@hidden,
+  getopt ('I|include=s' => address@hidden,
          'B|prepend-include=s' => address@hidden,
          'W|warnings=s' => address@hidden);
 
@@ -127,11 +127,11 @@ sub parse_args ()
 
 # Preach.
 my $config_h_top = find_file ("config.h.top?",
-                             reverse(@prepend_include), @include);
+                             reverse (@prepend_include), @include);
 my $config_h_bot = find_file ("config.h.bot?",
-                             reverse(@prepend_include), @include);
+                             reverse (@prepend_include), @include);
 my $acconfig_h = find_file ("acconfig.h?",
-                           reverse(@prepend_include), @include);
+                           reverse (@prepend_include), @include);
 if ($config_h_top || $config_h_bot || $acconfig_h)
   {
     my $msg = << "END";
@@ -252,6 +252,7 @@ sub parse_args ()
 # Check that all the symbols have a template.
 {
   my $in = new Autom4te::XFile ("$tmp/config.hin");
+  my $suggest_ac_define = 1;
   while ($_ = $in->getline)
     {
       my ($symbol) = /^\#\s*\w+\s+(\w+)/
@@ -261,6 +262,12 @@ sub parse_args ()
   foreach (sort keys %symbol)
     {
       print STDERR "$me: missing template: $_\n";
+      if ($suggest_ac_define)
+       {
+         print STDERR "Use AC_DEFINE([$_], [], [Description])";
+         $suggest_ac_define = 0;
+       }
+
     }
   exit 1
     if keys %symbol;
Index: bin/autoreconf.in
--- bin/autoreconf.in Sun, 13 Oct 2002 10:08:25 +0200 akim
+++ bin/autoreconf.in Tue, 15 Oct 2002 20:31:12 +0200 akim
@@ -118,10 +118,10 @@ sub parse_args ()
 {
   my $srcdir;
 
-  getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => address@hidden,
-         'B|prepend-include=s'                      => address@hidden,
-         'i|install'                                        => \$install,
-         's|symlink'                                        => \$symlink);
+  getopt ('I|include=s'           => address@hidden,
+         'B|prepend-include=s'   => address@hidden,
+         'i|install'             => \$install,
+         's|symlink'             => \$symlink);
 
   # Even if the user specified a configure.ac, trim to get the
   # directory, and look for configure.ac again.  Because (i) the code
@@ -132,18 +132,14 @@ sub parse_args ()
 
   if ($verbose && $debug)
     {
-      xsystem ("$autoconf --version | sed 1q >&2");
-      print STDERR "\n";
-      xsystem ("$autoheader --version | sed 1q >&2");
-      print STDERR "\n";
-      xsystem ("$automake --version | sed 1q >&2");
-      print STDERR "\n";
-      xsystem ("$aclocal --version | sed 1q >&2");
-      print STDERR "\n";
-      xsystem ("$autopoint --version | sed 1q >&2");
-      print STDERR "\n";
-      xsystem ("$libtoolize --version | sed 1q >&2");
-      print STDERR "\n";
+      for my $prog ($autoconf, $autoheader,
+                   $automake, $aclocal,
+                   $autopoint,
+                   $libtoolize)
+       {
+         xsystem ("$prog --version | sed 1q >&2");
+         print STDERR "\n";
+       }
     }
 
   # Dispatch autoreconf's option to the tools.
@@ -192,7 +188,9 @@ sub autoreconf ($)
 {
   my ($directory) = @_;
 
-  verbose "working in `$directory'";
+  # The format for this message is not free: taken from Emacs, itself
+  # using GNU Make's format.
+  verbose "Entering directory `$directory'";
   chdir $directory
     or error "cannot chdir to $directory: $!";
 
@@ -506,6 +504,9 @@ sub autoreconf ($)
       xsystem ($automake);
     }
 
+  # The format is not free: taken from Emacs, itself using GNU Make's
+  # format.
+  verbose "Leaving directory `$directory'";
   chdir $cwd
     or error "cannot chdir to $cwd: $!";
 }
Index: bin/autoupdate.in
--- bin/autoupdate.in Sat, 14 Sep 2002 14:56:56 +0200 akim
+++ bin/autoupdate.in Tue, 15 Oct 2002 20:35:49 +0200 akim
@@ -55,13 +55,13 @@
 Autoconf.  The original files are backed up.
 
 Operation modes:
-  -h, --help           print this help, then exit
-  -V, --version        print version number, then exit
-  -v, --verbose        verbosely report processing
-  -d, --debug          don't remove temporary files
+  -h, --help                 print this help, then exit
+  -V, --version              print version number, then exit
+  -v, --verbose              verbosely report processing
+  -d, --debug                don't remove temporary files
   -B, --prepend-include=DIR  prepend directory DIR to search path
   -I, --include=DIR          append directory DIR to search path
-  -f, --force          consider all files obsolete
+  -f, --force                consider all files obsolete
 
 Report bugs to <address@hidden>.
 ";
@@ -88,9 +88,9 @@ sub parse_args ()
 {
   my $srcdir;
 
-  getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => address@hidden,
+  getopt ('I|include=s'         => address@hidden,
          'B|prepend-include=s' => address@hidden,
-         'f|force' => \$force);
+         'f|force'             => \$force);
 
   if (! @ARGV)
     {
Index: lib/Autom4te/General.pm
--- lib/Autom4te/General.pm Sat, 14 Sep 2002 14:56:56 +0200 akim
+++ lib/Autom4te/General.pm Tue, 15 Oct 2002 20:32:07 +0200 akim
@@ -1,5 +1,5 @@
 # autoconf -- create `configure' using m4 macros
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002 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
@@ -431,7 +431,7 @@ sub update_file ($$)
   if (-f "$to" && compare ("$from", "$to") == 0)
     {
       # File didn't change, so don't update its mod time.
-      print STDERR "$me: `$to' is unchanged\n";
+      verbose "`$to' is unchanged";
       unlink ($from)
        or error "cannot not remove $from: $!";
       return
@@ -444,13 +444,13 @@ sub update_file ($$)
        or error "cannot not backup $to: $!";
       move ("$from", "$to")
        or error "cannot not rename $from as $to: $!";
-      print STDERR "$me: `$to' is updated\n";
+      verbose "`$to' is updated";
     }
   else
     {
       move ("$from", "$to")
        or error "cannot not rename $from as $to: $!";
-      print STDERR "$me: `$to' is created\n";
+      verbose "`$to' is created";
     }
 }
 
Index: tests/atspecific.m4
--- tests/atspecific.m4 Tue, 23 Jul 2002 19:28:46 +0200 akim
+++ tests/atspecific.m4 Tue, 15 Oct 2002 20:52:13 +0200 akim
@@ -171,14 +171,11 @@ m4_define([AT_CHECK_AUTOCONF],
           [$2], [$3], [$4])])
 
 
-# AT_CHECK_AUTOHEADER(ARGS, [EXIT-STATUS = 0],
-#                     STDOUT, [STDERR = `autoheader: `config.hin' is created'])
-# -----------------------------------------------------------------------------
+# AT_CHECK_AUTOHEADER(ARGS, [EXIT-STATUS = 0], STDOUT, STDERR)
+# ------------------------------------------------------------
 m4_define([AT_CHECK_AUTOHEADER],
-[AT_CHECK([autoheader $1], [$2],
-          [$3],
-          m4_default([$4], [[autoheader: `config.hin' is created
-]]))])
+[AT_CHECK([autoheader $1], [$2], [$3], [$4])
+])
 
 
 # AT_CHECK_CONFIGURE(END-COMMAND,
@@ -237,9 +234,8 @@ m4_define([AT_CHECK_DEFINES],
 # AT_CHECK_AUTOUPDATE
 # -------------------
 m4_define([AT_CHECK_AUTOUPDATE],
-[AT_CHECK([autoupdate], 0,
-          [], [autoupdate: `configure.ac' is updated
-])])
+[AT_CHECK([autoupdate $1], [$2], [$3], [$4])
+])
 
 
 # _AT_CHECK_AC_MACRO(AC-BODY, PRE-TESTS)
Index: tests/semantics.at
--- tests/semantics.at Tue, 23 Jul 2002 19:28:46 +0200 akim
+++ tests/semantics.at Tue, 15 Oct 2002 21:00:39 +0200 akim
@@ -364,8 +364,7 @@ m4_define([AT_CHECK_PROGS_PREPARE],
 
 # Make sure AC_C_BIGENDIAN with no argument will define WORDS_BIGENDIAN
 AT_CONFIGURE_AC([AC_C_BIGENDIAN])
-AT_CHECK_AUTOHEADER([], [], [], [autoheader: `config.hin' is updated
-])
+AT_CHECK_AUTOHEADER
 AT_CHECK([grep WORDS_BIGENDIAN config.hin], [], [ignore])
 
 AT_CLEANUP(at-endian)
Index: tests/tools.at
--- tests/tools.at Sun, 09 Jun 2002 10:50:29 +0200 akim
+++ tests/tools.at Tue, 15 Oct 2002 20:51:32 +0200 akim
@@ -503,9 +503,7 @@ configure.ac:14: error: possibly undefin
 AT_CHECK_AUTOUPDATE
 AT_CHECK([cat configure.ac], 0, [expout])
 # Checking that `autoupdate' is idempotent
-AT_CHECK([autoupdate], 0, [],
-         [autoupdate: `configure.ac' is unchanged
-])
+AT_CHECK_AUTOUPDATE
 AT_CHECK([cat configure.ac], 0, [expout])
 
 AT_CLEANUP(configure.ac~)
Index: bin/autoconf.as
--- bin/autoconf.as Sat, 14 Sep 2002 14:56:56 +0200 akim
+++ bin/autoconf.as Tue, 15 Oct 2002 20:44:50 +0200 akim
@@ -27,15 +27,15 @@ Usage: $0 [OPTION] ... [TEMPLATE-FILE]
 \`configure'.
 
 Operation modes:
-  -h, --help               print this help, then exit
-  -V, --version            print version number, then exit
-  -v, --verbose            verbosely report processing
-  -d, --debug              don't remove temporary files
+  -h, --help                  print this help, then exit
+  -V, --version               print version number, then exit
+  -v, --verbose               verbosely report processing
+  -d, --debug                 don't remove temporary files
   -B, --prepend-include=DIR   prepend directory DIR to search path
   -I, --include=DIR           append directory DIR to search path
-  -f, --force              consider all files obsolete
-  -o, --output=FILE        save output in FILE (stdout is the default)
-  -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [syntax]
+  -f, --force                 consider all files obsolete
+  -o, --output=FILE           save output in FILE (stdout is the default)
+  -W, --warnings=CATEGORY     report the warnings falling in CATEGORY [syntax]
 
 Warning categories include:
   \`cross'         cross compilation issues
@@ -111,18 +111,6 @@ Tracing:
        test $# = 1 && eval "$exit_missing_arg"
        AUTOM4TE="$AUTOM4TE $option $2"
        shift 2 ;;
-
-    # Obsolete options.
-    --localdir=* | -l?* | --autoconf-dir=* | -A?* | --macrodir=* | -m?* )
-       echo "$me: warning: $option is obsolete, use --include" >&2
-       AUTOM4TE="$AUTOM4TE --include=$optarg"
-       shift ;;
-    --localdir | -l | --autoconf-dir | -A | --macrodir | -m )
-       echo "$me: warning: $option is obsolete, use --include" >&2
-       test $# = 1 && eval "$exit_missing_arg"
-       shift
-       AUTOM4TE="$AUTOM4TE --include=$1"
-       shift ;;
 
     --trace=* | -t?* )
        traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'"




reply via email to

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