source: trunk/j/configure.in @ 1506

Last change on this file since 1506 was 1506, checked in by piso, 19 years ago

0.18.1

File size: 5.8 KB
Line 
1dnl  Process this file with autoconf to produce a configure script.
2dnl
3dnl  Copyright (C) 1998-2002 Peter Graves
4dnl  $Id: configure.in,v 1.17 2003-03-31 19:15:43 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.17 $)
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.18.1
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.3 or later is required)
96        ;;
97    java*1.2.*)
98        AC_MSG_ERROR(Java 1.3 or later is required)
99        ;;
100    java*1.3.0*)
101        AC_MSG_RESULT(1.3.0)
102        ;;
103    java*1.3.1*)
104        AC_MSG_RESULT(1.3.1)
105        ;;
106    java*1.3*)
107        AC_MSG_RESULT(1.3)
108        ;;
109    java*1.4*)
110        AC_MSG_RESULT(1.4)
111        ;;
112    *)
113        AC_MSG_ERROR(unknown Java version)
114        ;;
115esac
116
117
118dnl  jikes/javac
119
120test -z "$JAVAC" && AC_CHECK_PROGS(JAVAC, jikes)
121test -z "$JAVAC" && JAVAC=$JDK/bin/javac
122if test "$JAVAC" = jikes; then
123    JAVACFLAGS="+D +F"
124fi
125AC_SUBST(JAVACFLAGS)
126
127
128dnl  fastjar/jar
129
130test -z "$JAR" && AC_CHECK_PROGS(JAR, fastjar)
131test -z "$JAR" && JAR=$JDK/bin/jar
132AC_SUBST(JAR)
133
134
135dnl  Java runtime classes (including Swing).
136
137case "$JAVA_VERSION" in
138    java*1.3*)
139        JAVA_RUNTIME=$JDK/jre/lib/rt.jar:$JDK/lib/tools.jar
140        ;;
141    java*1.4*)
142        JAVA_RUNTIME=$JDK/jre/lib/rt.jar:$JDK/lib/tools.jar
143        ;;
144    *)
145        ;;
146esac
147AC_SUBST(JAVA_RUNTIME)
148
149
150dnl  Make prefix explicit.
151test "x$prefix" = xNONE && prefix=/usr/local
152
153
154dnl  Make datadir explicit.
155eval "datadir=$datadir"
156
157
158dnl  Construct command line for shell script.
159
160dnl  Places to look for j.
161JPATH=$srcdir/src:$datadir/j/j.jar
162
163case "$JAVA_VERSION" in
164    java*1.1.*)
165        CP="-classpath"
166        CLASSPATH="$JPATH:$JAVA_RUNTIME"
167        ;;
168    java*1.2*)
169        CP="-cp"
170        CLASSPATH="$JPATH"
171        ;;
172    java*1.3*)
173        CP="-cp"
174        CLASSPATH="$JPATH"
175        ;;
176    java*1.4*)
177        CP="-cp"
178        CLASSPATH="$JPATH"
179        ;;
180    *)
181        ;;
182esac
183AC_SUBST(CP)
184AC_SUBST(CLASSPATH)
185
186COMPILER_CLASSPATH="$srcdir/src:$JAVA_RUNTIME"
187AC_SUBST(COMPILER_CLASSPATH)
188
189dnl  Runtime options to be passed to java
190AC_ARG_WITH(options,
191[  --with-options=OPTIONS  runtime options to be passed to java (e.g. -server) ],
192[
193    JAVA_OPTIONS=${with_options}
194])
195AC_SUBST(JAVA_OPTIONS)
196
197dnl  Extensions (JIMI etc.)
198AC_ARG_WITH(extensions,
199[  --with-extensions=PATH  extensions to CLASSPATH (JIMI, Xerces, etc.) ],
200[
201    EXTENSIONS=${with_extensions}
202])
203
204if test $EXTENSIONS; then
205    CLASSPATH="$CLASSPATH:$EXTENSIONS"
206    COMPILER_CLASSPATH="$COMPILER_CLASSPATH:$EXTENSIONS"
207fi
208
209if test $CYGWIN; then
210    JAVA_RUNTIME=`cygpath -p -w $JAVA_RUNTIME`
211    CLASSPATH=`cygpath -p -w $CLASSPATH`
212    COMPILER_CLASSPATH=`cygpath -p -w $COMPILER_CLASSPATH`
213fi
214
215dnl jpty
216
217AC_ARG_ENABLE(jpty,
218[  --enable-jpty           build and install jpty
219  --disable-jpty          do not build or install jpty (default)])
220
221if test "$enable_jpty" = "yes"; then
222    if test $CYGWIN; then
223        JPTY=jpty.exe
224    else
225        JPTY=jpty
226    fi
227fi
228
229AC_SUBST(JPTY)
230
231dnl debug
232
233AC_ARG_ENABLE(debug,
234[  --enable-debug          enable run-time debugging
235  --disable-debug         disable run-time debugging (default)])
236
237case "$enable_debug" in
238    "")
239        ;;
240    no)
241        JAVACFLAGS="$JAVACFLAGS -O"
242        ;;
243    *)
244        JAVACFLAGS="$JAVACFLAGS -g"
245        ;;
246esac
247
248
249AC_OUTPUT([
250Makefile
251src/Makefile
252src/jpty/Makefile
253src/bsh/Makefile
254src/bsh/classpath/Makefile
255src/bsh/commands/Makefile
256src/bsh/reflect/Makefile
257src/gnu/regexp/Makefile
258src/org/xml/sax/Makefile
259src/org/xml/sax/helpers/Makefile
260src/org/xml/sax/ext/Makefile
261src/org/armedbear/j/Makefile
262src/org/armedbear/j/version
263src/org/armedbear/j/aelfred/Makefile
264src/org/armedbear/j/mail/Makefile
265src/org/armedbear/j/jdb/Makefile
266src/org/armedbear/lisp/Makefile
267j
268])
269
270AC_OUTPUT_COMMANDS([chmod 755 j])
271
272
273dnl  Write out j.bat.
274
275AC_OUTPUT_COMMANDS(
276[
277    if test $CYGWIN; then
278        echo "\"`cygpath -w $JAVA`\" $CP \"$CLASSPATH\" $JIT Editor %1 %2 %3 %4 %5 %6 %7 %8 %9" > j.bat
279    fi
280])
Note: See TracBrowser for help on using the repository browser.