automake-patches
[Top][All Lists]
Advanced

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

FYI: Define %FIRST% automatically for each file.


From: Alexandre Duret-Lutz
Subject: FYI: Define %FIRST% automatically for each file.
Date: Mon, 05 Jan 2004 10:04:02 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

I'm installing this on HEAD.  This is some preparation for my
next patch (which is going to wait until tonight).

2004-01-05  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (%transformed_files): New variable.
        (initialize_per_input): Reset it.
        (make_paragraphs): Fill %transformed_files, and define %FIRST%
        each time a file is transformed for the first time.
        (handle_configure): Do not define %FIRST_CONFIG_HIN%.
        (am_install_var): Do not define %FIRST%.
        * lib/am/remake-hdr.am: Use %?FIRST% instead of %?FIRST_CONFIG_HIN%.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1535
diff -u -r1.1535 automake.in
--- automake.in 3 Jan 2004 15:40:07 -0000       1.1535
+++ automake.in 5 Jan 2004 09:01:48 -0000
@@ -546,6 +546,9 @@
 # FIXME: This is a hack. a better switch should be found.
 my $get_object_extension_was_run;
 
+# Record each file processed by make_paragraphs.
+my %transformed_files;
+
 ################################################################
 
 # var_SUFFIXES_trigger ($TYPE, $VALUE)
@@ -642,6 +645,8 @@
 
     # We always include `.'.  This isn't strictly correct.
     %libtool_clean_directories = ('.' => 1);
+
+    %transformed_files = ();
 }
 
 
@@ -3692,7 +3697,6 @@
                           CONFIG_HIN       => $ins[0],
                           CONFIG_H_DEPS    => "@ins",
                           CONFIG_H_PATH    => $config_h_path,
-                          FIRST_CONFIG_HIN => ($hdr_index == 1),
                           STAMP            => "$stamp");
 
          push @distclean_config, $cn_sans_dir, $stamp;
@@ -5847,10 +5851,13 @@
 
                 'LIBTOOL'      => !! var ('LIBTOOL'),
                 'NONLIBTOOL'   => 1,
+                'FIRST'        => ! $transformed_files{$file},
                 %transform)
     # We don't need more than two consecutive new-lines.
     . 's/\n{3,}/\n\n/g';
 
+  $transformed_files{$file} = 1;
+
   # Swallow the file and apply the COMMAND.
   my $fc_file = new Automake::XFile "< $file";
   # Looks stupid?
@@ -6306,9 +6313,6 @@
   my @used = ();
   my @result = ();
 
-  # True if the iteration is the first one.  Used for instance to
-  # output parts of the associated file only once.
-  my $first = 1;
   foreach my $X (@prefix)
     {
       my $nodir_name = $X;
@@ -6400,20 +6404,16 @@
       # Singular form of $PRIMARY.
       (my $one_primary = $primary) =~ s/S$//;
       $output_rules .= &file_contents ($file, $where,
-                                        FIRST => $first,
-
-                                        PRIMARY     => $primary,
-                                        ONE_PRIMARY => $one_primary,
-                                        DIR         => $X,
-                                        NDIR        => $nodir_name,
-                                        BASE        => $strip_subdir,
-
-                                        EXEC      => $exec_p,
-                                        INSTALL   => $install_p,
-                                        DIST      => $dist_p,
-                                        'CK-OPTS' => $check_options_p);
-
-      $first = 0;
+                                      PRIMARY     => $primary,
+                                      ONE_PRIMARY => $one_primary,
+                                      DIR         => $X,
+                                      NDIR        => $nodir_name,
+                                      BASE        => $strip_subdir,
+
+                                      EXEC      => $exec_p,
+                                      INSTALL   => $install_p,
+                                      DIST      => $dist_p,
+                                      'CK-OPTS' => $check_options_p);
     }
 
   # The JAVA variable is used as the name of the Java interpreter.
Index: lib/am/remake-hdr.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/remake-hdr.am,v
retrieving revision 1.43
diff -u -r1.43 remake-hdr.am
--- lib/am/remake-hdr.am        4 Dec 2003 18:17:19 -0000       1.43
+++ lib/am/remake-hdr.am        5 Jan 2004 09:01:50 -0000
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003
+## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -35,7 +35,7 @@
 
 ## Only the first file of AC_CONFIG_HEADERS is assumed to be generated
 ## by autoheader.
-if %?FIRST_CONFIG_HIN%
+if %?FIRST%
 %CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES%
        cd $(top_srcdir) && $(AUTOHEADER)
 ## Whenever $(AUTOHEADER) has run, we must make sure that
@@ -75,4 +75,4 @@
 ## by config.status, there is no reason to make things complex for
 ## config.hin.
        touch $@
-endif %?FIRST_CONFIG_HIN%
+endif %?FIRST%

-- 
Alexandre Duret-Lutz





reply via email to

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