java-mix.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. # Check that the JAVA primary can be used freely in the same Makefile.am
  17. # with proper combinations of the 'dist_', 'nodist_' and 'nobase_'
  18. # modifiers. Also check that '.java' files are not distributed by
  19. # default.
  20. . test-init.sh
  21. cat >> configure.ac << 'END'
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am << 'END'
  25. # This test does not require compilation of *.java files.
  26. JAVAC = false
  27. javadir = $(prefix)
  28. java_JAVA = Class.java
  29. dist_java_JAVA = ClassDist.java
  30. nodist_java_JAVA = ClassNodist.java
  31. nobase_java_JAVA = ClassNobase.java
  32. nobase_dist_java_JAVA = ClassNobaseDist.java
  33. nobase_nodist_java_JAVA = ClassNobaseNodist.java
  34. Class.java ClassNodist.java ClassNobase.java ClassNobaseNodist.java:
  35. @echo '$@ should not be generated!' >&2; exit 1
  36. END
  37. : > ClassDist.java
  38. : > ClassNobaseDist.java
  39. $ACLOCAL
  40. $AUTOCONF
  41. # Automake used to display non-fatal warnings with this test, but
  42. # they were unexpected, so we want to consider them as failures in
  43. # this test.
  44. $AUTOMAKE 2>stderr || { cat stderr >&2; exit 1; }
  45. cat stderr >&2
  46. test ! -s stderr
  47. ./configure
  48. $MAKE distdir
  49. ls -l $distdir # For debugging.
  50. test ! -e $distdir/Class.java
  51. test -f $distdir/ClassDist.java
  52. test ! -e $distdir/ClassNobase.java
  53. test -f $distdir/ClassNobaseDist.java
  54. test ! -e $distdir/ClassNodist.java
  55. test ! -e $distdir/ClassNobaseNodist.java
  56. :