* automake.in (&define_files_variable): New.
authorAkim Demaille <akim@epita.fr>
Sun, 6 Jul 2003 19:27:29 +0000 (19:27 +0000)
committerAkim Demaille <akim@epita.fr>
Sun, 6 Jul 2003 19:27:29 +0000 (19:27 +0000)
(&handle_texinfo_helper): Move the handling of user variables from
here, to...
(&handle_texinfo): here.
This is to balance the size of these functions, and to match the
convention of other _helper functions.
(&handle_texinfo_helper): Use &define_files_variable.
Move some code to use less variables.
Rename $info_cursor as $texi.
(&handle_texinfo): Do not call handle_texinfo_helper if there are
no TEXINFOS.
* lib/am/texinfos.am: Sort the occurrences of dvi, info, pdf, ps
and html.
Remove *-recursive targets from .PHONY, they are part of
$(RECURSIVE_TARGETS) anyway.
(install-info, mostlyclean-aminfo): Are .PHONY.

Makefile.in
automake.in
lib/Automake/Makefile.in
lib/Automake/VarDef.pm
lib/Automake/Variable.pm
lib/Makefile.in

index 4938592..4cc1303 100644 (file)
@@ -67,11 +67,12 @@ TEXINFOS = automake.texi
 TEXI2DVI = texi2dvi
 TEXI2PDF = $(TEXI2DVI) --pdf --batch
 DVIPS = dvips
-RECURSIVE_TARGETS = dvi-recursive html-recursive info-recursive \
-       pdf-recursive ps-recursive install-info-recursive \
-       uninstall-info-recursive all-recursive install-data-recursive \
-       install-exec-recursive installdirs-recursive install-recursive \
-       uninstall-recursive check-recursive installcheck-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-exec-recursive install-info-recursive \
+       install-recursive installcheck-recursive installdirs-recursive \
+       pdf-recursive ps-recursive uninstall-info-recursive \
+       uninstall-recursive
 ETAGS = etags
 ETAGSFLAGS = 
 CTAGS = ctags
index d331fa2..ded8717 100755 (executable)
@@ -1278,7 +1278,7 @@ sub generate_makefile
     &handle_man_pages;
     &handle_data;
     &handle_headers;
-    &handle_subdirs;
+    handle_subdirs;
     &handle_tags;
     &handle_minor_options;
     &handle_tests;
@@ -3714,8 +3714,10 @@ sub handle_dist
 }
 
 
+# &handle_subdirs ()
+# ------------------
 # Handle subdirectories.
-sub handle_subdirs
+sub handle_subdirs ()
 {
   my $subdirs = var ('SUBDIRS');
   return
@@ -3768,7 +3770,7 @@ sub handle_subdirs
     }
 
   $output_rules .= &file_contents ('subdirs', new Automake::Location);
-  rvar ('RECURSIVE_TARGETS')->rdef (TRUE)->{'pretty'} = VAR_PRETTY; # Gross!
+  rvar ('RECURSIVE_TARGETS')->rdef (TRUE)->{'pretty'} = VAR_SORTED; # Gross!
 }
 
 
index fd7fde7..155b21f 100644 (file)
@@ -49,11 +49,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = dvi-recursive html-recursive info-recursive \
-       pdf-recursive ps-recursive install-info-recursive \
-       uninstall-info-recursive all-recursive install-data-recursive \
-       install-exec-recursive installdirs-recursive install-recursive \
-       uninstall-recursive check-recursive installcheck-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-exec-recursive install-info-recursive \
+       install-recursive installcheck-recursive installdirs-recursive \
+       pdf-recursive ps-recursive uninstall-info-recursive \
+       uninstall-recursive
 am__installdirs = $(DESTDIR)$(perllibdir)
 dist_perllibDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(dist_perllib_DATA)
index 1c57694..7fb53e6 100644 (file)
@@ -24,7 +24,7 @@ require Exporter;
 use vars '@ISA', '@EXPORT';
 @ISA = qw/Exporter/;
 @EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE
-             &VAR_ASIS &VAR_PRETTY &VAR_SILENT);
+             &VAR_ASIS &VAR_PRETTY &VAR_SILENT &VAR_SORTED);
 
 =head1 NAME
 
@@ -87,11 +87,13 @@ use constant VAR_AUTOMAKE => 0; # Variable defined by Automake.
 use constant VAR_CONFIGURE => 1;# Variable defined in configure.ac.
 use constant VAR_MAKEFILE => 2; # Variable defined in Makefile.am.
 
-=item C<VAR_ASIS>, C<VAR_PRETTY>, C<VAR_SILENT>
+=item C<VAR_ASIS>, C<VAR_PRETTY>, C<VAR_SILENT>, C<VAR_SORTED>
 
