1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | dnl |
---|
3 | dnl Copyright (C) 1998-2002 Peter Graves |
---|
4 | dnl $Id: configure.in,v 1.4 2002-11-19 00:41:44 piso Exp $ |
---|
5 | dnl |
---|
6 | dnl This program is free software; you can redistribute it and/or |
---|
7 | dnl modify it under the terms of the GNU General Public License |
---|
8 | dnl as published by the Free Software Foundation; either version 2 |
---|
9 | dnl of the License, or (at your option) any later version. |
---|
10 | dnl |
---|
11 | dnl This program is distributed in the hope that it will be useful, |
---|
12 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | dnl GNU General Public License for more details. |
---|
15 | dnl |
---|
16 | dnl You should have received a copy of the GNU General Public License |
---|
17 | dnl along with this program; if not, write to the Free Software |
---|
18 | dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | |
---|
20 | AC_REVISION($Revision: 1.4 $) |
---|
21 | |
---|
22 | BOOTFILE=./configure-options |
---|
23 | |
---|
24 | if test -f "${BOOTFILE}" && test -z "${IN_BOOT}" ; then |
---|
25 | echo "reading options from ${BOOTFILE}" |
---|
26 | IN_BOOT=1 $0 `cat ${BOOTFILE}` $* |
---|
27 | exit $? |
---|
28 | fi |
---|
29 | |
---|
30 | AC_INIT(j.in) |
---|
31 | |
---|
32 | AC_PROG_INSTALL |
---|
33 | |
---|
34 | version=0.17.2 |
---|
35 | AC_SUBST(version) |
---|
36 | |
---|
37 | if test $OSTYPE = cygwin32 || test $OSTYPE = cygwin ; then |
---|
38 | CYGWIN=yes |
---|
39 | PATHSEP=";" |
---|
40 | else |
---|
41 | PATHSEP=":" |
---|
42 | fi |
---|
43 | AC_SUBST(PATHSEP) |
---|
44 | |
---|
45 | |
---|
46 | dnl Make srcdir absolute. |
---|
47 | |
---|
48 | case "${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 | ;; |
---|
62 | esac |
---|
63 | |
---|
64 | |
---|
65 | dnl User -must- specify location of JDK. |
---|
66 | AC_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 | |
---|
75 | dnl Remove trailing '/' (if any). |
---|
76 | JDK=`echo $JDK | sed -e 's/\/$//'` |
---|
77 | |
---|
78 | if test -x $JDK/bin/java; then |
---|
79 | JAVA=$JDK/bin/java; |
---|
80 | elif test -x $JDK/jre/bin/java; then |
---|
81 | JAVA=$JDK/jre/bin/java; |
---|
82 | else |
---|
83 | AC_MSG_ERROR(java not found) |
---|
84 | fi |
---|
85 | AC_SUBST(JAVA) |
---|
86 | |
---|
87 | |
---|
88 | dnl Java version. |
---|
89 | |
---|
90 | AC_MSG_CHECKING(Java version) |
---|
91 | JAVA_VERSION=`$JAVA -version 2>&1` |
---|
92 | |
---|
93 | case "$JAVA_VERSION" in |
---|
94 | java*1.1*) |
---|
95 | AC_MSG_ERROR(Java 1.2 or later is required) |
---|
96 | ;; |
---|
97 | java*1.2.0*) |
---|
98 | AC_MSG_RESULT(1.2.0) |
---|
99 | ;; |
---|
100 | java*1.2.1*) |
---|
101 | AC_MSG_RESULT(1.2.1) |
---|
102 | ;; |
---|
103 | java*1.2.2*) |
---|
104 | AC_MSG_RESULT(1.2.2) |
---|
105 | ;; |
---|
106 | java*1.2*) |
---|
107 | AC_MSG_RESULT(1.2) |
---|
108 | ;; |
---|
109 | java*1.3.0*) |
---|
110 | AC_MSG_RESULT(1.3.0) |
---|
111 | ;; |
---|
112 | java*1.3.1*) |
---|
113 | AC_MSG_RESULT(1.3.1) |
---|
114 | ;; |
---|
115 | java*1.3*) |
---|
116 | AC_MSG_RESULT(1.3) |
---|
117 | ;; |
---|
118 | java*1.4.0-beta*) |
---|
119 | AC_MSG_RESULT(1.4.0-beta) |
---|
120 | ;; |
---|
121 | java*1.4*) |
---|
122 | AC_MSG_RESULT(1.4) |
---|
123 | ;; |
---|
124 | *) |
---|
125 | AC_MSG_ERROR(unknown Java version) |
---|
126 | ;; |
---|
127 | esac |
---|
128 | |
---|
129 | |
---|
130 | dnl jikes/javac |
---|
131 | |
---|
132 | test -z "$JAVAC" && AC_CHECK_PROGS(JAVAC, jikes) |
---|
133 | test -z "$JAVAC" && JAVAC=$JDK/bin/javac |
---|
134 | if test "$JAVAC" = jikes; then |
---|
135 | JAVACFLAGS="+D +F" |
---|
136 | fi |
---|
137 | AC_SUBST(JAVACFLAGS) |
---|
138 | |
---|
139 | |
---|
140 | dnl fastjar/jar |
---|
141 | |
---|
142 | test -z "$JAR" && AC_CHECK_PROGS(JAR, fastjar) |
---|
143 | test -z "$JAR" && JAR=$JDK/bin/jar |
---|
144 | AC_SUBST(JAR) |
---|
145 | |
---|
146 | |
---|
147 | dnl Java runtime classes (including Swing). |
---|
148 | |
---|
149 | case "$JAVA_VERSION" in |
---|
150 | java*1.2*) |
---|
151 | JAVA_RUNTIME=$JDK/jre/lib/rt.jar |
---|
152 | ;; |
---|
153 | java*1.3*) |
---|
154 | JAVA_RUNTIME=$JDK/jre/lib/rt.jar |
---|
155 | ;; |
---|
156 | java*1.4*) |
---|
157 | JAVA_RUNTIME=$JDK/jre/lib/rt.jar |
---|
158 | ;; |
---|
159 | *) |
---|
160 | ;; |
---|
161 | esac |
---|
162 | AC_SUBST(JAVA_RUNTIME) |
---|
163 | |
---|
164 | |
---|
165 | dnl Make prefix explicit. |
---|
166 | test "x$prefix" = xNONE && prefix=/usr/local |
---|
167 | |
---|
168 | |
---|
169 | dnl Make datadir explicit. |
---|
170 | eval "datadir=$datadir" |
---|
171 | |
---|
172 | |
---|
173 | dnl Construct command line for shell script. |
---|
174 | |
---|
175 | dnl Places to look for j. |
---|
176 | JPATH=$srcdir/src:$datadir/j/j.jar |
---|
177 | |
---|
178 | case "$JAVA_VERSION" in |
---|
179 | java*1.1.*) |
---|
180 | CP="-classpath" |
---|
181 | CLASSPATH="$JPATH:$JAVA_RUNTIME" |
---|
182 | ;; |
---|
183 | java*1.2*) |
---|
184 | CP="-cp" |
---|
185 | CLASSPATH="$JPATH" |
---|
186 | ;; |
---|
187 | java*1.3*) |
---|
188 | CP="-cp" |
---|
189 | CLASSPATH="$JPATH" |
---|
190 | ;; |
---|
191 | java*1.4*) |
---|
192 | CP="-cp" |
---|
193 | CLASSPATH="$JPATH" |
---|
194 | ;; |
---|
195 | *) |
---|
196 | ;; |
---|
197 | esac |
---|
198 | AC_SUBST(CP) |
---|
199 | AC_SUBST(CLASSPATH) |
---|
200 | |
---|
201 | COMPILER_CLASSPATH="$srcdir/src:$JAVA_RUNTIME" |
---|
202 | AC_SUBST(COMPILER_CLASSPATH) |
---|
203 | |
---|
204 | dnl Runtime options to be passed to java |
---|
205 | AC_ARG_WITH(options, |
---|
206 | [ --with-options=OPTIONS runtime options to be passed to java (e.g. -server) ], |
---|
207 | [ |
---|
208 | JAVA_OPTIONS=${with_options} |
---|
209 | ]) |
---|
210 | AC_SUBST(JAVA_OPTIONS) |
---|
211 | |
---|
212 | dnl Extensions (JIMI etc.) |
---|
213 | AC_ARG_WITH(extensions, |
---|
214 | [ --with-extensions=PATH extensions to CLASSPATH (JIMI, Xerces, etc.) ], |
---|
215 | [ |
---|
216 | EXTENSIONS=${with_extensions} |
---|
217 | ]) |
---|
218 | |
---|
219 | if test $EXTENSIONS; then |
---|
220 | CLASSPATH="$CLASSPATH:$EXTENSIONS" |
---|
221 | COMPILER_CLASSPATH="$COMPILER_CLASSPATH:$EXTENSIONS" |
---|
222 | fi |
---|
223 | |
---|
224 | if test $CYGWIN; then |
---|
225 | JAVA_RUNTIME=`cygpath -p -w $JAVA_RUNTIME` |
---|
226 | CLASSPATH=`cygpath -p -w $CLASSPATH` |
---|
227 | COMPILER_CLASSPATH=`cygpath -p -w $COMPILER_CLASSPATH` |
---|
228 | fi |
---|
229 | |
---|
230 | dnl jpty |
---|
231 | |
---|
232 | AC_ARG_ENABLE(jpty, |
---|
233 | [ --enable-jpty build and install jpty |
---|
234 | --disable-jpty do not build or install jpty (default)]) |
---|
235 | |
---|
236 | if test "$enable_jpty" = "yes"; then |
---|
237 | if test $CYGWIN; then |
---|
238 | JPTY=jpty.exe |
---|
239 | else |
---|
240 | JPTY=jpty |
---|
241 | fi |
---|
242 | fi |
---|
243 | |
---|
244 | AC_SUBST(JPTY) |
---|
245 | |
---|
246 | dnl debug |
---|
247 | |
---|
248 | AC_ARG_ENABLE(debug, |
---|
249 | [ --enable-debug enable run-time debugging |
---|
250 | --disable-debug disable run-time debugging (default)]) |
---|
251 | |
---|
252 | case "$enable_debug" in |
---|
253 | "") |
---|
254 | ;; |
---|
255 | no) |
---|
256 | JAVACFLAGS="$JAVACFLAGS -O" |
---|
257 | ;; |
---|
258 | *) |
---|
259 | JAVACFLAGS="$JAVACFLAGS -g" |
---|
260 | ;; |
---|
261 | esac |
---|
262 | |
---|
263 | |
---|
264 | AC_OUTPUT([ |
---|
265 | Makefile |
---|
266 | src/Makefile |
---|
267 | src/jpty/Makefile |
---|
268 | src/bsh/Makefile |
---|
269 | src/bsh/classpath/Makefile |
---|
270 | src/bsh/commands/Makefile |
---|
271 | src/bsh/reflect/Makefile |
---|
272 | src/gnu/regexp/Makefile |
---|
273 | src/org/xml/sax/Makefile |
---|
274 | src/org/xml/sax/helpers/Makefile |
---|
275 | src/org/xml/sax/ext/Makefile |
---|
276 | src/org/armedbear/j/Makefile |
---|
277 | src/org/armedbear/j/version |
---|
278 | src/org/armedbear/j/aelfred/Makefile |
---|
279 | src/org/armedbear/j/mail/Makefile |
---|
280 | j |
---|
281 | ]) |
---|
282 | |
---|
283 | AC_OUTPUT_COMMANDS([chmod 755 j]) |
---|
284 | |
---|
285 | |
---|
286 | dnl Write out j.bat. |
---|
287 | |
---|
288 | AC_OUTPUT_COMMANDS( |
---|
289 | [ |
---|
290 | if test $CYGWIN; then |
---|
291 | echo "\"`cygpath -w $JAVA`\" $CP \"$CLASSPATH\" $JIT Editor %1 %2 %3 %4 %5 %6 %7 %8 %9" > j.bat |
---|
292 | fi |
---|
293 | ]) |
---|