distcom5.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #! /bin/sh
  2. # Copyright (C) 2003-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 config files are distributed, and only once.
  17. # This tries to distribute a file from a subdirectory, with
  18. # a Makefile in that directory. 'distcom4.sh' performs the same
  19. # test without Makefile in the directory.
  20. . test-init.sh
  21. cat >> configure.ac << 'END'
  22. AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in],
  23. [chmod +x tests/autoconf])
  24. AC_CONFIG_FILES([tests/autoheader:tests/wrapper.in],
  25. [chmod +x tests/autoheader])
  26. AC_CONFIG_FILES([tests/autom4te:tests/wrapper.in],
  27. [chmod +x tests/autom4te])
  28. AC_CONFIG_FILES([tests/autoreconf:tests/wrapper.in],
  29. [chmod +x tests/autoreconf])
  30. AC_CONFIG_FILES([tests/autoscan:tests/wrapper.in],
  31. [chmod +x tests/autoscan])
  32. AC_CONFIG_FILES([tests/autoupdate:tests/wrapper.in],
  33. [chmod +x tests/autoupdate])
  34. AC_CONFIG_FILES([tests/ifnames:tests/wrapper.in],
  35. [chmod +x tests/ifnames])
  36. AC_CONFIG_FILES([tests/Makefile])
  37. AC_OUTPUT
  38. END
  39. mkdir tests
  40. : > tests/wrapper.in
  41. cat > Makefile.am << 'END'
  42. SUBDIRS = tests
  43. .PHONY: test
  44. test: distdir
  45. test -f $(distdir)/tests/wrapper.in
  46. check-local: test
  47. for x in $(DIST_COMMON); do echo $$x; done \
  48. | grep tests && exit 1; :
  49. END
  50. cat > tests/Makefile.am <<'END'
  51. check-local:
  52. for x in $(DIST_COMMON); do echo $$x; done \
  53. | grep wrapper.in > lst
  54. cat lst # For debugging.
  55. test `wc -l <lst` -eq 1
  56. END
  57. $ACLOCAL
  58. $AUTOCONF
  59. $AUTOMAKE --add-missing
  60. ./configure
  61. $MAKE check
  62. # Sanity check.
  63. test -f tests/lst
  64. :