2
0

distcheck-hook2.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. # Check that no 'distcheck-hook' target is created automatically by
  17. # Automake, and that a used-defined 'distcheck-hook' is *not* honored
  18. # in a subpackage Makefile.am.
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_CONFIG_SUBDIRS([subpkg])
  22. AC_OUTPUT
  23. END
  24. mkdir subpkg
  25. cat > subpkg/configure.ac << 'END'
  26. AC_INIT([subpkg], [1.0])
  27. AM_INIT_AUTOMAKE
  28. AC_CONFIG_FILES([Makefile])
  29. AC_OUTPUT
  30. END
  31. cat > Makefile.am <<'END'
  32. distcheck-hook:
  33. ls -l $(distdir)
  34. chmod u+w $(distdir)
  35. : > $(distdir)/dc-hook-has-run
  36. chmod a-w $(distdir)
  37. check-local:
  38. ls -l $(srcdir)
  39. test -f $(srcdir)/dc-hook-has-run
  40. END
  41. cat > subpkg/Makefile.am <<'END'
  42. check-local:
  43. ls -l $(srcdir)
  44. test ! -r $(srcdir)/dc-hook-has-run
  45. END
  46. $ACLOCAL
  47. $AUTOMAKE
  48. $AUTOCONF
  49. cd subpkg
  50. $ACLOCAL
  51. $AUTOMAKE
  52. $AUTOCONF
  53. cd ..
  54. # For debugging.
  55. $FGREP 'distcheck-hook' Makefile.in subpkg/Makefile.in
  56. $FGREP 'distcheck-hook' subpkg/Makefile.in && exit 1
  57. $FGREP '$(MAKE) $(AM_MAKEFLAGS) distcheck-hook' Makefile.in
  58. grep '^distcheck-hook:' Makefile.in
  59. ./configure
  60. $MAKE
  61. $MAKE check && exit 1
  62. cd subpkg
  63. $MAKE check
  64. cd ..
  65. $MAKE distcheck
  66. :