2 # Copyright (C) 2011-2017 Free Software Foundation, Inc.
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)
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.
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/>.
17 # Test on compilation and installation of Java class files.
22 cat >>configure.ac
<<'EOF'
26 cat > Makefile.am
<< 'END'
27 javadir
= $
(datadir
)/java
29 nobase_java_JAVA
= Foo2.java
30 nobase_dist_java_JAVA
= Bar.java
31 nodist_java_JAVA
= Baz.java
33 # Java files are not distributed by default, so we distribute
36 # ... and make the other one generated.
39 echo 'class bClass {}' > $@
-t
40 chmod a-w $@
-t && mv -f $@
-t $@
42 # Explicitly declared as 'nodist_', so generate it.
45 echo 'class Baz {}' > $@
-t
46 echo 'class Baz2 {}' >> $@
-t
47 chmod a-w $@
-t && mv -f $@
-t $@
50 ls -l $
(srcdir
) .
;: For debugging.
51 test -f $
(srcdir
)/Foo.java
52 test -f $
(srcdir
)/Bar.java
62 test -f classjava.stamp
65 ls -l $
(javadir
) ;: For debugging.
66 test -f '$(javadir)/bClass.class'
67 test -f '$(javadir)/aClass.class'
68 test -f '$(javadir)/Zardoz.class'
69 test -f '$(javadir)/Baz.class'
70 test -f '$(javadir)/Baz2.class'
71 test ! -r '$(javadir)/Foo.class'
72 test ! -r '$(javadir)/Bar.class'
73 if find $
(prefix
) |
grep '\.stamp$$'; then exit 1; else :; fi
76 installcheck-local
: test-install
78 .PHONY
: test test-install
80 DISTCLEANFILES
= Baz.java Foo2.java
83 echo 'class aClass {}' > Foo.java
84 echo 'class Zardoz {}' > Bar.java
90 .
/configure
--prefix="$(pwd)"/_inst