dist-missing-am.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #! /bin/sh
  2. # Copyright (C) 2011-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. # The stub rules emitted to work around the "deleted header problem"
  17. # for '.am' files shouldn't prevent "make" from diagnosing a missing
  18. # required '.am' file from a distribution tarball.
  19. # See discussion about automake bug#9768.
  20. . test-init.sh
  21. echo AC_OUTPUT >> configure.ac
  22. cat > Makefile.am <<'END'
  23. include $(srcdir)/foobar.am
  24. include $(srcdir)/zardoz.am
  25. END
  26. : > foobar.am
  27. : > zardoz.am
  28. $ACLOCAL
  29. $AUTOCONF
  30. $AUTOMAKE
  31. ./configure
  32. # A faulty distribution tarball, with a required '.am' file missing.
  33. # Building from it should fail, both for in-tree and VPATH builds.
  34. ocwd=$(pwd) || fatal_ "cannot get current working directory"
  35. for vpath in false :; do
  36. $MAKE distdir
  37. test -f $distdir/zardoz.am # Sanity check.
  38. rm -f $distdir/zardoz.am
  39. if $vpath; then
  40. # We can't just build in a subdirectory of $distdir, otherwise
  41. # we'll hit automake bug#10111.
  42. mkdir vpath-distcheck
  43. cd vpath-distcheck
  44. ../$distdir/configure
  45. else
  46. cd $distdir
  47. ./configure
  48. fi
  49. run_make -e FAIL -M
  50. # This error comes from automake, not make, so we can be stricter
  51. # in our grepping of it.
  52. grep 'cannot open.*zardoz\.am' output
  53. grep 'foobar\.am' output && exit 1 # No spurious error, please.
  54. cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory"
  55. done
  56. :