From cfde3d3ae12bf11210a68fb310f3102a911ca867 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 5 Mar 2001 18:56:44 +0000 Subject: [PATCH] Always use hashes with &file_contents. * automake.in (&handle_texinfo): texibuild.am does not need TEXINFODIR. texinfos.am wants only TEXICLEANS. (&handle_dist, &add_depend2, &handle_clean): Replace $xform with %transform. * texinfos.am: Adjust. --- ChangeLog | 11 +++++ Makefile.in | 13 +++-- automake.in | 115 ++++++++++++++++++++++----------------------- lib/am/texinfos.am | 2 +- texinfos.am | 2 +- 5 files changed, 74 insertions(+), 69 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82f85b12..5f1a145f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-03-05 Akim Demaille + + Always use hashes with &file_contents. + + * automake.in (&handle_texinfo): texibuild.am does not need + TEXINFODIR. + texinfos.am wants only TEXICLEANS. + (&handle_dist, &add_depend2, &handle_clean): Replace $xform with + %transform. + * texinfos.am: Adjust. + 2001-03-05 Akim Demaille * automake.in (&handle_programs, &handle_libraries, &handle_tags) diff --git a/Makefile.in b/Makefile.in index 66ceb427..9735471c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -85,13 +85,12 @@ bin_SCRIPTS = automake aclocal info_TEXINFOS = automake.texi amfiles = check.am clean-hdr.am clean-kr.am clean.am comp-vars.am \ -compile.am configure.am data-clean.am data.am dejagnu.am depend.am \ -depend2.am distdir.am footer.am header-vars.am header.am install.am \ -java-clean.am java.am kr-extra.am library.am libs-clean.am libs.am \ -libtool.am lisp-clean.am lisp.am ltlib-clean.am ltlib.am ltlibrary.am \ -mans-vars.am mans.am multilib.am program.am progs-clean.am progs.am \ -python-clean.am python.am remake-hdr.am remake.am scripts.am \ -subdirs.am tags-clean.am tags.am texi-vers.am texibuild.am texinfos.am +compile.am configure.am data.am dejagnu.am depend.am depend2.am \ +distdir.am footer.am header-vars.am header.am install.am java.am \ +kr-extra.am library.am libs.am libtool.am lisp.am ltlib.am \ +ltlibrary.am mans-vars.am mans.am multilib.am program.am progs.am \ +python.am remake-hdr.am remake.am scripts.am subdirs.am tags.am \ +texi-vers.am texibuild.am texinfos.am dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ diff --git a/automake.in b/automake.in index 14eab55d..18a8fe7c 100755 --- a/automake.in +++ b/automake.in @@ -2762,18 +2762,18 @@ sub handle_texinfo $need_texi_file = 1; } - my $xform = - &transform ('TEXINFODIR' => $texinfodir, - 'TEXICLEAN' => &pretty_print_internal ("\t-rm -f", - "\t ", - @texi_cleans)); foreach my $txsfx (sort keys %texi_suffixes) { - $output_rules .= &file_contents ('texibuild', - $xform - . &transform ('SUFFIX' => $txsfx)); + $output_rules .= + &file_contents ('texibuild', + &transform ('TEXINFODIR' => $texinfodir, + 'SUFFIX' => $txsfx)); } - $output_rules .= &file_contents ('texinfos', $xform); + + my $texiclean = &pretty_print_internal ("", "\t ", @texi_cleans); + $output_rules .= &file_contents ('texinfos', + &transform ('TEXICLEAN' => $texiclean)); + push (@dist_targets, 'dist-info'); push (@suffixes, '.texi', '.texinfo', '.txi', '.info', '.dvi', '.ps'); @@ -3059,15 +3059,14 @@ sub handle_dist } # Rule to check whether a distribution is viable. - my $xform = - &transform ('TOPDIR' => ($relative_dir eq '.'), - 'DISTCHECK-HOOK' => &target_defined ('distcheck-hook'), - 'GETTEXT' => $seen_gettext); + my %transform = ('TOPDIR' => ($relative_dir eq '.'), + 'DISTCHECK-HOOK' => &target_defined ('distcheck-hook'), + 'GETTEXT' => $seen_gettext); # Prepend $(distdir) to each directory given. my %rewritten; grep ($rewritten{'$(distdir)/' . $_} = 1, keys %dist_dirs); - $xform .= &transform ('DISTDIRS', join (' ', sort keys %rewritten)); + $transform{'DISTDIRS'} = join (' ', sort keys %rewritten); # If we have SUBDIRS, create all dist subdirectories and do # recursive build. @@ -3096,7 +3095,7 @@ sub handle_dist &define_pretty_variable ('DIST_SUBDIRS', '', '$(SUBDIRS)'); } - $xform .= &transform ('DIST_SUBDIR_NAME' => $dist_subdir_name); + $transform{'DIST_SUBDIR_NAME'} = $dist_subdir_name; } # If the target `dist-hook' exists, make sure it is run. This @@ -3104,15 +3103,13 @@ sub handle_dist # before it is packaged up. push (@dist_targets, 'dist-hook') if &target_defined ('dist-hook'); + $transform{'DIST-TARGETS'} = join(' ', @dist_targets); - my $top_distdir = backname ($relative_dir); + # Defining $(DISTDIR). + $transform{'DISTDIR'} = !&variable_defined('distdir'); + $transform{'TOP_DISTDIR'} = backname ($relative_dir); - $output_rules .= - &file_contents ('distdir', - $xform - . &transform ('DISTDIR' => !&variable_defined('distdir'), - 'DIST-TARGETS' => join(' ', @dist_targets), - 'TOP_DISTDIR' => $top_distdir)); + $output_rules .= &file_contents ('distdir', &transform (%transform)); } @@ -3130,10 +3127,10 @@ sub add_depend2 my $flag = $language_map{"$lang-flags"}; # First include code for ordinary objects. - my $xform = &transform ('PFX' => $pfx, - 'FPFX' => $fpfx, - 'LIBTOOL' => $seen_libtool, - 'AMDEP' => $use_dependencies); + my %transform = ('PFX' => $pfx, + 'FPFX' => $fpfx, + 'LIBTOOL' => $seen_libtool, + 'AMDEP' => $use_dependencies); # This function can be called even when we don't want dependency # tracking. This happens when we need an explicit rule for some @@ -3142,21 +3139,21 @@ sub add_depend2 { my $compile = '$(' . $pfx . 'COMPILE)'; my $ltcompile = '$(LT' . $pfx . 'COMPILE)'; - my $xform1 = ($xform - . &transform ('GENERIC' => 1, - 'BASE' => '$*', - 'SOURCE' => '$<', - 'OBJ' => '$@', - 'LTOBJ' => '$@', - 'OBJOBJ' => '$@', - 'COMPILE' => $compile, - 'LTCOMPILE' => $ltcompile)); + my %transform = (%transform, + 'GENERIC' => 1, + 'BASE' => '$*', + 'SOURCE' => '$<', + 'OBJ' => '$@', + 'LTOBJ' => '$@', + 'OBJOBJ' => '$@', + 'COMPILE' => $compile, + 'LTCOMPILE' => $ltcompile); foreach my $ext (&lang_extensions ($lang)) { $output_rules .= (&file_contents ('depend2', - &transform ('EXT' => $ext) - . $xform1) + &transform (%transform, + 'EXT' => $ext)) . "\n"); } } @@ -3183,17 +3180,16 @@ sub add_depend2 # depend2.am into real targets for the particular objects we # are building. $output_rules .= - &file_contents - ('depend2', - $xform - . &transform ('GENERIC' => 0, - 'BASE' => $obj, - 'SOURCE' => $source, - 'OBJ' => "$obj.o", - 'OBJOBJ' => "$obj.obj", - 'LTOBJ' => "$obj.lo", - 'COMPILE' => $obj_compile, - 'LTCOMPILE' => $obj_ltcompile)) + &file_contents ('depend2', + &transform (%transform, + 'GENERIC' => 0, + 'BASE' => $obj, + 'SOURCE' => $source, + 'OBJ' => "$obj.o", + 'OBJOBJ' => "$obj.obj", + 'LTOBJ' => "$obj.lo", + 'COMPILE' => $obj_compile, + 'LTCOMPILE' => $obj_ltcompile)) } } @@ -3950,13 +3946,12 @@ sub do_check_merge_target # Handle all 'clean' targets. sub handle_clean { - my $xform = ''; + my %transform; # Don't include `MAINTAINER'; it is handled specially below. foreach my $name ('MOSTLY', '', 'DIST') { - $xform .= &transform ("${name}CLEAN" - => &variable_defined ("${name}CLEANFILES")); + $transform{"${name}CLEAN"} = &variable_defined ("${name}CLEANFILES"); } # Built sources are automatically removed by maintainer-clean. @@ -3967,15 +3962,15 @@ sub handle_clean $output_rules .= &file_contents ('clean', - $xform - . &transform ('MCFILES' - # Join with no space to avoid - # spurious `test -z' success at - # runtime. - => join ('', @maintainer_clean_files), - 'MFILES' - # A space is required in the join here. - => join (' ', @maintainer_clean_files))); + &transform (%transform, + 'MCFILES' + # Join with no space to avoid + # spurious `test -z' success at + # runtime. + => join ('', @maintainer_clean_files), + 'MFILES' + # A space is required in the join here. + => join (' ', @maintainer_clean_files))); # We special-case config.status here. If we do it as part of the # normal clean processing for this directory, then it might be diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am index 95268632..5c4cf950 100644 --- a/lib/am/texinfos.am +++ b/lib/am/texinfos.am @@ -129,7 +129,7 @@ dist-info: $(INFO_DEPS) .PHONY: mostlyclean-aminfo mostlyclean-am: mostlyclean-aminfo mostlyclean-aminfo: -%TEXICLEAN% + -rm -f %TEXICLEAN% .PHONY: maintainer-clean-aminfo maintainer-clean-am: maintainer-clean-aminfo diff --git a/texinfos.am b/texinfos.am index 95268632..5c4cf950 100644 --- a/texinfos.am +++ b/texinfos.am @@ -129,7 +129,7 @@ dist-info: $(INFO_DEPS) .PHONY: mostlyclean-aminfo mostlyclean-am: mostlyclean-aminfo mostlyclean-aminfo: -%TEXICLEAN% + -rm -f %TEXICLEAN% .PHONY: maintainer-clean-aminfo maintainer-clean-am: maintainer-clean-aminfo -- 2.43.5