texi: info files can be generated in the builddir
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 3 Apr 2012 20:02:55 +0000 (22:02 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 1 Jan 2013 22:54:36 +0000 (23:54 +0100)
commit36ee783a1000b5a1e52b81e5564de19ffb99fd37
tree825013e347a868956e629e865dcc0c04e1788959
parent2af1069b3b49c9fb72cf1a868fc76502096a99a5
texi: info files can be generated in the builddir

User can now ask info files to be built in the $(builddir), rather than
the $(srcdir), by specifying the Automake option 'info-in-builddir'.
This feature was requested by the developers of GCC, GDB, GNU binutils
and the GNU bfd library.  See the extensive discussion about automake
bug#11034 for more details.

OK, to be honest, having '.info' files built in the builddir was
*already* possible, but only using ugly and undocumented hacks involving
definition of the CLEANFILES and/or DISTCLEANFILES.  For example, the
binutils project did something like this in the relevant 'Makefile.am':

    # Automake 1.9 will only build info files in the objdir if they are
    # mentioned in DISTCLEANFILES.  It doesn't have to be unconditional,
    # though, so we use a bogus condition.
    if GENINSRC_NEVER
    DISTCLEANFILES = binutils.info
    endif

See also the extensive discussion about automake bug#11034; in
particular, the following messages:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11034#65>
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11034#80>
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11034#86>
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11034#101>

* lib/Automake/Options.pm (_is_valid_easy_option): Recognize the
new 'info-in-builddir' option.
* automake.in (handle_texinfo_helper): If that option is set,
initialize '$insrc' to '0', so that info files will be generated
in the builddir.  Adjust comments to match.
* t/txinfo-builddir.sh: New test.
* t/list-of-tests.mk: Add it.
* NEWS: Update.
* doc/automake.texi: Document the new options.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NEWS
automake.in
doc/automake.texi
lib/Automake/Options.pm
t/list-of-tests.mk
t/txinfo-builddir.sh [new file with mode: 0755]