diff -ur -N -x 'automake.info*' -x version.texi -x stamp-vti automake-1.10.1.orig/automake.in automake-1.10.1/automake.in --- automake-1.10.1.orig/automake.in 2008-02-19 18:07:41.000000000 +0100 +++ automake-1.10.1/automake.in 2008-03-08 00:10:34.000000000 +0100 @@ -3363,27 +3363,39 @@ # Find all the sections in use. We do this by first looking for # "standard" sections, and then looking for any additional # sections used in man_MANS. - my (%sections, %vlist); + my (%sections, %notrans_sections, %trans_sections, + %notrans_vars, %trans_vars, %notrans_sect_vars, %trans_sect_vars); # We handle nodist_ for uniformity. man pages aren't distributed # by default so it isn't actually very important. + foreach my $npfx ('', 'notrans_') + { foreach my $pfx ('', 'dist_', 'nodist_') { # Add more sections as needed. foreach my $section ('0'..'9', 'n', 'l') { - my $varname = $pfx . 'man' . $section . '_MANS'; + my $varname = $npfx . $pfx . 'man' . $section . '_MANS'; if (var ($varname)) { $sections{$section} = 1; $varname = '$(' . $varname . ')'; - $vlist{$varname} = 1; + if ($npfx eq 'notrans_') + { + $notrans_sections{$section} = 1; + $notrans_sect_vars{$varname} = 1; + } + else + { + $trans_sections{$section} = 1; + $trans_sect_vars{$varname} = 1; + } &push_dist_common ($varname) if $pfx eq 'dist_'; } } - my $varname = $pfx . 'man_MANS'; + my $varname = $npfx . $pfx . 'man_MANS'; my $var = var ($varname); if ($var) { @@ -3393,28 +3405,87 @@ if (/\.([0-9a-z])([a-z]*)$/) { $sections{$1} = 1; + if ($npfx eq 'notrans_') + { + $notrans_sections{$1} = 1; + } + else + { + $trans_sections{$1} = 1; + } } } $varname = '$(' . $varname . ')'; - $vlist{$varname} = 1; + if ($npfx eq 'notrans_') + { + $notrans_vars{$varname} = 1; + } + else + { + $trans_vars{$varname} = 1; + } &push_dist_common ($varname) if $pfx eq 'dist_'; } } + } return unless %sections; + my @unsorted_deps; + + # Build section independent variables. + my $have_notrans = %notrans_vars; + my @notrans_list = sort keys %notrans_vars; + my $have_trans = %trans_vars; + my @trans_list = sort keys %trans_vars; + # Now for each section, generate an install and uninstall rule. # Sort sections so output is deterministic. foreach my $section (sort keys %sections) { + # Build section dependent variables. + my $notrans_mans = $have_notrans || exists $notrans_sections{$section}; + my $trans_mans = $have_trans || exists $trans_sections{$section}; + my (%notrans_this_sect, %trans_this_sect); + my $expr = 'man' . $section . '_MANS'; + foreach my $varname (keys %notrans_sect_vars) + { + if ($varname =~ /$expr/) + { + $notrans_this_sect{$varname} = 1; + } + } + foreach my $varname (keys %trans_sect_vars) + { + if ($varname =~ /$expr/) + { + $trans_this_sect{$varname} = 1; + } + } + my @notrans_sect_list = sort keys %notrans_this_sect; + my @trans_sect_list = sort keys %trans_this_sect; + @unsorted_deps = (keys %notrans_vars, keys %trans_vars, + keys %notrans_this_sect, keys %trans_this_sect); + my @deps = sort @unsorted_deps; $output_rules .= &file_contents ('mans', new Automake::Location, - SECTION => $section); + SECTION => $section, + DEPS => "@deps", + NOTRANS_MANS => $notrans_mans, + NOTRANS_SECT_LIST => "@notrans_sect_list", + HAVE_NOTRANS => $have_notrans, + NOTRANS_LIST => "@notrans_list", + TRANS_MANS => $trans_mans, + TRANS_SECT_LIST => "@trans_sect_list", + HAVE_TRANS => $have_trans, + TRANS_LIST => "@trans_list"); } - my @mans = sort keys %vlist; + @unsorted_deps = (keys %notrans_vars, keys %trans_vars, + keys %notrans_sect_vars, keys %trans_sect_vars); + my @mans = sort @unsorted_deps; $output_vars .= file_contents ('mans-vars', new Automake::Location, MANS => "@mans"); diff -ur -N -x 'automake.info*' -x version.texi -x stamp-vti automake-1.10.1.orig/lib/am/mans.am automake-1.10.1/lib/am/mans.am --- automake-1.10.1.orig/lib/am/mans.am 2008-02-20 09:38:10.000000000 +0100 +++ automake-1.10.1/lib/am/mans.am 2008-03-08 00:10:55.000000000 +0100 @@ -29,19 +29,50 @@ ?INSTALL-MAN?install-data-am: install-man ?INSTALL-MAN?am__installdirs += "$(DESTDIR)$(man%SECTION%dir)" .PHONY install-man: install-man%SECTION% -install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS) +install-man%SECTION%: %DEPS% @$(NORMAL_INSTALL) test -z "$(man%SECTION%dir)" || $(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" - @list='$(man%SECTION%_MANS) $(dist_man%SECTION%_MANS) $(nodist_man%SECTION%_MANS)'; \ -## Extract all items from man_MANS that should go in this section. +if %?NOTRANS_MANS% +## Handle MANS with notrans_ prefix + @list='%NOTRANS_SECT_LIST%'; \ +## Extract all items from notrans_man_MANS that should go in this section. ## This must be done dynamically to support conditionals. - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ +?HAVE_NOTRANS? l2='%NOTRANS_LIST%'; \ +?HAVE_NOTRANS? for i in $$l2; do \ +?HAVE_NOTRANS? case "$$i" in \ ## Have to accept files like `foo.1c'. - *.%SECTION%*) list="$$list $$i" ;; \ +?HAVE_NOTRANS? *.%SECTION%*) list="$$list $$i" ;; \ +?HAVE_NOTRANS? esac; \ +?HAVE_NOTRANS? done; \ + for i in $$list; do \ +## Find the file. + if test -f $$i; then file=$$i; \ + else file=$(srcdir)/$$i; fi; \ +## Change the extension if needed. + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + %SECTION%*) ;; \ + *) ext='%SECTION%' ;; \ esac; \ - done; \ +## Extract basename of man page and append extension. + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ + done +endif %?NOTRANS_MANS% +if %?TRANS_MANS% +## Handle MANS without notrans_ prefix + @list='%TRANS_SECT_LIST%'; \ +## Extract all items from man_MANS that should go in this section. +## This must be done dynamically to support conditionals. +?HAVE_TRANS? l2='%TRANS_LIST%'; \ +?HAVE_TRANS? for i in $$l2; do \ +?HAVE_TRANS? case "$$i" in \ +## Have to accept files like `foo.1c'. +?HAVE_TRANS? *.%SECTION%*) list="$$list $$i" ;; \ +?HAVE_TRANS? esac; \ +?HAVE_TRANS? done; \ for i in $$list; do \ ## Find the file. if test -f $$i; then file=$$i; \ @@ -60,6 +91,7 @@ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ done +endif %?TRANS_MANS% ## -------------- ## @@ -72,16 +104,44 @@ .PHONY uninstall-man: uninstall-man%SECTION% uninstall-man%SECTION%: @$(NORMAL_UNINSTALL) - @list='$(man%SECTION%_MANS) $(dist_man%SECTION%_MANS) $(nodist_man%SECTION%_MANS)'; \ -## Extract all items from man_MANS that should go in this section. +if %?NOTRANS_MANS% +## Handle MANS with notrans_ prefix + @list='%NOTRANS_SECT_LIST%'; \ +## Extract all items from notrans_man_MANS that should go in this section. ## This must be done dynamically to support conditionals. - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ +?HAVE_NOTRANS? l2='%NOTRANS_LIST%'; \ +?HAVE_NOTRANS? for i in $$l2; do \ +?HAVE_NOTRANS? case "$$i" in \ ## Have to accept files like `foo.1c'. - *.%SECTION%*) list="$$list $$i" ;; \ +?HAVE_NOTRANS? *.%SECTION%*) list="$$list $$i" ;; \ +?HAVE_NOTRANS? esac; \ +?HAVE_NOTRANS? done; \ + for i in $$list; do \ +## Change the extension if needed. + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + %SECTION%*) ;; \ + *) ext='%SECTION%' ;; \ esac; \ - done; \ +## Extract basename of man page and append extension. + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ + done +endif %?NOTRANS_MANS% +if %?TRANS_MANS% +## Handle MANS without notrans_ prefix + @list='%TRANS_SECT_LIST%'; \ +## Extract all items from man_MANS that should go in this section. +## This must be done dynamically to support conditionals. +?HAVE_TRANS? l2='%TRANS_LIST%'; \ +?HAVE_TRANS? for i in $$l2; do \ +?HAVE_TRANS? case "$$i" in \ +## Have to accept files like `foo.1c'. +?HAVE_TRANS? *.%SECTION%*) list="$$list $$i" ;; \ +?HAVE_TRANS? esac; \ +?HAVE_TRANS? done; \ for i in $$list; do \ ## Change the extension if needed. ext=`echo $$i | sed -e 's/^.*\\.//'`; \ @@ -97,3 +157,4 @@ echo " rm -f '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ done +endif %?TRANS_MANS%