dnl Process this file with autoconf to produce a configure script. AC_INIT() AM_INIT_AUTOMAKE(jode, 1.1) dnl Checks for programs. AC_PROG_MAKE_SET AC_PATH_PROG(PERL, perl) AC_PATH_PROG(CYGPATH, cygpath) dnl Checks for libraries. dnl Checks for header files. dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. dnl hack to quote Makefile lines QUOTE="" AC_SUBST(QUOTE) AC_SUBST(SHELL) if test -n "$CYGPATH"; then # Extra check if java take windows path? CLASSPATH=`$CYGPATH --unix --path $CLASSPATH` SUBSTCP="$CYGPATH --windows --path" else SUBSTCP="echo" fi AC_SUBST(SUBSTCP) AC_ARG_WITH(java, [ --with-java specify path to a java-like program ], [ if test ${withval} != "" || test ${withval} != "yes" || test ${withval} != "no"; then # set javac to user input value JODE_CHECK_JAVA(${withval}) else JODE_CHECK_JAVA(/usr/lib/java) fi ], [ JODE_CHECK_JAVA(/usr/lib/java) ]) dnl jikes can also handle dependancies. AC_ARG_WITH(jikes, [ --with-jikes specify location of jikes ], [ USER_SPECIFIED_JIKES=true if test "${withval}" = "yes" || test "${withval}" = ""; then AC_PATH_PROG(JIKES, jikes, "", $PATH) else echo "searching jikes in ${withval}:$PATH" AC_PATH_PROG(JIKES, jikes, "", ${withval}:$PATH) fi if test -n "$JIKES"; then JAVAC=$JIKES fi ], [ USER_SPECIFIED_JIKES= AC_PATH_PROG(JIKES, jikes, "", $PATH) ]) AM_CONDITIONAL(HAVE_JIKES, test x"$JIKES" != x) AC_ARG_WITH(javac, [ --with-javac specify location of javac ], [ if test x$USER_SPECIFIED_JIKES = xtrue; then AC_MSG_ERROR(You must only give one option --with-javac or --with-jikes) fi if test ${withval} != "" || test ${withval} != "yes" || test ${withval} != "no"; then AC_CHECK_FILES(${withval}, [ JAVAC=${withval} ], [ AC_MSG_ERROR(${withval} does not exists) ]) fi ], [ dnl use jikes as default, if javac option not given. if test -n "$JIKES"; then JAVAC=$JIKES fi ]) AC_PATH_PROG(UNZIP, unzip) if test -n "$UNZIP"; then CLASS_CHECK () { $UNZIP -v -C `$SUBSTCP $1` $2 >/dev/null 2>&1 } else if test -n "$JAR"; then CLASS_CHECK () { $JAR -tf `$SUBSTCP $1` 2>&1 | grep $2 >/dev/null } else AC_MSG_ERROR(You need either unzip or jar.) fi fi AC_MSG_CHECKING(for java.lang.Object) JODE_CHECK_CLASS(java.lang.Object, $CLASSLIB, [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) AC_MSG_ERROR(Please specify location of core java class library) ]) AC_MSG_CHECKING(for java.lang.ref.WeakReference) JODE_CHECK_CLASS(java.lang.ref.WeakReference, $CLASSLIB, [ AC_MSG_RESULT(yes) JCPPFLAGS="-DJDK12" ], [ AC_MSG_RESULT(no) JCPPFLAGS="-DJDK11" ]) AC_MSG_CHECKING(for collection classes) JODE_CHECK_CLASS(java.util.Set, $CLASSPATH:$CLASSLIB, [ COLLECTIONS="java.util" COLLECTIONEXTRA="java.lang" ], [ JODE_CHECK_CLASS(gnu.java.util.collections.Set, $CLASSPATH:$CLASSLIB, [ COLLECTIONS="gnu.java.util.collections" COLLECTIONEXTRA="gnu.java.util.collections" ], [ JODE_CHECK_CLASS(com.sun.java.util.collections.Set, $CLASSPATH:$CLASSLIB, [ COLLECTIONS="com.sun.java.util.collections" COLLECTIONEXTRA="com.sun.java.util.collections" ], [ AC_MSG_RESULT(no) AC_MSG_ERROR(You need the Java 1.2 collection classes in your classpath) ]) ]) ]) AC_MSG_RESULT($COLLECTIONS) AC_SUBST(COLLECTIONS) AC_SUBST(COLLECTIONEXTRA) AC_MSG_CHECKING(for gnu.getopt) JODE_CHECK_CLASS(gnu.getopt.Getopt, $CLASSPATH:$CLASSLIB, [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) AC_MSG_ERROR(You need gnu getopt for java.) ]) AC_MSG_CHECKING(for swing) JODE_CHECK_CLASS(javax.swing.JFrame, $CLASSPATH:$CLASSLIB, [ JAVAX_SWING="javax.swing" ], [ JODE_CHECK_CLASS(com.sun.java.swing.JFrame, $CLASSPATH:$CLASSLIB, [ JAVAX_SWING="com.sun.java.swing" ], [ JAVAX_SWING="no" ]) ] ) AC_MSG_RESULT($JAVAX_SWING) AC_SUBST(JAVAX_SWING) if test "$JAVAX_SWING" != "no"; then SWINGUI="swingui" else AC_MSG_WARN(Swing is not in classpath ... skipping swingui) SWINGUI="" fi AC_SUBST(SWINGUI) JCPPFLAGS="$JCPPFLAGS -DCOLLECTIONS=$COLLECTIONS -DCOLLECTIONEXTRA=$COLLECTIONEXTRA -DJAVAX_SWING=$JAVAX_SWING" AC_SUBST(CLASSPATH) AC_SUBST(JAVAC) AC_SUBST(JAR) AC_OUTPUT(Makefile jode/Makefile jode/bytecode/Makefile jode/decompiler/Makefile jode/expr/Makefile jode/flow/Makefile jode/jvm/Makefile jode/obfuscator/Makefile jode/obfuscator/modules/Makefile jode/swingui/Makefile jode/type/Makefile jode/util/Makefile bin/Makefile bin/jode bin/jode.bat doc/Makefile test/Makefile, [chmod 755 bin/jode], [for i in \$CONFIG_FILES; do changequote(, )dnl if [ \$i != \${i%.java} ]; then changequote([, ])dnl $PERL $srcdir/scripts/jcpp.pl $JCPPFLAGS \$i fi done])