tests: fix a spurious typo-related failure
[automake.git] / t / java-empty-classpath.sh
blobc54da0ba38c440c694012f12241a6dc5aca08cb1
1 #! /bin/sh
2 # Copyright (C) 2011-2012 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)
7 # any later version.
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 # Java compilation works also when CLASSPATH is unset or empty at
18 # compilation time. See automake bug#9306.
20 required=javac
21 . ./defs || exit 1
23 cat >> configure.ac <<'END'
24 AC_CONFIG_SRCDIR([org/gnu/bug/Library.java])
25 AC_CONFIG_FILES([
26 org/Makefile
27 org/gnu/Makefile
28 org/gnu/bug/Makefile
30 AC_OUTPUT
31 END
33 mkdir org org/gnu org/gnu/bug
34 cat > Makefile.am <<END
35 CLEANFILES = *.class
36 SUBDIRS = org
37 END
38 echo SUBDIRS = gnu > org/Makefile.am
39 echo SUBDIRS = bug > org/gnu/Makefile.am
40 cat > org/gnu/bug/Makefile.am <<'END'
41 JAVAROOT = ../../..
42 dist_noinst_JAVA = Library.java Application.java
43 END
45 cat > org/gnu/bug/Library.java <<'END'
46 package org.gnu.bug;
47 public class Library
49 public Library ()
51 // Nothing to do.
53 public static void doSomethingUseful (String arg)
55 System.out.println (arg);
58 END
60 cat > org/gnu/bug/Application.java <<'END'
61 import org.gnu.bug.*;
62 public class Application
64 public static void main (String args[])
66 Library lib = new Library ();
67 lib.doSomethingUseful ("PLUGH");
70 END
72 $ACLOCAL
73 $AUTOCONF
74 $AUTOMAKE
75 ./configure
77 unset CLASSPATH || :
78 $MAKE
79 $MAKE clean
81 CLASSPATH=''; export CLASSPATH
82 $MAKE
83 $MAKE clean
85 unset CLASSPATH || :
86 $MAKE distcheck