-Possible print styles.  C<VAR_ASIS> variable should be output as-is.
-C<VAR_PRETTY> variable are wrapped on multiple lines if they cannot
-fit on one.  Finally, C<VAR_SILENT> variable are not output at all.
+Possible print styles.  C<VAR_ASIS> variables should be output as-is.
+C<VAR_PRETTY> variables are wrapped on multiple lines if they cannot
+fit on one.  C<VAR_SILENT> variables are not output at all.  Finally,
+C<VAR_SORTED> variables should be sorted and then handled as
+C<VAR_PRETTY> variables.
 
 C<VAR_SILENT> variables can also be overridden silently (unlike the
 other kinds of variables whose overridding may sometimes produce
@@ -104,6 +106,7 @@ use constant VAR_ASIS => 0; # Output as-is.
 use constant VAR_PRETTY => 1;  # Pretty printed on output.
 use constant VAR_SILENT => 2;  # Not output.  (Can also be
                                # overridden silently.)
+use constant VAR_SORTED => 3;  # Sorted and pretty-printed.
 
 =back
 
@@ -131,8 +134,8 @@ C<VAR_AUTOMAKE>, C<VAR_CONFIGURE>, or C<VAR_MAKEFILE> (see these
 definitions).
 
 Finally, C<$pretty> tells how the variable should be output, and can
-be one of C<VAR_ASIS>, C<VAR_PRETTY>, or C<VAR_SILENT> (see these
-definitions).
+be one of C<VAR_ASIS>, C<VAR_PRETTY>, or C<VAR_SILENT>, or
+C<VAR_SORTED> (see these definitions).
 
 =cut
 
index fd02f5c..cb257b8 100644 (file)
@@ -630,7 +630,14 @@ sub output ($@)
       my $equals = $def->type eq ':' ? ':=' : '=';
       my $str = $cond->subst_string;
 
-      if ($def->pretty == VAR_PRETTY)
+
+      if ($def->pretty == VAR_ASIS)
+       {
+         my $output_var = "$name $equals $val";
+         $output_var =~ s/^/$str/meg;
+         $res .= "$output_var\n";
+       }
+      elsif ($def->pretty == VAR_PRETTY)
        {
          # Suppress escaped new lines.  &makefile_wrap will
          # add them back, maybe at other places.
@@ -638,11 +645,13 @@ sub output ($@)
          $res .= makefile_wrap ("$str$name $equals", "$str\t",
                                 split (' ' , $val));
        }
-      else                     # VAR_ASIS
+      else # ($def->pretty == VAR_SORTED)
        {
-         my $output_var = "$name $equals $val";
-         $output_var =~ s/^/$str/meg;
-         $res .= "$output_var\n";
+         # Suppress escaped new lines.  &makefile_wrap will
+         # add them back, maybe at other places.
+         $val =~ s/\\$//mg;
+         $res .= makefile_wrap ("$str$name $equals", "$str\t",
+                                sort (split (' ' , $val)));
        }
     }
   return $res;
@@ -934,10 +943,10 @@ assignment.
 C<$where>: the C<Location> of the assignment.
 
 C<$pretty>: whether C<$value> should be pretty printed (one of
-C<VAR_ASIS>, C<VAR_PRETTY>, or C<VAR_SILENT>, defined by by
-L<Automake::VarDef>).  C<$pretty> applies only to real assignments.
-I.e., it doesn't apply to a C<+=> assignment (except when part of it
-is being done as a conditional C<=> assignment).
+C<VAR_ASIS>, C<VAR_PRETTY>, C<VAR_SILENT>, or C<VAR_SORTED>, defined
+by by L<Automake::VarDef>).  C<$pretty> applies only to real
+assignments.  I.e., it does not apply to a C<+=> assignment (except
+when part of it is being done as a conditional C<=> assignment).
 
 This function will all run any hook registered with the C<hook>
 function.
@@ -955,9 +964,10 @@ sub define ($$$$$$$$)
     unless ref $where;
 
   prog_error "pretty argument missing"
-    unless defined $pretty && ($pretty == VAR_PRETTY
-                              || $pretty == VAR_ASIS
-                              || $pretty == VAR_SILENT);
+    unless defined $pretty && ($pretty == VAR_ASIS
+                              || $pretty == VAR_PRETTY
+                              || $pretty == VAR_SILENT
+                              || $pretty == VAR_SORTED);
 
   # We will adjust the owner of this variable unless told otherwise.
   my $adjust_owner = 1;
index 9a25173..dc51c9f 100644 (file)
@@ -52,11 +52,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = dvi-recursive html-recursive info-recursive \
-       pdf-recursive ps-recursive install-info-recursive \
-       uninstall-info-recursive all-recursive install-data-recursive \
-       install-exec-recursive installdirs-recursive install-recursive \
-       uninstall-recursive check-recursive installcheck-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-exec-recursive install-info-recursive \
+       install-recursive installcheck-recursive installdirs-recursive \
+       pdf-recursive ps-recursive uninstall-info-recursive \
+       uninstall-recursive
 am__installdirs = $(DESTDIR)$(pkgvdatadir) $(DESTDIR)$(scriptdir)
 dist_pkgvdataDATA_INSTALL = $(INSTALL_DATA)
 dist_scriptDATA_INSTALL = $(INSTALL_DATA)