programs-primary-rewritten.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # Make sure xxx_PROGRAMS gets properly rewritten where needed. These
  17. # checks have been introduced in commit 'Release-1-9-254-g9d0eaef' into
  18. # the former test 'subst2.test'.
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_SUBST([FOO], [c])
  22. AC_OUTPUT
  23. END
  24. cat >Makefile.am <<'END'
  25. AUTOMAKE_OPTIONS = no-dependencies
  26. CC = false
  27. EXEEXT = .bin
  28. check_PROGRAMS = a
  29. bin_PROGRAMS = b @FOO@
  30. noinst_PROGRAMS = $(bar) $(baz:=de)
  31. EXTRA_PROGRAMS =
  32. bar = zardoz
  33. baz = mau
  34. .PHONY: test
  35. test:
  36. is $(check_PROGRAMS) == a.bin
  37. is $(bin_PROGRAMS) == b.bin c
  38. is $(noinst_PROGRAMS) == zardoz.bin maude.bin
  39. END
  40. $ACLOCAL
  41. $AUTOMAKE
  42. grep PROGRAMS Makefile.in # For debugging.
  43. # Check that no useless indirections are used.
  44. grep '^check_PROGRAMS = a$(EXEEXT)$' Makefile.in
  45. grep '^bin_PROGRAMS = b$(EXEEXT) @FOO@$' Makefile.in
  46. $AUTOCONF
  47. ./configure
  48. $MAKE test
  49. :