dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright (C) 1998-2002 Peter Graves dnl $Id: configure.in,v 1.1.1.1 2002-09-24 16:06:33 piso Exp $ dnl dnl This program is free software; you can redistribute it and/or dnl modify it under the terms of the GNU General Public License dnl as published by the Free Software Foundation; either version 2 dnl of the License, or (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. AC_REVISION($Revision: 1.1.1.1 $) BOOTFILE=./configure-options if test -f "${BOOTFILE}" && test -z "${IN_BOOT}" ; then echo "reading options from ${BOOTFILE}" IN_BOOT=1 $0 `cat ${BOOTFILE}` $* exit $? fi AC_INIT(j.in) AC_PROG_INSTALL version=0.17.0+ AC_SUBST(version) if test $OSTYPE = cygwin32 || test $OSTYPE = cygwin ; then CYGWIN=yes PATHSEP=";" else PATHSEP=":" fi AC_SUBST(PATHSEP) dnl Make srcdir absolute. case "${srcdir}" in /*) ;; .) unset CDPATH if test "${PWD}" != "" && test "`(cd ${PWD}; sh -c pwd)`" = "`pwd`"; then srcdir="$PWD" else srcdir="`(cd ${srcdir}; pwd)`" fi ;; *) srcdir="`(cd ${srcdir}; pwd)`" ;; esac dnl User -must- specify location of JDK. AC_ARG_WITH(jdk, [ --with-jdk=DIR JDK you want to use ], [ JDK=${with_jdk} ], [ AC_MSG_ERROR([no jdk specified; use --with-jdk]) ]) dnl Remove trailing '/' (if any). JDK=`echo $JDK | sed -e 's/\/$//'` if test -x $JDK/bin/java; then JAVA=$JDK/bin/java; elif test -x $JDK/jre/bin/java; then JAVA=$JDK/jre/bin/java; else AC_MSG_ERROR(java not found) fi AC_SUBST(JAVA) dnl Java version. AC_MSG_CHECKING(Java version) JAVA_VERSION=`$JAVA -version 2>&1` case "$JAVA_VERSION" in java*1.1*) AC_MSG_ERROR(Java 1.2 or later is required) ;; java*1.2.0*) AC_MSG_RESULT(1.2.0) ;; java*1.2.1*) AC_MSG_RESULT(1.2.1) ;; java*1.2.2*) AC_MSG_RESULT(1.2.2) ;; java*1.2*) AC_MSG_RESULT(1.2) ;; java*1.3.0*) AC_MSG_RESULT(1.3.0) ;; java*1.3.1*) AC_MSG_RESULT(1.3.1) ;; java*1.3*) AC_MSG_RESULT(1.3) ;; java*1.4.0-beta*) AC_MSG_RESULT(1.4.0-beta) ;; java*1.4*) AC_MSG_RESULT(1.4) ;; *) AC_MSG_ERROR(unknown Java version) ;; esac dnl jikes/javac test -z "$JAVAC" && AC_CHECK_PROGS(JAVAC, jikes) test -z "$JAVAC" && JAVAC=$JDK/bin/javac if test "$JAVAC" = jikes; then JAVACFLAGS="+D +F" fi AC_SUBST(JAVACFLAGS) dnl fastjar/jar test -z "$JAR" && AC_CHECK_PROGS(JAR, fastjar) test -z "$JAR" && JAR=$JDK/bin/jar AC_SUBST(JAR) dnl Java runtime classes (including Swing). case "$JAVA_VERSION" in java*1.2*) JAVA_RUNTIME=$JDK/jre/lib/rt.jar ;; java*1.3*) JAVA_RUNTIME=$JDK/jre/lib/rt.jar ;; java*1.4*) JAVA_RUNTIME=$JDK/jre/lib/rt.jar ;; *) ;; esac AC_SUBST(JAVA_RUNTIME) dnl Make prefix explicit. test "x$prefix" = xNONE && prefix=/usr/local dnl Make datadir explicit. eval "datadir=$datadir" dnl Construct command line for shell script. dnl Places to look for j. JPATH=$srcdir/src:$datadir/j/j.jar case "$JAVA_VERSION" in java*1.1.*) CP="-classpath" CLASSPATH="$JPATH:$JAVA_RUNTIME" ;; java*1.2*) CP="-cp" CLASSPATH="$JPATH" ;; java*1.3*) CP="-cp" CLASSPATH="$JPATH" ;; java*1.4*) CP="-cp" CLASSPATH="$JPATH" ;; *) ;; esac AC_SUBST(CP) AC_SUBST(CLASSPATH) COMPILER_CLASSPATH="$srcdir/src:$JAVA_RUNTIME" AC_SUBST(COMPILER_CLASSPATH) dnl Runtime options to be passed to java AC_ARG_WITH(options, [ --with-options=OPTIONS runtime options to be passed to java (e.g. -server) ], [ JAVA_OPTIONS=${with_options} ]) AC_SUBST(JAVA_OPTIONS) dnl Extensions (JIMI etc.) AC_ARG_WITH(extensions, [ --with-extensions=PATH extensions to CLASSPATH (JIMI, Xerces, etc.) ], [ EXTENSIONS=${with_extensions} ]) if test $EXTENSIONS; then CLASSPATH="$CLASSPATH:$EXTENSIONS" COMPILER_CLASSPATH="$COMPILER_CLASSPATH:$EXTENSIONS" fi if test $CYGWIN; then JAVA_RUNTIME=`cygpath -p -w $JAVA_RUNTIME` CLASSPATH=`cygpath -p -w $CLASSPATH` COMPILER_CLASSPATH=`cygpath -p -w $COMPILER_CLASSPATH` fi dnl jpty AC_ARG_ENABLE(jpty, [ --enable-jpty build and install jpty --disable-jpty do not build or install jpty (default)]) if test "$enable_jpty" = "yes"; then if test $CYGWIN; then JPTY=jpty.exe else JPTY=jpty fi fi AC_SUBST(JPTY) dnl debug AC_ARG_ENABLE(debug, [ --enable-debug enable run-time debugging --disable-debug disable run-time debugging (default)]) case "$enable_debug" in "") ;; no) JAVACFLAGS="$JAVACFLAGS -O" ;; *) JAVACFLAGS="$JAVACFLAGS -g" ;; esac AC_OUTPUT([ Makefile src/Makefile src/jpty/Makefile src/bsh/Makefile src/bsh/classpath/Makefile src/bsh/commands/Makefile src/bsh/reflect/Makefile src/gnu/regexp/Makefile src/org/xml/sax/Makefile src/org/xml/sax/helpers/Makefile src/org/xml/sax/ext/Makefile src/org/armedbear/j/Makefile src/org/armedbear/j/version src/org/armedbear/j/aelfred/Makefile src/org/armedbear/j/mail/Makefile j ]) AC_OUTPUT_COMMANDS([chmod 755 j]) dnl Write out j.bat. AC_OUTPUT_COMMANDS( [ if test $CYGWIN; then echo "\"`cygpath -w $JAVA`\" $CP \"$CLASSPATH\" $JIT Editor %1 %2 %3 %4 %5 %6 %7 %8 %9" > j.bat fi ])