posixsubst-data.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #! /bin/sh
  2. # Copyright (C) 2010-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 that POSIX variable expansion '$(var:str=rpl)' works
  17. # in when used with the DATA primary.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_OUTPUT
  21. END
  22. cat > Makefile.am << 'END'
  23. foodir = $(prefix)
  24. t1 = foo1 foo2
  25. t2 = barx
  26. t3 = baz.y
  27. bar.data bazzardoz:
  28. : > $@
  29. CLEANFILES = bar.data bazzardoz
  30. # Also try an empty match suffix, to ensure that the ':=' in there is
  31. # not confused by the parser with an unportable assignment operator.
  32. dist_foo_DATA = $(t1:=.txt)
  33. foo_DATA = $(t2:x=.data)
  34. nodist_foo_DATA = $(t3:.y=zardoz)
  35. check-local: test
  36. .PHONY: test
  37. test: distdir
  38. ls -l $(distdir)
  39. test ! -r $(distdir)/foo.data
  40. test ! -r $(distdir)/bazzardoz
  41. installcheck-local:
  42. ls -l $(prefix)
  43. test -f $(prefix)/foo1.txt
  44. test -f $(prefix)/foo2.txt
  45. test -f $(prefix)/bar.data
  46. test -f $(prefix)/bazzardoz
  47. END
  48. : > foo1.txt
  49. : > foo2.txt
  50. $ACLOCAL
  51. $AUTOCONF
  52. $AUTOMAKE
  53. cwd=$(pwd) || fatal_ "getting current working directory"
  54. ./configure --prefix="$cwd/_inst"
  55. $MAKE install
  56. test -f bar.data
  57. test -f bazzardoz
  58. $MAKE test
  59. $MAKE installcheck
  60. $MAKE distcheck
  61. :