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