vala-non-recursive-setup.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. # Test to make sure compiling Vala code really works with non-recursive make.
  17. required="pkg-config valac gcc GNUmake"
  18. . test-init.sh
  19. mkdir src
  20. cat >> 'configure.ac' << 'END'
  21. AC_PROG_CC
  22. AM_PROG_VALAC([0.7.0])
  23. PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
  24. AC_OUTPUT
  25. END
  26. cat > 'src/zardoz.vala' <<'END'
  27. using GLib;
  28. public class Zardoz {
  29. public static void main () {
  30. stdout.printf ("Zardoz!\n");
  31. }
  32. }
  33. END
  34. cat > 'Makefile.am' <<'END'
  35. AUTOMAKE_OPTIONS = subdir-objects
  36. bin_PROGRAMS = src/zardoz
  37. src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
  38. src_zardoz_LDADD = $(GOBJECT_LIBS)
  39. src_zardoz_SOURCES = src/zardoz.vala
  40. END
  41. $ACLOCAL
  42. $AUTOCONF
  43. $AUTOMAKE -a
  44. ./configure
  45. $MAKE
  46. test -f src/zardoz.c
  47. test -f src_zardoz_vala.stamp
  48. $MAKE distcheck
  49. $MAKE maintainer-clean
  50. test ! -e src/zardoz.c
  51. test ! -e src_zardoz_vala.stamp
  52. mkdir build
  53. cd build
  54. ../configure
  55. $MAKE
  56. $MAKE distcheck
  57. cd ..
  58. rm -rf build
  59. # Try again with subdir-objects.
  60. cat > 'Makefile.am' <<'END'
  61. AUTOMAKE_OPTIONS = subdir-objects
  62. bin_PROGRAMS = src/zardoz
  63. src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
  64. src_zardoz_LDADD = $(GOBJECT_LIBS)
  65. src_zardoz_SOURCES = src/zardoz.vala
  66. END
  67. $ACLOCAL
  68. $AUTOCONF
  69. $AUTOMAKE -a
  70. ./configure || skip_ "configure failure"
  71. $MAKE
  72. $MAKE distcheck
  73. $MAKE distclean
  74. mkdir build
  75. cd build
  76. ../configure
  77. $MAKE
  78. $MAKE distcheck