vala-parallel.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #! /bin/sh
  2. # Copyright (C) 2012-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. # Vala support with parallel make.
  17. required='valac cc pkg-config GNUmake'
  18. . test-init.sh
  19. cat >> configure.ac <<'END'
  20. AC_PROG_CC
  21. AC_PROG_CXX
  22. PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
  23. AM_PROG_VALAC([0.7.3])
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am <<'END'
  27. bin_PROGRAMS = zardoz
  28. AM_CFLAGS = $(GOBJECT_CFLAGS)
  29. LDADD = $(GOBJECT_LIBS)
  30. zardoz_SOURCES = main.vala 1.vala 2.vala 3.vala 4.vala 5.vala 6.vala
  31. END
  32. echo 'int main () {' > main.vala
  33. for i in 1 2 3 4 5 6; do
  34. echo "void foo$i () { stdout.printf (\"ok $i\\n\"); }" > $i.vala
  35. echo "foo$i ();" >> main.vala
  36. done
  37. echo 'return 0; }' >> main.vala
  38. cat main.vala # For debugging.
  39. $ACLOCAL
  40. $AUTOMAKE -a
  41. $AUTOCONF
  42. ./configure
  43. $MAKE -j3
  44. ls -l # For debugging.
  45. for x in main 1 2 3 4 5 6; do test -f $x.c; done
  46. test -f zardoz_vala.stamp
  47. $MAKE maintainer-clean -j4
  48. ls -l # For debugging.
  49. for x in main 1 2 3 4 5 6; do test ! -e $x.c; done
  50. test ! -e zardoz_vala.stamp
  51. mkdir build
  52. cd build
  53. ../configure
  54. $MAKE -j6
  55. ls -l . .. # For debugging.
  56. for x in main 1 2 3 4 5 6; do test -f ../$x.c; done
  57. test -f ../zardoz_vala.stamp
  58. $MAKE distcheck -j4
  59. $MAKE maintainer-clean -j2
  60. for x in main 1 2 3 4 5 6; do test ! -e ../$x.c; done
  61. test ! -e ../zardoz_vala.stamp
  62. :