vala-grepping.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #! /bin/sh
  2. # Copyright (C) 1996-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. # Basic "grepping" test on vala support.
  17. . test-init.sh
  18. # So that we won't require libtool macros.
  19. cat > acinclude.m4 <<'END'
  20. AC_DEFUN([AC_PROG_LIBTOOL],
  21. [AC_SUBST([LIBTOOL], [:])])
  22. END
  23. cat >> 'configure.ac' << 'END'
  24. AC_PROG_CC
  25. AC_PROG_CXX
  26. AM_PROG_AR
  27. AC_PROG_LIBTOOL
  28. AM_PROG_VALAC
  29. AC_CONFIG_FILES([sub/Makefile])
  30. AC_OUTPUT
  31. END
  32. cat > Makefile.am <<'END'
  33. SUBDIRS = sub
  34. bin_PROGRAMS = zardoz
  35. zardoz_SOURCES = zardoz.vala
  36. zardoz_VALAFLAGS = --debug
  37. lib_LTLIBRARIES = libzardoz.la
  38. libzardoz_la_SOURCES = zardoz-foo.vala zardoz-bar.vala
  39. END
  40. mkdir sub
  41. cat > sub/Makefile.am <<'END'
  42. bin_PROGRAMS = foo
  43. foo_SOURCES = bar.vala baz.vala mu.c zap.cxx
  44. END
  45. : > ltmain.sh
  46. : > config.sub
  47. : > config.guess
  48. $ACLOCAL
  49. $AUTOMAKE -a
  50. grep '\$(VALAC).* \$(AM_VALAFLAGS) \$(VALAFLAGS) ' Makefile.in
  51. grep '\$(VALAC).* \$(zardoz_VALAFLAGS) \$(VALAFLAGS) ' Makefile.in
  52. $FGREP 'am_zardoz_OBJECTS' Makefile.in
  53. $FGREP 'am_libzardoz_la_OBJECTS' Makefile.in
  54. $FGREP 'zardoz_vala.stamp:' Makefile.in
  55. $FGREP 'libzardoz_la_vala.stamp:' Makefile.in
  56. test $($FGREP -c '.stamp:' Makefile.in) -eq 2
  57. $FGREP 'zardoz.c' Makefile.in
  58. $FGREP 'zardoz-foo.c' Makefile.in
  59. $FGREP 'zardoz-bar.c' Makefile.in
  60. grep '\$(VALAC).* \$(AM_VALAFLAGS) \$(VALAFLAGS) ' sub/Makefile.in
  61. $FGREP 'foo_VALAFLAGS' sub/Makefile.in && exit 1
  62. $FGREP 'am_foo_OBJECTS' sub/Makefile.in
  63. $FGREP 'bar.c' sub/Makefile.in
  64. $FGREP 'baz.c' sub/Makefile.in
  65. $FGREP 'foo_vala.stamp:' sub/Makefile.in
  66. test $($FGREP -c '.stamp:' sub/Makefile.in) -eq 1
  67. # Check against regression for weird bug due to unescaped '@'
  68. # characters used in a "..." perl string when writing the vala
  69. # rules from automake.in.
  70. grep '\$[0-9][0-9]*t' Makefile.in sub/Makefile.in && exit 1
  71. :