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