distdir.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #! /bin/sh
  2. # Copyright (C) 1996-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 subdirs in EXTRA_DIST work. Also tests to make
  17. # sure *srcdir is properly handled. Note that using './', as in
  18. # EXTRA_DIST = ./joe
  19. # does not work portably: it fails with HP-UX and Tru64 make.
  20. # Also test DISTFILES containing a directory and a file in it,
  21. # and repeated directories.
  22. . test-init.sh
  23. cat >> configure.ac << 'END'
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am << 'END'
  27. include_HEADERS = some/file another/sub/subsub/file2 yet/another/file3
  28. EXTRA_DIST = foo/bar joe $(top_srcdir)/woo/doo $(srcdir)/dada \
  29. some another/sub yet \
  30. some another/sub yet
  31. all-local:
  32. $(MKDIR_P) another/sub/subsub
  33. touch another/sub/subsub/file2
  34. CLEANFILES = another/sub/subsub/file2
  35. check-local:
  36. test -f $(srcdir)/foo/bar
  37. test -f $(srcdir)/woo/doo
  38. test -f $(srcdir)/joe
  39. test -f $(srcdir)/dada
  40. test -f $(srcdir)/some/file
  41. test -f $(srcdir)/another/sub/subsub/file2 \
  42. || test -f /another/sub/subsub/file2
  43. test -f $(srcdir)/yet/another/file3
  44. END
  45. $ACLOCAL
  46. $AUTOCONF
  47. $AUTOMAKE
  48. mkdir foo woo some another another/sub another/sub/subsub yet yet/another
  49. touch foo/bar joe woo/doo dada some/file another/sub/subsub/file2
  50. touch yet/another/file3
  51. mkdir build
  52. cd build
  53. ../configure
  54. $MAKE distdir
  55. # Check to make sure 'foo' isn't made in build directory.
  56. test -d foo && exit 1
  57. rm -rf $me-1.0
  58. # Remove the dot from VERSION for the next grep.
  59. run_make -O -e IGNORE VERSION=10 MKDIR_P='echo MKDIR_P' distdir
  60. # Make sure no './' appear in the directory names. srcdir is '..', so
  61. # this also checks that no directory is created in the source tree.
  62. grep 'MKDIR_P.*\.' stdout && exit 1
  63. cd ..
  64. ./configure --prefix "$(pwd)"
  65. $MAKE distcheck
  66. :