2
0

exeext4.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 $(EXEEXT) is appended to programs and to tests that are
  17. # programs, but not to @substitutions@.
  18. # For gen-testsuite-part: ==> try-with-serial-tests <==
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AM_CONDITIONAL([COND], [test -n "$cond"])
  22. AC_SUBST([programs], ['prg1$(EXEEXT) prg2$(EXEEXT)'])
  23. AC_SUBST([CC], [whocares])
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am << 'END'
  27. AUTOMAKE_OPTIONS = no-dependencies
  28. EXEEXT = .x
  29. if COND
  30. BAR = bar
  31. DEP = bar
  32. BAZE = baz$(EXEEXT)
  33. BAZ = baz $(DEP)
  34. endif
  35. bin_PROGRAMS = $(programs) @programs@ prg3 $(BAR) $(BAZE)
  36. EXTRA_PROGRAMS = prg1 prg2 prg3
  37. TESTS = prg1 prg3 prg4 $(BAZ)
  38. .PHONY: test-cond test-nocond
  39. test-nocond:
  40. is $(bin_PROGRAMS) == prg1.x prg2.x prg1.x prg2.x prg3.x
  41. is $(EXTRA_PROGRAMS) == prg1.x prg2.x prg3.x
  42. is $(TESTS) == prg1.x prg3.x prg4
  43. test-cond:
  44. is $(bin_PROGRAMS) == prg1.x prg2.x prg1.x prg2.x prg3.x bar.x baz.x
  45. is $(EXTRA_PROGRAMS) == prg1.x prg2.x prg3.x
  46. is $(TESTS) == prg1.x prg3.x prg4 baz.x bar.x
  47. is $(BAR) $(BAZ) == bar baz bar
  48. END
  49. $ACLOCAL
  50. $AUTOCONF
  51. $AUTOMAKE --add-missing --copy
  52. ./configure
  53. $MAKE test-nocond
  54. ./configure cond=yes
  55. $MAKE test-cond
  56. # Only two am__EXEEXT_* variables are needed here: one for BAR, and one
  57. # BAZ. The latter must use the former.
  58. test 2 -eq $(grep -c '__EXEEXT_. =' Makefile.in)
  59. grep 'am__EXEEXT_2 = .*am__EXEEXT_1' Makefile.in
  60. :