1 dnl Used by aclocal to generate configure
3 dnl -----------------------------------------------------------
4 AC_DEFUN([CLASSPATH_FIND_JAVAC],
14 if test "x${user_specified_javac}" = x; then
15 AM_CONDITIONAL(FOUND_GCJ, test "x${GCJ}" != x)
16 AM_CONDITIONAL(FOUND_JIKES, test "x${JIKES}" != x)
17 AM_CONDITIONAL(FOUND_ECJ, test "x${ECJ}" != x)
19 AM_CONDITIONAL(FOUND_GCJ, test "x${user_specified_javac}" = xgcj)
20 AM_CONDITIONAL(FOUND_JIKES, test "x${user_specified_javac}" = xjikes)
21 AM_CONDITIONAL(FOUND_ECJ, test "x${user_specified_javac}" = xecj)
23 AM_CONDITIONAL(FOUND_KJC, test "x${user_specified_javac}" = xkjc)
24 AM_CONDITIONAL(FOUND_GCJX, test "x${user_specified_javac}" = xgcjx)
26 if test "x${GCJ}" = x && test "x${JIKES}" = x && test "x${user_specified_javac}" != xkjc && test "x${user_specified_javac}" != xgcjx; then
27 # FIXME: use autoconf error function
28 echo "configure: cannot find javac, try --with-gcj, --with-jikes, --with-kjc, or --with-gcjx" 1>&2
33 dnl -----------------------------------------------------------
34 AC_DEFUN([CLASSPATH_WITH_GCJ],
37 [AS_HELP_STRING(--with-gcj,bytecode compilation with gcj)],
39 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
40 CLASSPATH_CHECK_GCJ(${withval})
42 if test "x${withval}" != xno; then
46 user_specified_javac=gcj
54 dnl -----------------------------------------------------------
55 AC_DEFUN([CLASSPATH_CHECK_GCJ],
57 if test "x$1" != x; then
61 AC_PATH_PROG(GCJ, "$1")
64 AC_PATH_PROG(GCJ, "gcj")
66 dnl Test the given GCJ, but use it as C (!) compiler to check version
67 if test "x$GCJ" != x; then
68 AC_MSG_CHECKING([gcj version 4.0])
72 #error GCJ 4.0.0 or higher is required
75 $GCJ -E conftest.c > /dev/null
77 if test "x$gcj_4_result" = "x0"; then
78 AC_MSG_RESULT([4.0 or higher found])
80 AC_MSG_WARN([4.0 or higher required])
86 dnl -----------------------------------------------------------
87 AC_DEFUN([CLASSPATH_WITH_JIKES],
90 [AS_HELP_STRING(--with-jikes,bytecode compilation with jikes)],
92 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
93 CLASSPATH_CHECK_JIKES(${withval})
95 if test "x${withval}" != xno; then
99 user_specified_javac=jikes
102 CLASSPATH_CHECK_JIKES
107 dnl -----------------------------------------------------------
108 AC_DEFUN([CLASSPATH_CHECK_JIKES],
110 if test "x$1" != x; then
111 if test -f "$1"; then
114 AC_PATH_PROG(JIKES, "$1")
117 AC_PATH_PROG(JIKES, "jikes")
119 if test "x$JIKES" != "x"; then
120 dnl Require at least version 1.19
121 AC_MSG_CHECKING(jikes version)
122 JIKES_VERSION=`$JIKES --version | awk '/^Jikes Compiler/' | cut -d ' ' -f 5`
123 JIKES_VERSION_MAJOR=`echo "$JIKES_VERSION" | cut -d '.' -f 1`
124 JIKES_VERSION_MINOR=`echo "$JIKES_VERSION" | cut -d '.' -f 2`
125 if expr "$JIKES_VERSION_MAJOR" = 1 > /dev/null; then
126 if expr "$JIKES_VERSION_MINOR" \< 19 > /dev/null; then
130 if test "x$JIKES" != "x"; then
131 AC_MSG_RESULT($JIKES_VERSION)
133 AC_MSG_WARN($JIKES_VERSION: jikes 1.19 or higher required)
137 if test -n "`$JIKES --help 2>&1 | grep encoding`"; then
138 JIKESENCODING='-encoding UTF-8'
140 AC_SUBST(JIKESENCODING)
144 dnl -----------------------------------------------------------
145 AC_DEFUN([CLASSPATH_WITH_KJC],
148 [AS_HELP_STRING(--with-kjc,bytecode compilation with kjc)],
150 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
151 CLASSPATH_CHECK_KJC(${withval})
153 if test "x${withval}" != xno; then
157 user_specified_javac=kjc
165 dnl -----------------------------------------------------------
166 AC_DEFUN([CLASSPATH_CHECK_KJC],
168 if test "x$1" != x; then
169 if test -f "$1"; then
172 AC_PATH_PROG(KJC, "$1")
175 AC_PATH_PROG(KJC, "kJC")
179 dnl -----------------------------------------------------------
180 AC_DEFUN([CLASSPATH_WITH_GCJX],
183 [AS_HELP_STRING(--with-gcjx,bytecode compilation with gcjx)],
185 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
186 CLASSPATH_CHECK_GCJX(${withval})
188 if test "x${withval}" != xno; then
192 user_specified_javac=gcjx
200 dnl -----------------------------------------------------------
201 AC_DEFUN([CLASSPATH_CHECK_GCJX],
203 if test "x$1" != x; then
204 if test -f "$1"; then
207 AC_PATH_PROG(GCJX, "$1")
210 AC_PATH_PROG(GCJX, "gcjx")
214 dnl -----------------------------------------------------------
215 AC_DEFUN([CLASSPATH_WITH_JAVAH],
218 [AS_HELP_STRING(--with-javah,specify path or name of a javah-like program)],
220 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
221 CLASSPATH_CHECK_JAVAH(${withval})
223 CLASSPATH_CHECK_JAVAH
227 CLASSPATH_CHECK_JAVAH
229 AM_CONDITIONAL(USER_SPECIFIED_JAVAH, test "x${USER_JAVAH}" != x)
233 dnl -----------------------------------------------------------
234 dnl Checking for a javah like program
235 dnl -----------------------------------------------------------
236 AC_DEFUN([CLASSPATH_CHECK_JAVAH],
238 if test "x$1" != x; then
239 if test -f "$1"; then
242 AC_PATH_PROG(USER_JAVAH, "$1")
245 for javah_name in gcjh javah; do
246 AC_PATH_PROG(USER_JAVAH, "$javah_name")
247 if test "x${USER_JAVAH}" != x; then
253 # if test "x${USER_JAVAH}" = x; then
254 # echo "configure: cannot find javah" 1>&2
259 dnl -----------------------------------------------------------
260 dnl CLASSPATH_WITH_CLASSLIB - checks for user specified classpath additions
261 dnl -----------------------------------------------------------
262 AC_DEFUN([CLASSPATH_WITH_CLASSLIB],
264 AC_ARG_WITH([classpath],
265 [AS_HELP_STRING(--with-classpath,specify path to a classes.zip like file)],
267 if test "x${withval}" = xyes; then
268 # set user classpath to CLASSPATH from env
269 AC_MSG_CHECKING(for classlib)
270 USER_CLASSLIB=${CLASSPATH}
271 AC_SUBST(USER_CLASSLIB)
272 AC_MSG_RESULT(${USER_CLASSLIB})
273 conditional_with_classlib=true
274 elif test "x${withval}" != x && test "x${withval}" != xno; then
275 # set user classpath to specified value
276 AC_MSG_CHECKING(for classlib)
277 USER_CLASSLIB=${withval}
278 AC_SUBST(USER_CLASSLIB)
279 AC_MSG_RESULT(${withval})
280 conditional_with_classlib=true
283 [ conditional_with_classlib=false ])
284 AM_CONDITIONAL(USER_SPECIFIED_CLASSLIB, test "x${conditional_with_classlib}" = xtrue)
286 AC_ARG_WITH([vm-classes],
287 [AS_HELP_STRING(--with-vm-classes,specify path to VM override source files)], [vm_classes="$with_vm_classes"],
288 [vm_classes='${top_srcdir}/vm/reference'])
292 dnl -----------------------------------------------------------
293 dnl CLASSPATH_WITH_GLIBJ - specify what to install
294 dnl -----------------------------------------------------------
295 AC_DEFUN([CLASSPATH_WITH_GLIBJ],
297 AC_PATH_PROG(ZIP, zip)
299 [AS_HELP_STRING([--with-glibj],[define what to install (zip|flat|both|none|build) [default=zip]])],
301 if test "x${withval}" = xyes || test "x${withval}" = xzip; then
302 install_class_files=no
303 build_class_files=yes
305 elif test "x${withval}" = xboth; then
306 install_class_files=yes
307 build_class_files=yes
309 elif test "x${withval}" = xflat; then
310 install_class_files=yes
311 build_class_files=yes
313 elif test "x${withval}" = xno || test "x${withval}" = xnone; then
314 install_class_files=no
317 elif test "x${withval}" = xbuild; then
318 install_class_files=no
319 build_class_files=yes
322 AC_MSG_ERROR([unknown value given to --with-glibj])
326 install_class_files=no
329 AM_CONDITIONAL(INSTALL_GLIBJ_ZIP, test "x${use_zip}" = xyes)
330 AM_CONDITIONAL(INSTALL_CLASS_FILES, test "x${install_class_files}" = xyes)
331 AM_CONDITIONAL(BUILD_CLASS_FILES, test "x${build_class_files}" = xyes)
333 AC_ARG_ENABLE([examples],
334 [AS_HELP_STRING(--enable-examples,enable build of the examples [default=yes])],
335 [case "${enableval}" in
336 yes) EXAMPLESDIR="examples" ;;
337 no) EXAMPLESDIR="" ;;
338 *) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;;
340 [EXAMPLESDIR="examples"])
341 if test "x${use_zip}" = xno && test "x${install_class_files}" = xno; then
344 AC_SUBST(EXAMPLESDIR)
347 dnl -----------------------------------------------------------
348 dnl Enable generation of API documentation, with gjdoc if it
349 dnl has been compiled to an executable (or a suitable script
350 dnl is in your PATH) or using the argument as gjdoc executable.
351 dnl -----------------------------------------------------------
352 AC_DEFUN([CLASSPATH_WITH_GJDOC],
355 AS_HELP_STRING([--with-gjdoc],
356 [generate documentation using gjdoc (default is NO)]),
357 [if test "x${withval}" = xno; then
359 elif test "x${withval}" = xyes -o "x{withval}" = x; then
361 AC_PATH_PROG(GJDOC, gjdoc, "no")
362 if test "x${GJDOC}" = xno; then
363 AC_MSG_ERROR("gjdoc executable not found");
368 AC_CHECK_FILE(${GJDOC}, AC_SUBST(GJDOC),
369 AC_MSG_ERROR("Cannot use ${withval} as gjdoc executable since it doesn't exist"))
373 AM_CONDITIONAL(CREATE_API_DOCS, test "x${WITH_GJDOC}" = xyes)
376 dnl -----------------------------------------------------------
377 dnl Enable regeneration of parsers using jay
378 dnl http://www.informatik.uni-osnabrueck.de/alumni/bernd/jay/
379 dnl -----------------------------------------------------------
380 AC_DEFUN([REGEN_WITH_JAY],
383 [AS_HELP_STRING(--with-jay,Regenerate the parsers with jay must be given the path to the jay executable)],
385 if test -d "${withval}"; then
386 JAY_DIR_PATH="${withval}"
387 AC_PATH_PROG(JAY, jay, "no", ${JAY_DIR_PATH})
388 if test "x${JAY}" = xno; then
389 AC_MSG_ERROR("jay executable not found");
392 JAY_DIR_PATH=$(dirname "${withval}")
396 JAY_SKELETON="${JAY_DIR_PATH}/skeleton"
397 AC_CHECK_FILE(${JAY_SKELETON}, AC_SUBST(JAY_SKELETON),
398 AC_MSG_ERROR("Expected skeleton file in $(dirname ${withval})"))
404 AM_CONDITIONAL(REGEN_PARSERS, test "x${JAY_FOUND}" = xyes)
407 dnl -----------------------------------------------------------
408 AC_DEFUN([CLASSPATH_WITH_ECJ],
411 [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)],
413 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
414 CLASSPATH_CHECK_ECJ(${withval})
416 if test "x${withval}" != xno; then
420 user_specified_javac=ecj
428 dnl -----------------------------------------------------------
429 AC_DEFUN([CLASSPATH_CHECK_ECJ],
431 if test "x$1" != x; then
432 if test -f "$1"; then
435 AC_PATH_PROG(ECJ, "$1")
438 AC_PATH_PROG(ECJ, "ecj")