cond18.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #! /bin/sh
  2. # Copyright (C) 2001-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. # Regression test for substitution references to conditional variables.
  17. # Report from Richard Boulton.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AM_CONDITIONAL([COND1], [true])
  21. AM_CONDITIONAL([COND2], [true])
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am << 'END'
  25. AUTOMAKE_OPTIONS = no-dependencies
  26. CC = false
  27. OBJEXT = obj
  28. var1 = dlmain
  29. if COND1
  30. var2 = $(var1:=.c) foo.cc
  31. else
  32. var2 = $(var1:=.c)
  33. endif
  34. if COND2
  35. var3 = $(var2:.cc=.c)
  36. else
  37. var3 = $(var2:.cc=.c)
  38. endif
  39. helldl_SOURCES = $(var3)
  40. .PHONY: test
  41. test:
  42. is $(helldl_SOURCES) $(helldl_OBJECTS) == \
  43. dlmain.c foo.c dlmain.obj foo.obj
  44. bin_PROGRAMS = helldl
  45. END
  46. $ACLOCAL
  47. $AUTOCONF
  48. $AUTOMAKE -a
  49. ./configure
  50. $MAKE test
  51. :