dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright (C) 1998-2003 Peter Graves dnl $Id: configure.in,v 1.153 2003-09-30 17:15:37 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.153 $) 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.20.1.16+ 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; elif test -x $JDK/Home/bin/java; then JAVA=$JDK/Home/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.4 or later is required) ;; java*1.2.*) AC_MSG_ERROR(Java 1.4 or later is required) ;; java*1.3*) AC_MSG_ERROR(Java 1.4 or later is required) ;; java*1.4*) AC_MSG_RESULT($JAVA_VERSION) ;; *) AC_MSG_ERROR(unknown Java version) ;; esac dnl jikes/javac test -z "$JAVAC" && AC_CHECK_PROGS(JAVAC, jikes) test -z "$JAVAC" && test -x $JDK/Home/bin/javac && JAVAC=$JDK/Home/bin/javac 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" && test -x $JDK/Home/bin/jar && JAR=$JDK/Home/bin/jar test -z "$JAR" && JAR=$JDK/bin/jar AC_SUBST(JAR) dnl Java runtime classes if test -f $JDK/jre/lib/rt.jar ; then JAVA_RUNTIME=$JDK/jre/lib/rt.jar elif test -f $JDK/jre/lib/core.jar ; then JAVA_RUNTIME="" for i in $JDK/jre/lib/*.jar ; do JAVA_RUNTIME=$JAVA_RUNTIME:$i ; done elif test -d $JDK/Classes ; then JAVA_RUNTIME="" for i in $JDK/Classes/*.jar ; do JAVA_RUNTIME=$JAVA_RUNTIME:$i ; done else AC_MSG_ERROR(unable to find Java runtime) fi if test -f $JDK/lib/tools.jar ; then JAVA_RUNTIME=$JAVA_RUNTIME:$JDK/lib/tools.jar fi 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 CP="-cp" CLASSPATH="$JPATH:$JDK/lib/tools.jar" 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)]) if test "$enable_debug" = "yes"; then JAVACFLAGS="$JAVACFLAGS -g" else JAVACFLAGS="$JAVACFLAGS -g:none" fi AC_OUTPUT([ Makefile src/Makefile src/jpty/Makefile src/gnu/regexp/Makefile src/org/armedbear/j/Makefile src/org/armedbear/j/version src/org/armedbear/j/mail/Makefile src/org/armedbear/j/jdb/Makefile src/org/armedbear/lisp/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 ])