source: trunk/j/configure.ac @ 7933

Last change on this file since 7933 was 7933, checked in by piso, 17 years ago

jikes

File size: 6.4 KB
Line 
1dnl  Process this file with autoconf to produce a configure script.
2dnl
3dnl  Copyright (C) 1998-2004 Peter Graves
4dnl  $Id: configure.ac,v 1.66 2004-10-09 00:02:02 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.66 $)
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.21.0+
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;
82elif test -x $JDK/Home/bin/java; then
83    JAVA=$JDK/Home/bin/java;
84else
85    AC_MSG_ERROR(Java not found)
86fi
87AC_SUBST(JDK)
88AC_SUBST(JAVA)
89
90
91dnl  Java version.
92
93AC_MSG_CHECKING(Java version)
94JAVA_VERSION=`$JAVA -version 2>&1`
95
96case "$JAVA_VERSION" in
97    java*1.1*)
98        AC_MSG_ERROR(Java 1.4 or later is required)
99        ;;
100    java*1.2.*)
101        AC_MSG_ERROR(Java 1.4 or later is required)
102        ;;
103    java*1.3*)
104        AC_MSG_ERROR(Java 1.4 or later is required)
105        ;;
106    java*1.4*)
107        AC_MSG_RESULT($JAVA_VERSION)
108        ;;
109    java*1.5*)
110        AC_MSG_RESULT($JAVA_VERSION)
111        ;;
112    *)
113        AC_MSG_ERROR(unknown Java version)
114        ;;
115esac
116
117
118dnl  jikes/javac
119
120test -z "$JAVAC" && test -x $JDK/Home/bin/javac && JAVAC=$JDK/Home/bin/javac
121test -z "$JAVAC" && JAVAC=$JDK/bin/javac
122AC_SUBST(JAVAC)
123test "$JAVAC" = jikes && JAVACFLAGS="+D +F"
124AC_SUBST(JAVACFLAGS)
125
126dnl javah
127
128JAVAH=$JDK/bin/javah
129AC_SUBST(JAVAH)
130
131
132dnl  fastjar/jar
133
134test -z "$JAR" && AC_CHECK_PROGS(JAR, fastjar)
135test -z "$JAR" && test -x $JDK/Home/bin/jar && JAR=$JDK/Home/bin/jar
136test -z "$JAR" && JAR=$JDK/bin/jar
137AC_SUBST(JAR)
138
139
140dnl  Location of Lisp source files.
141LISP_HOME=$srcdir/src/org/armedbear/lisp
142AC_SUBST(LISP_HOME)
143
144
145dnl  Make prefix explicit.
146test "x$prefix" = xNONE && prefix=/usr/local
147
148dnl  Make prefix explicit.
149test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
150
151dnl  Make datadir and libdir explicit.
152eval "datadir=$datadir"
153eval "libdir=$libdir"
154
155dnl Library path for libabcl.so.
156ABCL_LIBPATH=$LISP_HOME:$libdir/abcl
157AC_SUBST(ABCL_LIBPATH)
158
159dnl  Java runtime classes and options
160if test -f $JDK/jre/lib/rt.jar ; then
161    # SUN
162    JAVA_RUNTIME=$JDK/jre/lib/rt.jar
163    ABCL_JAVA_OPTIONS="-server -Xmx128M"
164elif test -f $JDK/jre/lib/core.jar ; then
165    # IBM
166    JAVA_RUNTIME=""
167    for i in $JDK/jre/lib/*.jar ; do JAVA_RUNTIME=$JAVA_RUNTIME:$i ; done
168    ABCL_JAVA_OPTIONS="-Xss512K -Xmx128M"
169elif test -d $JDK/Classes ; then
170    # Mac OS X
171    JAVA_RUNTIME=""
172    for i in $JDK/Classes/*.jar ; do JAVA_RUNTIME=$JAVA_RUNTIME:$i ; done
173    ABCL_JAVA_OPTIONS="-server"
174else
175    AC_MSG_ERROR(unable to find Java runtime)
176fi
177if test -f $JDK/lib/tools.jar ; then
178    JAVA_RUNTIME=$JAVA_RUNTIME:$JDK/lib/tools.jar
179fi
180AC_SUBST(JAVA_RUNTIME)
181AC_SUBST(ABCL_JAVA_OPTIONS)
182
183
184dnl  Construct command line for shell script.
185
186dnl  Places to look for j.
187JPATH=$srcdir/src:$datadir/j/j.jar
188
189CP="-cp"
190CLASSPATH="$JPATH:$JDK/lib/tools.jar"
191ABCL_CLASSPATH=$JPATH
192AC_SUBST(CP)
193AC_SUBST(CLASSPATH)
194AC_SUBST(ABCL_CLASSPATH)
195
196COMPILER_CLASSPATH="$srcdir/src:$JAVA_RUNTIME"
197AC_SUBST(COMPILER_CLASSPATH)
198
199dnl  Runtime options to be passed to java
200AC_ARG_WITH(options,
201[  --with-options=OPTIONS  runtime options to be passed to java (e.g. -server) ],
202[
203    JAVA_OPTIONS=${with_options}
204])
205AC_SUBST(JAVA_OPTIONS)
206
207dnl  Extensions (JIMI etc.)
208AC_ARG_WITH(extensions,
209[  --with-extensions=PATH  extensions to CLASSPATH (JIMI, Xerces, etc.) ],
210[
211    EXTENSIONS=${with_extensions}
212])
213
214if test $EXTENSIONS; then
215    CLASSPATH="$CLASSPATH:$EXTENSIONS"
216    COMPILER_CLASSPATH="$COMPILER_CLASSPATH:$EXTENSIONS"
217fi
218
219if test $CYGWIN; then
220    JAVA_RUNTIME=`cygpath -p -w $JAVA_RUNTIME`
221    CLASSPATH=`cygpath -p -w $CLASSPATH`
222    COMPILER_CLASSPATH=`cygpath -p -w $COMPILER_CLASSPATH`
223fi
224
225dnl jpty
226
227AC_ARG_ENABLE(jpty,
228[  --enable-jpty           build and install jpty
229  --disable-jpty          do not build or install jpty (default)])
230
231if test "$enable_jpty" = "yes"; then
232    if test $CYGWIN; then
233        JPTY=jpty.exe
234    else
235        JPTY=jpty
236    fi
237fi
238
239AC_SUBST(JPTY)
240
241dnl libabcl
242
243AC_ARG_ENABLE(libabcl,
244[  --enable-libabcl        build and install libabcl.so
245  --disable-libabcl       do not build or install libabcl.so (default)])
246
247if test "$enable_libabcl" = "yes"; then
248    LIBABCL=libabcl.so
249fi
250
251AC_SUBST(LIBABCL)
252
253dnl debug
254
255AC_ARG_ENABLE(debug,
256[  --enable-debug          enable run-time debugging
257  --disable-debug         disable run-time debugging (default)])
258
259if test "$enable_debug" = "yes"; then
260    JAVACFLAGS="$JAVACFLAGS -g"
261else
262    JAVACFLAGS="$JAVACFLAGS -g:none"
263fi
264
265
266AC_CONFIG_FILES([
267Makefile
268src/Makefile
269src/jpty/Makefile
270src/gnu/regexp/Makefile
271src/org/armedbear/j/Makefile
272src/org/armedbear/j/version
273src/org/armedbear/j/mail/Makefile
274src/org/armedbear/j/jdb/Makefile
275src/org/armedbear/lisp/Makefile
276src/org/armedbear/lisp/java/awt/Makefile
277j
278abcl
279])
280
281AC_CONFIG_COMMANDS([chmod], [chmod 755 j; chmod 755 abcl])
282
283AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.