source: trunk/j/configure.in @ 3452

Last change on this file since 3452 was 3452, checked in by piso, 20 years ago

0.20.1.14+

File size: 5.3 KB
Line 
1dnl  Process this file with autoconf to produce a configure script.
2dnl
3dnl  Copyright (C) 1998-2003 Peter Graves
4dnl  $Id: configure.in,v 1.148 2003-08-20 15:59:53 piso Exp $
5dnl
6dnl  This program is free software; you can redistribute it and/or
7dnl  modify it under the terms of the GNU General Public License
8dnl  as published by the Free Software Foundation; either version 2
9dnl  of the License, or (at your option) any later version.
10dnl
11dnl  This program is distributed in the hope that it will be useful,
12dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
13dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14dnl  GNU General Public License for more details.
15dnl
16dnl  You should have received a copy of the GNU General Public License
17dnl  along with this program; if not, write to the Free Software
18dnl  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20AC_REVISION($Revision: 1.148 $)
21
22BOOTFILE=./configure-options
23
24if test -f "${BOOTFILE}" && test -z "${IN_BOOT}" ; then
25    echo "reading options from ${BOOTFILE}"
26    IN_BOOT=1 $0 `cat ${BOOTFILE}` $*
27    exit $?
28fi
29
30AC_INIT(j.in)
31
32AC_PROG_INSTALL
33
34version=0.20.1.14+
35AC_SUBST(version)
36
37if test $OSTYPE = cygwin32 || test $OSTYPE = cygwin ; then
38    CYGWIN=yes
39    PATHSEP=";"
40else
41    PATHSEP=":"
42fi
43AC_SUBST(PATHSEP)
44
45
46dnl  Make srcdir absolute.
47
48case "${srcdir}" in
49    /*)
50        ;;
51    .)
52        unset CDPATH
53        if test "${PWD}" != "" && test "`(cd ${PWD}; sh -c pwd)`" = "`pwd`"; then
54            srcdir="$PWD"
55        else
56            srcdir="`(cd ${srcdir}; pwd)`"
57        fi
58        ;;
59    *)
60        srcdir="`(cd ${srcdir}; pwd)`"
61        ;;
62esac
63
64
65dnl  User -must- specify location of JDK.
66AC_ARG_WITH(jdk,
67[  --with-jdk=DIR          JDK you want to use ],
68[
69    JDK=${with_jdk}
70],
71[
72    AC_MSG_ERROR([no jdk specified; use --with-jdk])
73])
74
75dnl  Remove trailing '/' (if any).
76JDK=`echo $JDK | sed -e 's/\/$//'`
77
78if test -x $JDK/bin/java; then
79    JAVA=$JDK/bin/java;
80elif test -x $JDK/jre/bin/java; then
81    JAVA=$JDK/jre/bin/java;
82else
83    AC_MSG_ERROR(Java not found)
84fi
85AC_SUBST(JAVA)
86
87
88dnl  Java version.
89
90AC_MSG_CHECKING(Java version)
91JAVA_VERSION=`$JAVA -version 2>&1`
92
93case "$JAVA_VERSION" in
94    java*1.1*)
95        AC_MSG_ERROR(Java 1.4 or later is required)
96        ;;
97    java*1.2.*)
98        AC_MSG_ERROR(Java 1.4 or later is required)
99        ;;
100    java*1.3*)
101        AC_MSG_ERROR(Java 1.4 or later is required)
102        ;;
103    java*1.4*)
104        AC_MSG_RESULT($JAVA_VERSION)
105        ;;
106    *)
107        AC_MSG_ERROR(unknown Java version)
108        ;;
109esac
110
111
112dnl  jikes/javac
113
114test -z "$JAVAC" && AC_CHECK_PROGS(JAVAC, jikes)
115test -z "$JAVAC" && JAVAC=$JDK/bin/javac
116if test "$JAVAC" = jikes; then
117    JAVACFLAGS="+D +F"
118fi
119AC_SUBST(JAVACFLAGS)
120
121
122dnl  fastjar/jar
123
124test -z "$JAR" && AC_CHECK_PROGS(JAR, fastjar)
125test -z "$JAR" && JAR=$JDK/bin/jar
126AC_SUBST(JAR)
127
128
129dnl  Java runtime classes
130if test -f $JDK/jre/lib/rt.jar ; then
131    JAVA_RUNTIME=$JDK/jre/lib/rt.jar
132elif test -f $JDK/jre/lib/core.jar ; then
133    JAVA_RUNTIME=""
134    for i in $JDK/jre/lib/*.jar ; do JAVA_RUNTIME=$JAVA_RUNTIME:$i ; done
135else
136    AC_MSG_ERROR(unable to find Java runtime)
137fi
138if test -f $JDK/lib/tools.jar ; then
139    JAVA_RUNTIME=$JAVA_RUNTIME:$JDK/lib/tools.jar
140fi
141AC_SUBST(JAVA_RUNTIME)
142
143
144dnl  Make prefix explicit.
145test "x$prefix" = xNONE && prefix=/usr/local
146
147
148dnl  Make datadir explicit.
149eval "datadir=$datadir"
150
151
152dnl  Construct command line for shell script.
153
154dnl  Places to look for j.
155JPATH=$srcdir/src:$datadir/j/j.jar
156
157CP="-cp"
158CLASSPATH="$JPATH:$JDK/lib/tools.jar"
159AC_SUBST(CP)
160AC_SUBST(CLASSPATH)
161
162COMPILER_CLASSPATH="$srcdir/src:$JAVA_RUNTIME"
163AC_SUBST(COMPILER_CLASSPATH)
164
165dnl  Runtime options to be passed to java
166AC_ARG_WITH(options,
167[  --with-options=OPTIONS  runtime options to be passed to java (e.g. -server) ],
168[
169    JAVA_OPTIONS=${with_options}
170])
171AC_SUBST(JAVA_OPTIONS)
172
173dnl  Extensions (JIMI etc.)
174AC_ARG_WITH(extensions,
175[  --with-extensions=PATH  extensions to CLASSPATH (JIMI, Xerces, etc.) ],
176[
177    EXTENSIONS=${with_extensions}
178])
179
180if test $EXTENSIONS; then
181    CLASSPATH="$CLASSPATH:$EXTENSIONS"
182    COMPILER_CLASSPATH="$COMPILER_CLASSPATH:$EXTENSIONS"
183fi
184
185if test $CYGWIN; then
186    JAVA_RUNTIME=`cygpath -p -w $JAVA_RUNTIME`
187    CLASSPATH=`cygpath -p -w $CLASSPATH`
188    COMPILER_CLASSPATH=`cygpath -p -w $COMPILER_CLASSPATH`
189fi
190
191dnl jpty
192
193AC_ARG_ENABLE(jpty,
194[  --enable-jpty           build and install jpty
195  --disable-jpty          do not build or install jpty (default)])
196
197if test "$enable_jpty" = "yes"; then
198    if test $CYGWIN; then
199        JPTY=jpty.exe
200    else
201        JPTY=jpty
202    fi
203fi
204
205AC_SUBST(JPTY)
206
207dnl debug
208
209AC_ARG_ENABLE(debug,
210[  --enable-debug          enable run-time debugging
211  --disable-debug         disable run-time debugging (default)])
212
213if test "$enable_debug" = "yes"; then
214    JAVACFLAGS="$JAVACFLAGS -g"
215else
216    JAVACFLAGS="$JAVACFLAGS -g:none"
217fi
218
219
220AC_OUTPUT([
221Makefile
222src/Makefile
223src/jpty/Makefile
224src/gnu/regexp/Makefile
225src/org/armedbear/j/Makefile
226src/org/armedbear/j/version
227src/org/armedbear/j/mail/Makefile
228src/org/armedbear/j/jdb/Makefile
229src/org/armedbear/lisp/Makefile
230j
231])
232
233AC_OUTPUT_COMMANDS([chmod 755 j])
234
235
236dnl  Write out j.bat.
237
238AC_OUTPUT_COMMANDS(
239[
240    if test $CYGWIN; then
241        echo "\"`cygpath -w $JAVA`\" $CP \"$CLASSPATH\" $JIT Editor %1 %2 %3 %4 %5 %6 %7 %8 %9" > j.bat
242    fi
243])
Note: See TracBrowser for help on using the repository browser.