bug-automake
[Top][All Lists]
Advanced

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

needs texinfo file even if a "built source"


From: Peter Muir
Subject: needs texinfo file even if a "built source"
Date: 18 Oct 2001 18:29:10 +0000

Package: automake
Version: 1.5a.20011016

PROBLEM

When using automake on a project with docbook documentation in
which texinfo files are built sources, automake gives an error
message and a non-zero return status when the texinfo files cannot
be found. When the texinfo files are created, they are not
installed or converted to info. automake must be re-run.

The non-zero exit status interferes with a normal build starting
from maintainer-clean source.



CAUSE

Texinfo files set the filename of the info file to be created
with the @setfilename macro. automake uses this filename for
INFO_DEPS and install-info. If the texinfo file is missing,
automake does not know what the resultant info file will be
called. 



SOLUTION(S)

1  Do nothing. 
   
   Maybe it is acceptable behaviour. A workaround might
   be putting the following in the bootstrap file:

      test -f hello.texi || \
        echo "@setfilename gnuhello.info" >hello.texi

2  Give a warning but a zero exit code.  (PATCH)

   Change the error message
   to indicate that automake must be re-run. See patch below.

3  Temporary dependency.
   
   automake could put a dependency on the texinfo file if the
   texinfo file is not found:

     Makefile.in: hello.texi

   This dependency should be removed when automake finally finds
   the texinfo file and reads @setfilename. A minor problem
   remains: whenever @setfilename is changed, Makefile.in is out
   of date.

4  Find @setfilename at build or install time.
   
   When makeinfo runs, find the resultant info files.

5  Put the info filename in Makefile.am.

   This could be explicit or implicit, ie use same
   basename. Texinfo files will not be scanned.



TEST SUITE (WITH NEW TEST) BEFORE PATCH

...
PASS: info.test
FAIL: info2.test
...
=====================
1 of 329 tests failed
=====================



TEST SUITE AFTER PATCH

...
PASS: info.test
PASS: info2.test
...
=======================================================
All 329 tests behaved as expected (4 expected failures)
=======================================================



PATCH

tests/info.test has also been modified because it tested for a
variable (INFOS = ) no longer used.

original version: 1.5a.20011016
patched version: 1.5a.20011016-0.1
Index: debian/automake/automake.in
diff -u debian/automake/automake.in:1.1.1.10 debian/automake/automake.in:1.5.2.1
--- debian/automake/automake.in:1.1.1.10        Wed Oct 17 18:59:36 2001
+++ debian/automake/automake.in Thu Oct 18 16:33:07 2001
@@ -2957,7 +2957,15 @@
     my $texi = new IO::File ("< $filename");
     if (! $texi)
       {
-       &am_error ("couldn't open `$filename': $!");
+         if (! &variable_defined ('BUILT_SOURCES')
+             || ! grep ('/'.basename($filename).'/',
+                        &variable_value_as_list_recursive (
+                             'BUILT_SOURCES', 'all')))
+                   {
+                       &am_error ("couldn't open `$filename': $!");
+                   } else {
+                       &am_line_warning ($filename, "`$filename' not found: 
run automake after file is built");
+                   }
        return '';
     }
     print "$me: reading $filename\n" if $verbose;
Index: debian/automake/automake.texi
diff -u debian/automake/automake.texi:1.1.1.8 
debian/automake/automake.texi:1.1.1.3.2.1
--- debian/automake/automake.texi:1.1.1.8       Fri Sep 28 14:08:42 2001
+++ debian/automake/automake.texi       Thu Oct 18 16:33:08 2001
@@ -3263,6 +3263,17 @@
 here.  Any Texinfo source file must end in the @file{.texi},
 @file{.txi}, or @file{.texinfo} extension.  We recommend @file{.texi}
 for new manuals.
+
address@hidden BUILT_SOURCES
address@hidden setfilename
+
+The texinfo file must exist when automake is run. Automake scans the
+texinfo file for @code{@@setfilename gnuhello.info} in order to
+determine the file to install and to set a make dependency,
address@hidden:hello.texi}. If the texinfo file is a built source
+and a sample of the texinfo file is not available, automake must be run
+again later when a sample is available (see test @file{tests/info2.test}).
+
 @vindex TEXINFOS
 @vindex info_TEXINFOS
 
Index: debian/automake/tests/Makefile.am
diff -u debian/automake/tests/Makefile.am:1.1.1.10 
debian/automake/tests/Makefile.am:1.1.1.3.2.1
--- debian/automake/tests/Makefile.am:1.1.1.10  Wed Oct 17 18:59:41 2001
+++ debian/automake/tests/Makefile.am   Thu Oct 18 16:33:09 2001
@@ -153,6 +153,7 @@
 implicit.test \
 include.test \
 info.test \
+info2.test \
 insh.test \
 insh2.test \
 install.test \
Index: debian/automake/tests/info.test
diff -u debian/automake/tests/info.test:1.1.1.1 
debian/automake/tests/info.test:1.1.1.1.2.2
--- debian/automake/tests/info.test:1.1.1.1     Sun Sep 27 01:46:09 1998
+++ debian/automake/tests/info.test     Thu Oct 18 18:19:23 2001
@@ -16,7 +16,12 @@
 
 $AUTOMAKE || exit 1
 
-for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'`; do
+infos=`grep '^INFO_DEPS =' Makefile.in | sed -e 's/^INFO_DEPS = //'`
+
+if test -z "$infos" ; then
+  exit 1
+else
+for i in $infos ; do
    echo $i
    case "$i" in
     foo*)
@@ -26,3 +31,4 @@
        ;;
    esac
 done
+fi
Index: debian/automake/tests/info2.test
diff -u /dev/null debian/automake/tests/info2.test:1.1.2.2
--- /dev/null   Thu Oct 18 18:19:57 2001
+++ debian/automake/tests/info2.test    Thu Oct 18 18:07:15 2001
@@ -0,0 +1,47 @@
+#! /bin/sh
+
+# Test to make sure info files are distributed correctly
+# if texi file is a built source, eg from SGML, and not
+# current existing.
+# See also automake.texi.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = hello.texi
+
+magic:
+       @echo $(INFOS)
+
+BUILT_SOURCES=$(info_TEXINFOS)
+
+hello.texi:
+       echo '@setfilename gnuhello.info' > $@
+
+END
+
+: > texinfo.tex
+
+# 1.5a.20011016 returned non-zero status.
+$AUTOMAKE || exit 1
+
+echo '@setfilename gnuhello.info' > hello.texi
+
+$AUTOMAKE || exit 1
+
+infos=`grep '^INFO_DEPS =' Makefile.in | sed -e 's/^INFO_DEPS = //'`
+
+if test -z "$infos" ; then
+  exit 1
+else
+for i in $infos ; do
+   echo $i
+   case "$i" in
+    gnuhello*)
+       ;;
+    *)
+       exit 1
+       ;;
+   esac
+done
+fi

AFTER PATCH


LOCAL CONFIGURATION

Debian: woody
uname: Linux peter 2.4.9-386 #1 Mon Sep 10 19:42:35 UTC 2001 i586 unknown
kernel-image-2.4.9-386: status='install ok installed' version='2.4.9-1.3'
libc6: status='install ok installed' version='2.2.4-3'
perl-5.6: status='install ok installed' version='6.3'

-- 


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




reply via email to

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