java-nobase.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #! /bin/sh
  2. # Copyright (C) 2011-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 support of 'nobase_' with the 'JAVA' primary.
  17. required=javac
  18. . test-init.sh
  19. cat >>configure.ac <<'END'
  20. AC_OUTPUT
  21. END
  22. cat > Makefile.am << 'END'
  23. javadir = $(datadir)/java
  24. nobase_java_JAVA = sub/subsub/Foo.java
  25. nobase_dist_java_JAVA = sub/Bar.java
  26. nobase_nodist_java_JAVA = sub2/Baz.java
  27. # Java files are not distributed by default.
  28. EXTRA_DIST = sub/subsub/Foo.java
  29. sub2/Baz.java:
  30. rm -f $@ $@-t
  31. test -d sub2 || mkdir sub2
  32. echo 'class Baz {}' > $@-t
  33. chmod a-w $@-t && mv -f $@-t $@
  34. .PHONY: test-install
  35. test-install:
  36. find $(prefix) ;: For debugging.
  37. test -f $(javadir)/sub/subsub/Foo.class
  38. test -f $(javadir)/sub/Bar.class
  39. test -f $(javadir)/sub2/Baz.class
  40. installcheck-local: test-install
  41. DISTCLEANFILES = sub2/Baz.java
  42. END
  43. mkdir sub sub/subsub
  44. echo 'class Foo {}' > sub/subsub/Foo.java
  45. echo 'class Bar {}' > sub/Bar.java
  46. $ACLOCAL
  47. $AUTOCONF
  48. $AUTOMAKE
  49. ./configure --prefix="$(pwd)"/_inst
  50. $MAKE check
  51. $MAKE install
  52. $MAKE test-install
  53. $MAKE distcheck
  54. :