extra-dist-vpath-dir-merge.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 to make sure that when distdir is invoked in a VPATH
  17. # configuration and has to distribute directory X, it actually merge
  18. # $(srcdir)/X and ./X, with the files from the later overriding the
  19. # files from the former.
  20. . test-init.sh
  21. echo AC_OUTPUT >> configure.ac
  22. cat > Makefile.am << 'END'
  23. EXTRA_DIST=foo/bar baz
  24. check: distdir
  25. test -f $(distdir)/foo/bar/baz
  26. test -f $(distdir)/foo/bar/baz2
  27. test -f $(distdir)/baz/foo
  28. test -f $(distdir)/baz/foo2
  29. grep source $(distdir)/foo/bar/baz
  30. grep build $(distdir)/foo/bar/baz2
  31. grep source $(distdir)/baz/foo
  32. grep build $(distdir)/baz/foo2
  33. END
  34. # Create some files in $(srcdir)
  35. mkdir foo
  36. mkdir foo/bar
  37. echo source > foo/bar/baz
  38. echo source > foo/bar/baz2
  39. mkdir baz
  40. echo source > baz/foo
  41. echo source > baz/foo2
  42. $ACLOCAL
  43. $AUTOMAKE
  44. $AUTOCONF
  45. mkdir build
  46. cd build
  47. ../configure
  48. # Create some files in $(builddir) that will override part of the
  49. # files if $(srcdir) when the distribution is made.
  50. mkdir foo
  51. mkdir foo/bar
  52. echo build > foo/bar/baz2
  53. mkdir baz
  54. echo build > baz/foo2
  55. $MAKE check
  56. :