2
0

cond22.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #! /bin/sh
  2. # Copyright (C) 2002-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 bug when sources listed in conditional.
  17. # Report from Richard Boulton. PR/326.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. CC=false; AC_SUBST([CC])
  21. OBJEXT=oo; AC_SUBST([OBJEXT])
  22. AM_CONDITIONAL([ONE], [true])
  23. AM_CONDITIONAL([TWO], [false])
  24. AM_CONDITIONAL([THREE], [false])
  25. AC_OUTPUT
  26. END
  27. cat > Makefile.am << 'END'
  28. bin_PROGRAMS = targ
  29. if ONE
  30. SONE = one.c
  31. endif
  32. if TWO
  33. STWO =
  34. else
  35. STWO = two.c
  36. endif
  37. if THREE
  38. STHREE =
  39. else
  40. STHREE = three.c
  41. endif
  42. if THREE
  43. STHREE2 =
  44. else
  45. STHREE2 = three2.c
  46. endif
  47. targ_SOURCES = $(SONE) $(STWO) $(STHREE) $(STHREE2)
  48. .PHONY: test
  49. test:
  50. is $(targ_OBJECTS) == one.oo two.oo three.oo three2.oo
  51. END
  52. $ACLOCAL
  53. $AUTOCONF
  54. $AUTOMAKE --ignore-deps
  55. ./configure
  56. $MAKE test
  57. :