]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] texinfo: pattern rules with empty suffixes are OK
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 15 Jun 2012 15:15:52 +0000 (17:15 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 15 Jun 2012 15:29:49 +0000 (17:29 +0200)
So we can remove a workaround required by Solaris make from our
texinfo rules.

* automake.in (output_texinfo_build_rules): Don't define the boolean
'$generic_info' anymore.  Drop the 'SOURCE_INFO' and 'GENERIC_INFO'
transforms when processing the 'texibuild.am' file.  Remove obsolete
comments, and adjust some of the remaining ones.
* lib/am/texibuild.am: Adjust by always assuming that '?GENERIC_INFO?'
is true.
* t/txinfo3.sh: Adjust and extend.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
lib/am/texibuild.am
t/txinfo3.sh

index 83b26b8e9e072f08b694c0e81d820f9d41b75781..03d0310f109ebd083b762225723ab14d488ae090 100644 (file)
@@ -2859,10 +2859,9 @@ sub output_texinfo_build_rules ($$$@)
   $ssfx ||= "";
   $dsfx ||= "";
 
-  # We can output two kinds of rules: the "generic" rules use Make
-  # suffix rules and are appropriate when $source and $dest do not lie
-  # in a sub-directory; the "specific" rules are needed in the other
-  # case.
+  # We can output two kinds of rules: the "generic" rules use pattern
+  # rules and are appropriate when $source and $dest do not lie in a
+  # sub-directory; the "specific" rules are needed in the other case.
   #
   # The former are output only once (this is not really apparent here,
   # but just remember that some logic deeper in Automake will not
@@ -2891,20 +2890,6 @@ sub output_texinfo_build_rules ($$$@)
   # if needed.)
   $generic = 0 unless $insrc;
 
-  # We cannot use a suffix rule to build info files with an empty
-  # extension.  Otherwise we would output a single suffix inference
-  # rule, with separate dependencies, as in
-  #
-  #    .texi:
-  #             $(MAKEINFO) ...
-  #    foo.info: foo.texi
-  #
-  # which confuse Solaris make.  (See the Autoconf manual for
-  # details.)  Therefore we use a specific rule in this case.  This
-  # applies to info files only (dvi and pdf files always have an
-  # extension).
-  my $generic_info = ($generic && $dsfx) ? 1 : 0;
-
   my $dipfx = ($insrc ? '$(srcdir)/' : '') . $dpfx;
 
   $output_rules .= file_contents ('texibuild',
@@ -2917,13 +2902,10 @@ sub output_texinfo_build_rules ($$$@)
                                  DEST_INFO_PREFIX => $dipfx,
                                  DEST_SUFFIX      => $dsfx,
                                  GENERIC          => $generic,
-                                 GENERIC_INFO     => $generic_info,
                                  INSRC            => $insrc,
                                  MAKEINFOFLAGS    => $makeinfoflags,
                                  SOURCE           => ($generic
                                                       ? '$<' : $source),
-                                 SOURCE_INFO      => ($generic_info
-                                                      ? '$<' : $source),
                                  SOURCE_REAL      => $source,
                                  SOURCE_SUFFIX    => $ssfx,
                                   TEXIQUIET        => verbose_flag('texinfo'),
index 049d894fc1ea3cb3a8d45c4dbd4f703f4f67298a..735b2d87fce2b6424cca1aeb464333d2b4efd70d 100644 (file)
@@ -14,8 +14,7 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-?GENERIC_INFO?%%DEST_SUFFIX%: %%SOURCE_SUFFIX%
-?!GENERIC_INFO?%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
+%%DEST_SUFFIX%: %%SOURCE_SUFFIX%
 ?!INSRC?       @$(am__ensure_target_dir_exists)
 ## Back up the info files before running makeinfo. This is the cheapest
 ## way to ensure that
@@ -103,9 +102,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
        fi
 
 ## If we are using the generic rules, we need separate dependencies.
-if %?GENERIC_INFO%
 %DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
-endif %?GENERIC_INFO%
 if %?GENERIC%
 %DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
 %DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
index 88e1bacfe9bc0a7a9543ac578601913c0e437f0b..7363c39bded6c30794973187cb6e1d10e5f005bf 100755 (executable)
@@ -24,7 +24,10 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-info_TEXINFOS = textutils.texi
+info_TEXINFOS = textutils.texi doc/automake-ng.texi
+.PHONY: echo-info-deps
+echo-info-deps:
+       echo ' ' $(INFO_DEPS) ' '
 END
 
 cat > textutils.texi <<EOF
@@ -36,18 +39,34 @@ Hello walls.
 @bye
 EOF
 
+mkdir doc
+cat > doc/automake-ng.texi <<EOF
+\input texinfo
+@setfilename automake-ng
+@settitle automake-ng
+@node Top
+Blurb.
+@bye
+EOF
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-grep '^INFO_DEPS.*textutils$' Makefile.in
-
-# We should not use single suffix inference rules (with separate
-# dependencies), this confuses Solaris make.
-grep '^\.texi:$' Makefile.in && Exit 1
-grep 'textutils: *textutils\.texi' Makefile.in
-
 ./configure
 $MAKE distcheck
 
+$MAKE
+test -f textutils
+test -f doc/automake-ng
+test ! -f textutils.info
+test ! -f doc/automake-ng.info
+
+$MAKE distdir
+test -f $distdir/textutils
+test -f $distdir/doc/automake-ng
+
+$MAKE echo-info-deps | grep '[ /]textutils '
+$MAKE echo-info-deps | grep '[ /]doc/automake-ng '
+
 :