txinfo-info-in-srcdir.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #! /bin/sh
  2. # Copyright (C) 2002-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Check that info files are normally built in $(srcdir),
  17. # not in $(builddir).
  18. required='makeinfo tex texi2dvi'
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_OUTPUT
  22. END
  23. cat > Makefile.am << 'END'
  24. info_TEXINFOS = main.texi
  25. END
  26. cat > main.texi << 'END'
  27. \input texinfo
  28. @setfilename main.info
  29. @settitle main
  30. @node Top
  31. Hello walls.
  32. @include version.texi
  33. @bye
  34. END
  35. $ACLOCAL
  36. $AUTOMAKE --add-missing
  37. $AUTOCONF
  38. mkdir build
  39. cd build
  40. ../configure
  41. $MAKE
  42. test -f ../main.info
  43. test ! -e main.info
  44. test -f ../stamp-vti
  45. test ! -e stamp-vti
  46. test -f ../version.texi
  47. test ! -e version.texi
  48. cd ..
  49. rm -rf build make.info* stamp-vti version.texi
  50. ./configure
  51. $MAKE
  52. test -f main.info
  53. # Make sure stamp-vti is older that version.texi.
  54. # (A common situation in a real tree.)
  55. # This is needed to test the "subtle" issue described below.
  56. test -f stamp-vti
  57. test -f version.texi
  58. $sleep
  59. touch stamp-vti
  60. $MAKE distclean
  61. test -f stamp-vti
  62. test -f version.texi
  63. mkdir build
  64. cd build
  65. ../configure
  66. $MAKE
  67. # main.info should not be rebuilt in the current directory, since
  68. # it's up-to-date in $(srcdir).
  69. # This can be caused by a subtle issue related to VPATH handling
  70. # of version.texi (see also the comment in texi-vers.am): because
  71. # stamp-vti is newer than version.texi, the 'version.texi: stamp-vti'
  72. # rule is always triggered. Still that's not a reason for 'make'
  73. # to think 'version.texi' has been created...
  74. test ! -e main.info
  75. $MAKE dvi
  76. test -f main.dvi
  77. $MAKE distcheck
  78. :