source: trunk/j/configure.ac @ 4756

Last change on this file since 4756 was 4756, checked in by piso, 18 years ago

0.20.2.2

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