yacc-grepping2.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. # Test of yacc functionality, derived from GNU binutils
  17. # by Tim Van Holder.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_PROG_CC
  21. AC_PROG_YACC
  22. END
  23. cat > Makefile.am << 'END'
  24. bin_PROGRAMS = maude
  25. maude_SOURCES = sub/maude.y
  26. END
  27. mkdir sub
  28. : > sub/maude.y
  29. $ACLOCAL
  30. # FIXME: stop disabling the warnings in the 'unsupported' category
  31. # FIXME: once the 'subdir-objects' option has been mandatory.
  32. $AUTOMAKE -a -Wno-unsupported
  33. grep '^maude\.c:.*maude\.y' Makefile.in
  34. ## Try again with subdir-objects.
  35. cat > Makefile.am << 'END'
  36. AUTOMAKE_OPTIONS = subdir-objects
  37. bin_PROGRAMS = maude
  38. maude_SOURCES = sub/maude.y
  39. END
  40. $AUTOMAKE -a
  41. # No rule needed, the default .y.c: inference rule is enough
  42. # (but there may be an additional dependency on a dirstamp file).
  43. grep '^sub/maude\.c:.*maude\.y' Makefile.in && exit 1
  44. ## Try again with per-exe flags.
  45. cat > Makefile.am << 'END'
  46. bin_PROGRAMS = maude
  47. maude_SOURCES = sub/maude.y
  48. ## A particularly trickey case.
  49. maude_YFLAGS = -d
  50. END
  51. # FIXME: stop disabling the warnings in the 'unsupported' category
  52. # FIXME: once the 'subdir-objects' option has been mandatory.
  53. $AUTOMAKE -a -Wno-unsupported
  54. # Rule should use maude_YFLAGS.
  55. grep 'AM_YFLAGS.*maude' Makefile.in && exit 1
  56. # Silly regression.
  57. grep 'maudec' Makefile.in && exit 1
  58. # Make sure the .o file is required.
  59. grep '^am_maude_OBJECTS.*maude' Makefile.in
  60. :