override-conditional-pr13940.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #! /bin/sh
  2. # Copyright (C) 2013-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. # Expose automake bug#1394: automake erroneously think that a .PHONY
  17. # target's rule is overridden only because we declare dependencies
  18. # to such targets twice: one in an Automake conditional, and once
  19. # unconditionally.
  20. . test-init.sh
  21. cat >> configure.ac << 'END'
  22. AM_CONDITIONAL([FOO], [true])
  23. AC_OUTPUT
  24. END
  25. cat > Makefile.am << 'END'
  26. # The conditional here is important: Automake only appears to warn
  27. # when one of the all-local rules is inside a conditional and the
  28. # other is not.
  29. if FOO
  30. all-local: bar
  31. bar: ; @echo bar
  32. endif
  33. all-local: baz
  34. baz: ; @echo baz
  35. END
  36. $ACLOCAL
  37. $AUTOMAKE -a
  38. :