automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] conditional info_TEXINFOS, updated


From: Ralf Wildenhues
Subject: Re: [PATCH] conditional info_TEXINFOS, updated
Date: Fri, 30 Mar 2007 02:04:43 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hi Paolo,

Thanks for your work on this, and apologies for the delay.

* Paolo Bonzini wrote on Mon, Mar 12, 2007 at 06:36:33PM CET:
> Ok, here's the patch I sent a month ago together with new
> testcases.

Hmm.  Normal TEXINFOS are distributed by default (even their .info files
are).  It strikes me a bit odd not to distribute conditional TEXINFOS
then: the condition could be depending on user wish (say, configure
option).  So it would make sense to distribute conditional TEXINFOS as
well, and only not distribute nodist_info_TEXINFOS (conditional or not).

But then I'm not so sure any more where the info files should be built:
in the source tree or the build tree?  (Is a notion of generated info
files needed?  Probably not, but the longish comment in
handle_texinfo_helper has quite something to digest)

More, should dvi, pdf, ps, html targets build from all or only the
conditioned TEXINFOS?  Right now all will be tried, but since the texi
files aren't distributed, distcheck will fail.

At the end is an expanded, but unfinished test file that exposes a
couple of these questions.  Also, find a patch nit below.

The more I think about this, the more it looks like this belongs in HEAD
rather than branch-1-10, too: it's a new feature, IMVHO.

Cheers,
Ralf

> 2007-03-12  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 emit TEXINFOS.
>       (append_pretty_variable): New.
>       (push_dist_common): Use it.
>       * automake.in (output_texinfo_build_rules): Add COND parameter.
>       * 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       12 Mar 2007 17:35:10 -0000

> @@ -5859,6 +5874,21 @@ sub cond_stack_endif ($$$)
>  ## ------------------------ ##
>  
>  
> +# &append_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
> +# -----------------------------------------------------

This is similar to define_pretty_variable, so IMVHO it should be
described as that plus differences; that's more concise.

> +# Like define_variable, but the value is a list, and the variable may
> +# be defined conditionally.  The second argument is the Condition
> +# under which the value should be defined; this should be the empty
> +# string to define the variable unconditionally.  The third argument
> +# is a list holding the values to use for the variable.  The value is
> +# pretty printed in the output file.  Can be invoked multiple times.
> +sub append_pretty_variable ($$$@)
> +{
> +    my ($var, $cond, $where, @value) = @_;
> +    Automake::Variable::define ($var, VAR_AUTOMAKE, '+', $cond, "@value",
> +                             '', $where, VAR_PRETTY);
> +}
> +
>  # &define_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
>  # -----------------------------------------------------
>  # Like define_variable, but the value is a list, and the variable may


--- snip tests/condinfo.test ---
#! /bin/sh
# Copyright (C) 2007  Free Software Foundation, Inc.
#
# 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 conditional info_TEXINFOS.
required='makeinfo tex texi2dvi-o'
. ./defs || exit 1

cat >> configure.in << 'END'
AM_CONDITIONAL([NO], [test yes = "$buildalltexis"])
AM_CONDITIONAL([YES], [true])
AC_OUTPUT
END

cat > Makefile.am << 'END'
info_TEXINFOS =
nodist_info_TEXINFOS =
if YES
info_TEXINFOS += baz.texi
endif
if NO
info_TEXINFOS += foo.texi
endif
if YES
info_TEXINFOS += bar.texi
endif
if NO
nodist_info_TEXINFOS += absent.texi
endif
END

cat >foo.texi <<'END'
\input texinfo
@setfilename foo.info
@settitle foo
@node Top
This should not be generated.
@bye
END

cat >bar.texi <<'END'
\input texinfo
@setfilename bar.info
@settitle bar
@node Top
This should be generated.
@bye
END

cat >baz.texi <<'END'
\input texinfo
@setfilename baz.info
@settitle baz
@node Top
This should also be generated.
@bye
END

cat >absent.texi <<'END'
\input texinfo
@setfilename absent.info
@settitle absent
@node Top
This will be removed.
@bye
END

$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
./configure
$MAKE

mv absent.texi absent.bak

$MAKE info
if test -f foo.info; then exit 1; else :; fi
test -f bar.info && rm -f bar.info
test -f baz.info && rm -f baz.info

$MAKE bar.info
$MAKE baz.info

mv absent.bak absent.texi
$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS=buildalltexis=yes




reply via email to

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