automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: don't use single suffix inference rules for .info-less Info files


From: Alexandre Duret-Lutz
Subject: FYI: don't use single suffix inference rules for .info-less Info files
Date: Sat, 30 Nov 2002 14:10:03 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/20.7 (i386-debian-linux-gnu)

I'm checking this in (on HEAD & branch-1-7).

2002-11-30  Alexandre Duret-Lutz  <address@hidden>

        * tests/texinfo3.test: Make sure we don't output single suffix
        inference rules when building `.info'-less Info files (this
        confuses Solaris make).  Run distcheck to make sure the rules
        work.
        * automake.in (output_texinfo_build_rules): Define GENERIC_INFO
        and SOURCE_INFO.
        * lib/am/texibuild.am (%SOURCE_SUFFIX%%DEST_SUFFIX%,
        %DEST_PREFIX%%DEST_SUFFIX%): Honor GENERIC_INFO and SOURCE_INFO.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1365.2.14
diff -u -r1.1365.2.14 automake.in
--- automake.in 29 Nov 2002 21:53:55 -0000      1.1365.2.14
+++ automake.in 30 Nov 2002 13:03:53 -0000
@@ -3732,14 +3732,28 @@
       $makeinfoflags = "-I $sdir -I \$(srcdir)/$sdir";
     }
 
+  # 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;
+
   # If the resulting file lie into a subdirectory,
   # make sure this directory will exist.
   my $dirstamp = require_build_directory_maybe ($dest);
 
   $output_rules .= &file_contents ('texibuild',
                                    GENERIC       => $generic,
+                                   GENERIC_INFO  => $generic_info,
                                    SOURCE_SUFFIX => $ssfx,
                                    SOURCE => ($generic ? '$<' : $source),
+                                   SOURCE_INFO   => ($generic_info ?
+                                                    '$<' : $source),
                                    SOURCE_REAL   => $source,
                                    DEST_PREFIX   => $dpfx,
                                    DEST_SUFFIX   => $dsfx,
Index: lib/am/texibuild.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texibuild.am,v
retrieving revision 1.10.2.1
diff -u -r1.10.2.1 texibuild.am
--- lib/am/texibuild.am 10 Oct 2002 00:45:04 -0000      1.10.2.1
+++ lib/am/texibuild.am 30 Nov 2002 13:03:54 -0000
@@ -18,8 +18,8 @@
 ## 02111-1307, USA.
 
 
-?GENERIC?%SOURCE_SUFFIX%%DEST_SUFFIX%:
-?!GENERIC?%DEST_PREFIX%%DEST_SUFFIX%: %SOURCE% %DEPS%
+?GENERIC_INFO?%SOURCE_SUFFIX%%DEST_SUFFIX%:
+?!GENERIC_INFO?%DEST_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
 ## Note that we also remove the possible output files before running
 ## makeinfo.  Otherwise, if the texinfo file shrinks (or if you start
 ## using --no-split), you'll be left with some dead info files lying
@@ -31,7 +31,7 @@
 ## Therefore we ensure that %DIRSTAMP% exists in the rule.
 ?DIRSTAMP?     @test -f %DIRSTAMP% || $(MAKE) %DIRSTAMP%
        $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-        -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+        -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%
 
 ?GENERIC?%SOURCE_SUFFIX%.dvi:
 ?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
@@ -56,8 +56,10 @@
 ## If we are using the generic rules, we need separate dependencies.
 ## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
 ## rules.)
-if %?GENERIC%
+if %?GENERIC_INFO%
 %DEST_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
+endif %?GENERIC_INFO%
+if %?GENERIC%
 %DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
 %DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
 endif %?GENERIC%
Index: tests/texinfo3.test
===================================================================
RCS file: /cvs/automake/automake/tests/texinfo3.test,v
retrieving revision 1.4
diff -u -r1.4 texinfo3.test
--- tests/texinfo3.test 8 Sep 2002 13:07:56 -0000       1.4
+++ tests/texinfo3.test 30 Nov 2002 13:03:55 -0000
@@ -20,19 +20,36 @@
 
 # Test to make sure .info-less @setfilename works.
 
+required='makeinfo tex'
 . ./defs || exit 1
 
 set -e
 
+echo AC_OUTPUT >> configure.in
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
 END
 
-echo '@setfilename textutils' > textutils.texi
-: > texinfo.tex
+cat > textutils.texi <<EOF
+\input texinfo
address@hidden textutils
address@hidden main
address@hidden Top
+Hello walls.
address@hidden
+EOF
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOCONF
+$AUTOMAKE --add-missing
 
 grep '^INFO_DEPS.*textutils$' Makefile.in
-grep '^.texi:$' 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

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]