Find a suitable Java compiler. If there isn't one, don't compile the
authormdw <mdw>
Tue, 6 Feb 2001 10:06:25 +0000 (10:06 +0000)
committermdw <mdw>
Tue, 6 Feb 2001 10:06:25 +0000 (10:06 +0000)
Java bits.

Makefile.am
configure.in

index 84ea36f..19dc30f 100644 (file)
@@ -1,6 +1,6 @@
 ## -*-makefile-*-
 ##
-## $Id: Makefile.am,v 1.4 2001/02/06 09:38:46 mdw Exp $
+## $Id: Makefile.am,v 1.5 2001/02/06 10:06:25 mdw Exp $
 ##
 ## Makefile for Anag
 ##
 ##----- Revision history ----------------------------------------------------
 ##
 ## $Log: Makefile.am,v $
+## Revision 1.5  2001/02/06 10:06:25  mdw
+## Find a suitable Java compiler.  If there isn't one, don't compile the
+## Java bits.
+##
 ## Revision 1.4  2001/02/06 09:38:46  mdw
 ## Remove redundant rule.
 ##
 ##
 
 AUTOMAKE_OPTIONS = foreign
+javadir = datadir/java
+
+JAVAC = @JAVAC@
+
 SUFFIXES = .java .class
-JAVAC = javac
 .java.class:; $(JAVAC) -d . $<
 
 bin_PROGRAMS = anag
-anag_SOURCES = anag.c anag.h wildcard.c anagram.c trackword.c util.c
+java_DATA = @jarfiles@
 
-all: anag.jar
+anag_SOURCES = anag.c anag.h wildcard.c anagram.c trackword.c util.c
 anag.jar: AnagGUI.class
-       jar cf anag.jar *.class
+       jar cf anag.jar AnagGUI*.class
 
 EXTRA_DIST = AnagGUI.java
 CLEANFILES = *.class *.jar
index bbe801f..d60c472 100644 (file)
@@ -1,6 +1,6 @@
 dnl -*-fundamental-*-
 dnl
-dnl $Id: configure.in,v 1.1 2001/02/04 17:14:42 mdw Exp $
+dnl $Id: configure.in,v 1.2 2001/02/06 10:06:25 mdw Exp $
 dnl
 dnl Configuration script
 dnl
@@ -28,6 +28,10 @@ dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 dnl ----- Revision history --------------------------------------------------
 dnl
 dnl $Log: configure.in,v $
+dnl Revision 1.2  2001/02/06 10:06:25  mdw
+dnl Find a suitable Java compiler.  If there isn't one, don't compile the
+dnl Java bits.
+dnl
 dnl Revision 1.1  2001/02/04 17:14:42  mdw
 dnl Initial checkin
 dnl
@@ -37,6 +41,14 @@ AM_INIT_AUTOMAKE(anag, 1.0.0)
 AM_CONFIG_HEADER(config.h)
 AC_PROG_CC
 mdw_GCC_FLAGS
+AC_CHECK_PROGS(JAVAC, jikes javac, none)
+if test "$JAVAC" = "none"; then
+  AC_MSG_WARN([No Java compiler found])
+  jarfiles=""
+else
+  jarfiles=anag.jar
+fi
+AC_SUBST(jarfiles)
 AC_ARG_WITH(dictionary,
 [  --with-dictionary=DICT  set default word list to be DICT],
 [AC_DEFINE_UNQUOTED(DICTIONARY, "$withval")],