diff --git a/jode/Makefile.am b/jode/Makefile.am index b0ee681..d68d7ce 100644 --- a/jode/Makefile.am +++ b/jode/Makefile.am @@ -3,3 +3,5 @@ SUBDIRS = jode bin doc test EXTRA_DIST = TODO + +all_recursive: javacWithDeps.sh diff --git a/jode/configure.in b/jode/configure.in index 75fb50e..4be73b0 100644 --- a/jode/configure.in +++ b/jode/configure.in @@ -14,6 +14,7 @@ AC_PROG_MAKE_SET dnl AC_PROG_RANLIB dnl AC_PATH_PROG(ZIP, zip) AC_PATH_PROG(UNZIP, unzip) +AC_PATH_PROG(PERL, perl) dnl Checks for libraries. @@ -75,7 +76,12 @@ AC_ARG_WITH(javac, [ JAVAC=${withval} ], [ AC_MSG_ERROR(${withval} does not exists) ]) fi -], [ true ]) +], [ +dnl use jikes as default, if javac option not given. + if test -n "$JIKES"; then + JAVAC=$JIKES + fi +]) JODE_CHECK_CLASS(java.lang.Object, $CLASSLIB, [ true ], @@ -119,6 +125,7 @@ AC_SUBST(CLASSPATH) AC_SUBST(JAVAC) AC_OUTPUT(Makefile +javacWithDeps.sh jode/Makefile jode/bytecode/Makefile jode/decompiler/Makefile @@ -137,3 +144,5 @@ bin/jode doc/Makefile test/Makefile) +AC_OUTPUT_COMMANDS(chmod 755 javacWithDeps.sh) +AC_OUTPUT_COMMANDS(chmod 755 bin/jode) diff --git a/jode/javacWithDeps.sh.in b/jode/javacWithDeps.sh.in new file mode 100644 index 0000000..5633e87 --- /dev/null +++ b/jode/javacWithDeps.sh.in @@ -0,0 +1,15 @@ +#!/bin/sh +JAVAC=@JAVAC@ +JIKES=@JIKES@ +PERL=@PERL@ + +abs_top_builddir=`cd $top_builddir; pwd` +abs_top_srcdir=`cd $top_srcdir; pwd` +if [ "$JAVAC" = "$JIKES" -a -n "$PERL" ]; then + TEMPDEPS=`mktemp "deps.XXXXXX"` + trap "rm $TEMPDEPS" EXIT + $JAVAC +M=$TEMPDEPS $* + sort $TEMPDEPS | $PERL -ne 's"^(\Q'$top_srcdir'\E|\Q'$top_builddir'\E)"'$abs_top_builddir'"; s": (\Q'$top_srcdir'\E|\Q'$top_builddir'\E)": '$abs_top_srcdir'"; m"([^\.:]+)\.class: \Q'$abs_top_srcdir'\E[^\.]*.java$" or next; if ($1 ne $last) { $last = $1; open DEP, ">$1.u" }; print DEP $_' +else + $JAVAC $* +fi diff --git a/jode/jode/Makefile.am b/jode/jode/Makefile.am index d39cc04..00e83ec 100644 --- a/jode/jode/Makefile.am +++ b/jode/jode/Makefile.am @@ -1,10 +1,9 @@ ## Input file for automake to generate the Makefile.in used by configure -SUBDIRS = bytecode type util jvm expr flow decompiler obfuscator @SWINGUI@ +SUBDIRS = util bytecode type jvm expr flow decompiler obfuscator @SWINGUI@ JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):.:$(CLASSPATH):$(CLASSLIB) @@ -24,23 +23,14 @@ EXTRA_DIST = $(MY_JAVA_FILES) JARFILE = jode-@VERSION@.jar data_DATA = $(JARFILE) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class - @rm -f $(JARFILE) .java.deps + @rm -f *.u $(JARFILE): $(noinst_DATA) CLASSPATH=$(top_builddir):$(CLASSPATH) $(JAVA) -mx80m \ diff --git a/jode/jode/bytecode/Makefile.am b/jode/jode/bytecode/Makefile.am index 322a226..fc9d35f 100644 --- a/jode/jode/bytecode/Makefile.am +++ b/jode/jode/bytecode/Makefile.am @@ -1,8 +1,7 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) @@ -28,19 +27,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u diff --git a/jode/jode/decompiler/Makefile.am b/jode/jode/decompiler/Makefile.am index d20893b..13e83c9 100644 --- a/jode/jode/decompiler/Makefile.am +++ b/jode/jode/decompiler/Makefile.am @@ -1,8 +1,7 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) @@ -28,19 +27,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u diff --git a/jode/jode/expr/Makefile.am b/jode/jode/expr/Makefile.am index 2dd7352..09ba961 100644 --- a/jode/jode/expr/Makefile.am +++ b/jode/jode/expr/Makefile.am @@ -1,8 +1,7 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) @@ -55,19 +54,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u diff --git a/jode/jode/flow/Makefile.am b/jode/jode/flow/Makefile.am index eed8d21..d5f01a7 100644 --- a/jode/jode/flow/Makefile.am +++ b/jode/jode/flow/Makefile.am @@ -1,8 +1,7 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) @@ -52,19 +51,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u diff --git a/jode/jode/jvm/Makefile.am b/jode/jode/jvm/Makefile.am index 42c17f1..590051e 100644 --- a/jode/jode/jvm/Makefile.am +++ b/jode/jode/jvm/Makefile.am @@ -1,11 +1,10 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ -BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) +BUILD_CLASSPATH = $(top_builddir):$(top_srcdir):$(CLASSPATH):$(CLASSLIB) MY_JAVA_FILES = \ CodeVerifier.java \ @@ -21,19 +20,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u diff --git a/jode/jode/obfuscator/Makefile.am b/jode/jode/obfuscator/Makefile.am index 2cf76b8..c5edf26 100644 --- a/jode/jode/obfuscator/Makefile.am +++ b/jode/jode/obfuscator/Makefile.am @@ -1,8 +1,7 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) @@ -35,19 +34,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u diff --git a/jode/jode/swingui/Makefile.am b/jode/jode/swingui/Makefile.am index 5c284cf..1ba93c7 100644 --- a/jode/jode/swingui/Makefile.am +++ b/jode/jode/swingui/Makefile.am @@ -1,8 +1,7 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) @@ -14,19 +13,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u diff --git a/jode/jode/type/Makefile.am b/jode/jode/type/Makefile.am index 8bc48cb..007bd06 100644 --- a/jode/jode/type/Makefile.am +++ b/jode/jode/type/Makefile.am @@ -1,8 +1,7 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) @@ -20,19 +19,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u diff --git a/jode/jode/util/Makefile.am b/jode/jode/util/Makefile.am index 0935b85..49cd915 100644 --- a/jode/jode/util/Makefile.am +++ b/jode/jode/util/Makefile.am @@ -1,8 +1,7 @@ ## Input file for automake to generate the Makefile.in used by configure JAR = @JAR@ -JAVAC = @JAVAC@ -JIKES = @JIKES@ +JAVAC = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) $(top_builddir)/javacWithDeps.sh CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) @@ -42,19 +41,11 @@ MY_JAVA_FILES = \ noinst_DATA = $(MY_JAVA_FILES:.java=.class) EXTRA_DIST = $(MY_JAVA_FILES) -if HAVE_JIKES - -@QUOTE@-include $(top_builddir)/jode/.java.deps +@QUOTE@-include *.u %.class: %.java - $(JIKES) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) +M=$(top_builddir)/jode/.java.deps -d $(top_builddir) $< - -else - -%.class: %.java - $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -depend -d $(top_builddir) $< - -endif + $(JAVAC) -classpath $(BUILD_CLASSPATH):$(CLASSLIB) -d $(top_builddir) $< clean-local: @rm -f *.class + @rm -f *.u