distcom-subdir.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #! /bin/sh
  2. # Copyright (C) 2004-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. # Test to make sure that if an auxfile (here depcomp) is required
  17. # by a subdir Makefile.am, it is distributed by that Makefile.am.
  18. required=cc
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_CONFIG_FILES([subdir/Makefile])
  22. AC_PROG_CC
  23. AC_PROG_FGREP
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am << 'END'
  27. SUBDIRS = subdir
  28. test-distdir: distdir
  29. test -f $(distdir)/depcomp
  30. .PHONY: test-distdir
  31. check-local: test-distdir
  32. END
  33. rm -f depcomp
  34. mkdir subdir
  35. cat > subdir/Makefile.am << 'END'
  36. .PHONY: test-distcom
  37. test-distcom:
  38. echo ' ' $(DIST_COMMON) ' ' | $(FGREP) ' $(top_srcdir)/depcomp '
  39. END
  40. $ACLOCAL
  41. $AUTOCONF
  42. $AUTOMAKE
  43. test ! -e depcomp
  44. cat >> subdir/Makefile.am << 'END'
  45. bin_PROGRAMS = foo
  46. .PHONY: test-distcom
  47. test-distcom:
  48. echo ' ' $(DIST_COMMON) ' ' | $(FGREP) ' $(top_srcdir)/depcomp '
  49. check-local: test-distcom
  50. END
  51. cat > subdir/foo.c <<'END'
  52. int main (void)
  53. {
  54. return 0;
  55. }
  56. END
  57. $AUTOMAKE -a subdir/Makefile
  58. test -f depcomp
  59. ./configure
  60. (cd subdir && $MAKE test-distcom)
  61. $MAKE test-distdir
  62. $MAKE distcheck
  63. :