From: Akim Demaille Date: Sun, 6 Jul 2003 19:27:29 +0000 (+0000) Subject: * automake.in (&define_files_variable): New. X-Git-Tag: Release-1-7b~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d23e68215c6c6bd2cd9deb4df74b86a54fbe70e6;p=thirdparty%2Fautomake.git * automake.in (&define_files_variable): New. (&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. --- diff --git a/Makefile.in b/Makefile.in index 493859207..4cc1303a3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/automake.in b/automake.in index d331fa266..ded8717ae 100755 --- a/automake.in +++ b/automake.in @@ -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! } diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index fd7fde756..155b21f83 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -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) diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm index 1c576942f..7fb53e613 100644 --- a/lib/Automake/VarDef.pm +++ b/lib/Automake/VarDef.pm @@ -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, C, C +=item C, C, C, C -Possible print styles. C variable should be output as-is. -C variable are wrapped on multiple lines if they cannot -fit on one. Finally, C variable are not output at all. +Possible print styles. C variables should be output as-is. +C variables are wrapped on multiple lines if they cannot +fit on one. C variables are not output at all. Finally, +C variables should be sorted and then handled as +C variables. C 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, C, or C (see these definitions). Finally, C<$pretty> tells how the variable should be output, and can -be one of C, C, or C (see these -definitions). +be one of C, C, or C, or +C (see these definitions). =cut diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index fd02f5c77..cb257b878 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -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 of the assignment. C<$pretty>: whether C<$value> should be pretty printed (one of -C, C, or C, defined by by -L). 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, C, C, or C, defined +by by L). 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 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; diff --git a/lib/Makefile.in b/lib/Makefile.in index 9a251739d..dc51c9f65 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -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)