suffix10.tap 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. # Make sure that derivations work with .lo too.
  17. # (related to PR/37)
  18. required='cc libtoolize yacc'
  19. . test-init.sh
  20. plan_ 7
  21. cat >>configure.ac <<EOF
  22. AC_PROG_CC
  23. AC_PROG_YACC
  24. AM_PROG_AR
  25. AC_PROG_LIBTOOL
  26. AC_OUTPUT
  27. EOF
  28. cat >Makefile.am << 'END'
  29. lib_LTLIBRARIES = libfoo.la
  30. libfoo_la_SOURCES = foo.x_
  31. .x_.y:
  32. rm -f $@ $@-t
  33. ## The leading ':;' works around a bug in bash <= 3.2.
  34. :; { echo '/* autogenerated */' \
  35. && echo '%{' \
  36. && echo 'int yylex () {return 0;}' \
  37. && echo 'void yyerror (char *s) {}' \
  38. && echo '%}' \
  39. && echo '%%' \
  40. && echo "foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};" \
  41. && echo '%%' \
  42. ## Account for VPATH issues on weaker make implementations.
  43. && cat `test -f '$<' || echo $(srcdir)/`$<; \
  44. } > $@-t
  45. mv -f $@-t $@
  46. .PHONY: test
  47. test:
  48. echo $(libfoo_la_OBJECTS) | grep '^foo\.lo$$'
  49. END
  50. cat > foo.x_ << 'END'
  51. int foo (void) { return yyparse(); }
  52. END
  53. # We must protect the TAP driver from the output of configure, since
  54. # that might output a stray "ok" on a line of its own (due to a
  55. # libtool bug on Mac OS X), thus causing a spurious test result to
  56. # be seen. See automake bug#11897.
  57. run_configure ()
  58. {
  59. st=0; ./configure >output 2>&1 || st=1
  60. sed 's/^/ /' output
  61. test $st -eq 0
  62. }
  63. command_ok_ "libtoolize" libtoolize --force
  64. command_ok_ "aclocal" $ACLOCAL
  65. command_ok_ "autoconf" $AUTOCONF
  66. command_ok_ "automake" $AUTOMAKE --add-missing
  67. command_ok_ "configure" run_configure
  68. command_ok_ "make test" $MAKE test
  69. directive=''; make_can_chain_suffix_rules || directive=TODO
  70. command_ok_ "make all" -D "$directive" -r "suffix rules not chained" \
  71. $MAKE all
  72. :