automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] conditional info_TEXINFOS


From: Ralf Wildenhues
Subject: Re: [PATCH] conditional info_TEXINFOS
Date: Sat, 10 Feb 2007 13:23:58 +0100

Hello Paolo, Thanks for your patch, and apologies for the delay.
* Paolo Bonzini wrote on Tue, Jan 30, 2007 at 12:41:57PM CET:
The attached patch allows one to have conditional info_TEXINFOS values. This is required by GCC (see http://gcc.gnu.org/PR30546 for info).

The change needs a NEWS entry:
Automake is now able to handle conditional info_TEXINFOS.
I checked that the patch does not have any change on the automake makefiles themselves, besides passing the testsuite with a new test.

Ok for mainline *and* branch 1.9
since GCC is not quite ready to jump to autoconf 2.60?

Is it easy to describe or see what's missing for GCC to do the move?
Note Alexandre mentioned he did not want any more 1.9 releases.
But I guess if this goes in HEAD then it should probably also go in
branch-1-10 at least.
Small nits inline.  Otherwise I cannot find problems with this patch.
I'd prefer if Alexandre decided, though.
Cheers,
Ralf
2007-01-30 Paolo Bonzini <address@hidden>
        * automake.in (output_texinfo_build_rules): Add COND parameter.
        Emit INFO_DEPS and TEXINFOS.
        (handle_texinfo_helper): Remove references to dead variable
        info_deps_list.  Collect conditions for info_texinfos files and
        pass it to output_texinfo_build_rules.  Don't use TRUE as the location
        where mdate-sh or texinfo.tex are required.  Don't emit TEXINFOS.
        * automake.in (output_texinfo_build_rules): Add COND parameter.

Duplicate line in ChangeLog entry.
        * lib/am/texibuild.am (INFODEPS): Don't emit it.
        * tests/Makefile.am (TESTS): Add condinfo.test.
* tests/condinfo.test: New test.
Index: automake.in
===================================================================
RCS file: /sources/automake/automake/automake.in,v
retrieving revision 1.1641
diff -u -p -r1.1641 automake.in
--- automake.in 16 Oct 2006 05:24:17 -0000      1.1641
+++ automake.in 30 Jan 2007 11:24:36 -0000
@@ -2960,15 +2960,16 @@ sub scan_texinfo_file ($)
# ($DIRSTAMP, @CLEAN_FILES)
-# output_texinfo_build_rules ($SOURCE, $DEST, $INSRC, @DEPENDENCIES)
-# ------------------------------------------------------------------
+# output_texinfo_build_rules ($SOURCE, $DEST, $INSRC, $COND, @DEPENDENCIES)
+# -------------------------------------------------------------------------
 # SOURCE - the source Texinfo file
 # DEST - the destination Info file
-# INSRC - wether DEST should be built in the source tree
+# INSRC - whether DEST should be built in the source tree
+# COND - the conditionn under which DEST should be built

s/nn/n/
 # DEPENDENCIES - known dependencies
-sub output_texinfo_build_rules ($$$@)
+sub output_texinfo_build_rules ($$$$@)
 {
-  my ($source, $dest, $insrc, @deps) = @_;
+  my ($source, $dest, $insrc, $cond, @deps) = @_;
# Split `a.texi' into `a' and `.texi'.
   my ($spfx, $ssfx) = ($source =~ /^(.*?)(\.[^.]*)?$/);
@@ -3029,6 +3029,13 @@ sub output_texinfo_build_rules ($$$@)
my $dipfx = ($insrc ? '$(srcdir)/' : '') . $dpfx; + define_pretty_variable ('INFO_DEPS', $cond, INTERNAL, "$dipfx$dsfx");
+
+  # This next isn't strictly needed now -- the places that look here
+  # could easily be changed to look in info_TEXINFOS.  But this is
+  # probably better, in case html_TEXINFOS is ever supported.

Either s/next // or s/next /& line/.
+  define_pretty_variable ('TEXINFOS', $cond, INTERNAL, $source);
+
   $output_rules .= file_contents ('texibuild',
                                  new Automake::Location,
                                  DEPS             => "@deps",
[...]
Index: tests/condinfo.test
===================================================================
RCS file: tests/condinfo.test
diff -N tests/condinfo.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/condinfo.test 30 Jan 2007 11:24:39 -0000
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.

Make that 2007.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Test to make sure `.txi' extension works.

Replace that with `Test conditional info_TEXINFOS'.
+. ./defs || exit 1

Add 'set -e' after this line, and...
+
+cat > configure.in << 'END'
+AC_INIT(Makefile.am)
+AM_INIT_AUTOMAKE(foo,0.0)
+AC_PROG_CC
+AM_CONDITIONAL(USE_A,[test x = y])
+MAKEINFO=/bin/false
+AC_SUBST(MAKEINFO)
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+if USE_A
+info_TEXINFOS = foo.texi
+endif
+END
+
+echo @setfilename foo.info > foo.texi
+: > texinfo.tex
+
+$ACLOCAL || exit 1

...kill all the '|| exit 1' here.
+$AUTOCONF || exit 1
+$AUTOMAKE || exit 1
+./configure || exit 1
+$MAKE || exit 1
+if $MAKE foo.info; then exit 1; else :; fi

How about a test that conditional info_TEXINFOS actually work when
enabled?




reply via email to

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