]> sourceware.org Git - automake.git/commitdiff
* automake.in (&scan_autoconf_traces): Add support for
authorAkim Demaille <akim@epita.fr>
Sat, 20 Oct 2001 11:15:10 +0000 (11:15 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 20 Oct 2001 11:15:10 +0000 (11:15 +0000)
AM_INIT_AUTOMAKE, AM_CONDITIONAL.
Let @args have a more natural M4 correspondence: $1 is args[1], no
args[0] etc.
(&scan_autoconf_files): Using autoconf traces is no longer a
complement of the previous ad hoc scheme: use either.

ChangeLog
automake.in

index fd30b7e3036e5025e6da0851ac5e9e0c78f8129a..9ffd162a7e2ec02209e277f14ede0f1b8c10204c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-10-20  Akim Demaille  <akim@epita.fr>
+
+       * automake.in (&scan_autoconf_traces): Add support for
+       AM_INIT_AUTOMAKE, AM_CONDITIONAL.
+       Let @args have a more natural M4 correspondence: $1 is args[1], no
+       args[0] etc.
+       (&scan_autoconf_files): Using autoconf traces is no longer a
+       complement of the previous ad hoc scheme: use either.
+
+       
 2001-10-20  Akim Demaille  <akim@epita.fr>
 
        * automake.in (&scan_one_autoconf_file): `%generalize' is new, and
index 65ab0329a3d9d21ae44c87d0e21de1ba33fa74a8..e21e86ee9dd8a9ec86ded5832098cbf86d395836 100755 (executable)
@@ -4440,56 +4440,57 @@ sub scan_autoconf_config_files
 # &scan_autoconf_traces ($FILENAME)
 # ---------------------------------
 # FIXME: For the time being, we don't care about the FILENAME.
-sub scan_autoconf_traces
+sub scan_autoconf_traces ($)
 {
-    my ($filename) = @_;
+  my ($filename) = @_;
 
-    my $traces = "$ENV{amtraces} ";
+  my $traces = "$ENV{amtraces} ";
 
-    $traces .= ' -t AC_CONFIG_FILES';
-    $traces .= ' -t AC_LIBSOURCE';
-    $traces .= ' -t AC_SUBST';
+  $traces .= ' --trace=AC_CONFIG_FILES';
+  $traces .= ' --trace=AC_LIBSOURCE';
+  $traces .= ' --trace=AC_SUBST';
+  $traces .= ' --trace=AM_CONDITIONAL';
+  $traces .= ' --trace=AM_INIT_AUTOMAKE';
 
-    my $tracefh = new Automake::XFile ("$traces |");
-    print "$me: reading $traces\n" if $verbose;
+  my $tracefh = new Automake::XFile ("$traces |");
+  verbose "reading $traces";
 
-    while ($_ = $tracefh->getline)
+  while ($_ = $tracefh->getline)
     {
-        chomp;
-        my ($file, $line, $macro, @args) = split /:/;
-       my $here = "$file:$line";
+      chomp;
+      my ($file, $line, @args) = split /:/;
+      my $macro = $args[0];
+      my $here = "$file:$line";
 
-       # Alphabetical ordering please.
-        if ($macro eq 'AC_CONFIG_FILES')
+      # Alphabetical ordering please.
+      if ($macro eq 'AC_CONFIG_FILES')
        {
-           # Look at potential Makefile.am's.
-           &scan_autoconf_config_files ($args[0]);
+         # Look at potential Makefile.am's.
+         &scan_autoconf_config_files ($args[1]);
+       }
+      elsif ($macro eq 'AC_LIBSOURCE')
+       {
+         # We should actually also `close' the sources: getopt.c
+         # wants getopt.h etc.  But actually it should be done in the
+         # macro itself, i.e., we have to first fix Autoconf to extend
+         # _AC_LIBOBJ_DECL and use it the in various macros.
+         $libsources{$args[1]} = $here;
+       }
+      elsif ($macro eq 'AC_SUBST')
+       {
+         $configure_vars{$args[1]} = $here;
        }
-        elsif ($macro eq 'AC_LIBSOURCE')
+      elsif ($macro eq 'AM_CONDITIONAL')
        {
-           my $source = "$args[0].c";
-           # We should actually also `close' the sources: getopt.c
-           # wants getopt.h etc.  But actually it should be done in the
-           # macro itself, i.e., we have to first fix Autoconf to extend
-           # _AC_LIBOBJ_DECL and use it the in various macros.
-           if (!defined $libsources{$source})
-               {
-                   print STDERR "traces: discovered $source\n";
-                   $libsources{$source} = $here;
-               }
+         $configure_cond{$args[1]} = $here;
        }
-        elsif ($macro eq 'AC_SUBST')
+      elsif ($macro eq 'AM_INIT_AUTOMAKE')
        {
-           if (!defined $configure_vars{$args[0]})
-               {
-                   print STDERR "traces: discovered AC_SUBST($args[0])\n";
-                   $configure_vars{$args[0]} = $here;
-               }
+         $package_version = $args[2];
+         $package_version_line = $.;
+         $seen_init_automake = 1;
        }
     }
-
-    $tracefh->close
-       || die "$me: close: $traces: $!\n";
 }
 
 
@@ -4832,17 +4833,19 @@ sub scan_autoconf_files
     die "$me: `configure.ac' or `configure.in' is required\n"
         if !$configure_ac;
 
-    &scan_one_autoconf_file ($configure_ac);
-    &scan_one_autoconf_file ('aclocal.m4')
-       if -f 'aclocal.m4';
-
     if (defined $ENV{'amtraces'})
     {
-        warn '$me: Autoconf traces is an experimental feature';
-        warn '$me: use at your own risks';
+        print STDERR "$me: Autoconf traces is an experimental feature\n";
+        print STDERR "$me: use at your own risks\n";
 
-        &scan_autoconf_traces ($configure_ac);
+        scan_autoconf_traces ($configure_ac);
     }
+    else
+      {
+       scan_one_autoconf_file ($configure_ac);
+       scan_one_autoconf_file ('aclocal.m4')
+         if -f 'aclocal.m4';
+      }
 
     # Set input and output files if not specified by user.
     if (! @input_files)
This page took 0.037538 seconds and 5 git commands to generate.