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-02-20 01:52:26.000000000 +0100 @@ -3363,27 +3363,38 @@ # 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, %nsections, %tsections, %nvlist, %tvlist, %nsvlist, %tsvlist); # 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_') + { + $nsections{$section} = 1; + $nsvlist{$varname} = 1; + } + else + { + $tsections{$section} = 1; + $tsvlist{$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 +3404,81 @@ if (/\.([0-9a-z])([a-z]*)$/) { $sections{$1} = 1; + if ($npfx eq 'notrans_') + { + $nsections{$1} = 1; + } + else + { + $tsections{$1} = 1; + } } } $varname = '$(' . $varname . ')'; - $vlist{$varname} = 1; + if ($npfx eq 'notrans_') + { + $nvlist{$varname} = 1; + } + else + { + $tvlist{$varname} = 1; + } &push_dist_common ($varname) if $pfx eq 'dist_'; } } + } return unless %sections; + # Build section independent variables (see mans.am). + my $notry = %nvlist; + my @notrz = sort keys %nvlist; + my $dotry = %tvlist; + my @dotrz = sort keys %tvlist; + # 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 (see mans.am). + my $notr = $notry || exists $nsections{$section}; + my $dotr = $dotry || exists $tsections{$section}; + my (%nslist, %tslist); + my $expr = 'man' . $section . '_MANS'; + foreach my $varname (keys %nsvlist) + { + if ($varname =~ /$expr/) + { + $nslist{$varname} = 1; + } + } + foreach my $varname (keys %tsvlist) + { + if ($varname =~ /$expr/) + { + $tslist{$varname} = 1; + } + } + my @notrx = sort keys %nslist; + my @dotrx = sort keys %tslist; + my @deps = sort (keys %nvlist, keys %tvlist, keys %nslist, keys %tslist); $output_rules .= &file_contents ('mans', new Automake::Location, - SECTION => $section); + SECTION => $section, + DEPS => "@deps", + NOTR => $notr, + NOTRX => "@notrx", + NOTRY => $notry, + NOTRZ => "@notrz", + DOTR => $dotr, + DOTRX => "@dotrx", + DOTRY => $dotry, + DOTRZ => "@dotrz"); } - my @mans = sort keys %vlist; + my @mans = sort (keys %nvlist, keys %tvlist, keys %nsvlist, keys %tsvlist); $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-02-20 00:50:53.000000000 +0100 @@ -16,6 +16,20 @@ ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. +## Parameters: +## SECTION string man section +## DEPS string dependencies +## +## NOTR bool have notrans_ MANS +## NOTRX string notrans_ man%SECTION%_MANS (if any) +## NOTRY bool have notrans_ man_MANS +## NOTRZ string notrans_ man_MANS +## +## DOTR bool same +## DOTRX string as above +## DOTRY bool without +## DOTRZ string notrans_ + man%SECTION%dir = $(mandir)/man%SECTION% ## ------------ ## @@ -29,37 +43,65 @@ ?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)'; \ +## Handle MANS with notrans_ prefix +?NOTR? @list='%NOTRX%'; \ +## Extract all items from notrans_man_MANS that should go in this section. +## This must be done dynamically to support conditionals. +?NOTRY? l2='%NOTRZ%'; \ +?NOTRY? for i in $$l2; do \ +?NOTRY? case "$$i" in \ +## Have to accept files like `foo.1c'. +?NOTRY? *.%SECTION%*) list="$$list $$i" ;; \ +?NOTRY? esac; \ +?NOTRY? done; \ +?NOTR? for i in $$list; do \ +## Find the file. +?NOTR? if test -f $$i; then file=$$i; \ +?NOTR? else file=$(srcdir)/$$i; fi; \ +## Change the extension if needed. +?NOTR? ext=`echo $$i | sed -e 's/^.*\\.//'`; \ +?NOTR? case "$$ext" in \ +?NOTR? %SECTION%*) ;; \ +?NOTR? *) ext='%SECTION%' ;; \ +?NOTR? esac; \ +## Extract basename of man page and append extension. +?NOTR? inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ +?NOTR? inst=`echo $$inst | sed -e 's/^.*\///'`.$$ext; \ +?NOTR? echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ +?NOTR? $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ +?NOTR? done +## Handle MANS without notrans_ prefix +?DOTR? @list='%DOTRX%'; \ ## Extract all items from 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 \ +?DOTRY? l2='%DOTRZ%'; \ +?DOTRY? for i in $$l2; do \ +?DOTRY? case "$$i" in \ ## Have to accept files like `foo.1c'. - *.%SECTION%*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ +?DOTRY? *.%SECTION%*) list="$$list $$i" ;; \ +?DOTRY? esac; \ +?DOTRY? done; \ +?DOTR? for i in $$list; do \ ## Find the file. - if test -f $$i; then file=$$i; \ - else file=$(srcdir)/$$i; fi; \ +?DOTR? if test -f $$i; then file=$$i; \ +?DOTR? else file=$(srcdir)/$$i; fi; \ ## Change the extension if needed. - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - %SECTION%*) ;; \ - *) ext='%SECTION%' ;; \ - esac; \ +?DOTR? ext=`echo $$i | sed -e 's/^.*\\.//'`; \ +?DOTR? case "$$ext" in \ +?DOTR? %SECTION%*) ;; \ +?DOTR? *) ext='%SECTION%' ;; \ +?DOTR? esac; \ ## Extract basename of man page and run it through the program rename ## transform. - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ - done +?DOTR? inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ +?DOTR? inst=`echo $$inst | sed -e 's/^.*\///'`; \ +?DOTR? inst=`echo $$inst | sed '$(transform)'`.$$ext; \ +?DOTR? echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ +?DOTR? $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ +?DOTR? done ## -------------- ## @@ -72,28 +114,53 @@ .PHONY uninstall-man: uninstall-man%SECTION% uninstall-man%SECTION%: @$(NORMAL_UNINSTALL) - @list='$(man%SECTION%_MANS) $(dist_man%SECTION%_MANS) $(nodist_man%SECTION%_MANS)'; \ +## Handle MANS with notrans_ prefix +?NOTR? @list='%NOTRX%'; \ +## Extract all items from notrans_man_MANS that should go in this section. +## This must be done dynamically to support conditionals. +?NOTRY? l2='%NOTRZ%'; \ +?NOTRY? for i in $$l2; do \ +?NOTRY? case "$$i" in \ +## Have to accept files like `foo.1c'. +?NOTRY? *.%SECTION%*) list="$$list $$i" ;; \ +?NOTRY? esac; \ +?NOTRY? done; \ +?NOTR? for i in $$list; do \ +## Change the extension if needed. +?NOTR? ext=`echo $$i | sed -e 's/^.*\\.//'`; \ +?NOTR? case "$$ext" in \ +?NOTR? %SECTION%*) ;; \ +?NOTR? *) ext='%SECTION%' ;; \ +?NOTR? esac; \ +## Extract basename of man page and append extension. +?NOTR? inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ +?NOTR? inst=`echo $$inst | sed -e 's/^.*\///'`.$$ext; \ +?NOTR? echo " rm -f '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ +?NOTR? rm -f "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ +?NOTR? done +## Handle MANS without notrans_ prefix +?DOTR? @list='%DOTRX%'; \ ## Extract all items from 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 \ +?DOTRY? l2='%DOTRZ%'; \ +?DOTRY? for i in $$l2; do \ +?DOTRY? case "$$i" in \ ## Have to accept files like `foo.1c'. - *.%SECTION%*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ +?DOTRY? *.%SECTION%*) list="$$list $$i" ;; \ +?DOTRY? esac; \ +?DOTRY? done; \ +?DOTR? for i in $$list; do \ ## Change the extension if needed. - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - %SECTION%*) ;; \ - *) ext='%SECTION%' ;; \ - esac; \ +?DOTR? ext=`echo $$i | sed -e 's/^.*\\.//'`; \ +?DOTR? case "$$ext" in \ +?DOTR? %SECTION%*) ;; \ +?DOTR? *) ext='%SECTION%' ;; \ +?DOTR? esac; \ ## Extract basename of man page and run it through the program rename ## transform. - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ - done +?DOTR? inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ +?DOTR? inst=`echo $$inst | sed -e 's/^.*\///'`; \ +?DOTR? inst=`echo $$inst | sed '$(transform)'`.$$ext; \ +?DOTR? echo " rm -f '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \ +?DOTR? rm -f "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \ +?DOTR? done