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 && test "x${user_specified_javac}" != xecj; then
27 # FIXME: use autoconf error function
28 echo "configure: cannot find javac, try --with-gcj, --with-jikes, --with-kjc, --with-ecj, 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)
142 JIKESWARNINGS="+Pno-switchcheck"
143 if test "x$JIKES_VERSION_MAJOR" = x"1" ; then
144 if ! test "x$JIKES_VERSION_MINOR" = x"19"; then
145 JIKESWARNINGS="$JIKESWARNINGS +Pno-shadow"
148 AC_SUBST(JIKESWARNINGS)
153 dnl -----------------------------------------------------------
154 AC_DEFUN([CLASSPATH_WITH_KJC],
157 [AS_HELP_STRING(--with-kjc,bytecode compilation with kjc)],
159 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
160 CLASSPATH_CHECK_KJC(${withval})
162 if test "x${withval}" != xno; then
166 user_specified_javac=kjc
174 dnl -----------------------------------------------------------
175 AC_DEFUN([CLASSPATH_CHECK_KJC],
177 if test "x$1" != x; then
178 if test -f "$1"; then
181 AC_PATH_PROG(KJC, "$1")
184 AC_PATH_PROG(KJC, "kJC")
188 dnl -----------------------------------------------------------
189 AC_DEFUN([CLASSPATH_WITH_GCJX],
192 [AS_HELP_STRING(--with-gcjx,bytecode compilation with gcjx)],
194 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
195 CLASSPATH_CHECK_GCJX(${withval})
197 if test "x${withval}" != xno; then
201 user_specified_javac=gcjx
209 dnl -----------------------------------------------------------
210 AC_DEFUN([CLASSPATH_CHECK_GCJX],
212 if test "x$1" != x; then
213 if test -f "$1"; then
216 AC_PATH_PROG(GCJX, "$1")
219 AC_PATH_PROG(GCJX, "gcjx")
223 dnl -----------------------------------------------------------
224 AC_DEFUN([CLASSPATH_WITH_JAVAH],
227 [AS_HELP_STRING(--with-javah,specify path or name of a javah-like program)],
229 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
230 CLASSPATH_CHECK_JAVAH(${withval})
232 CLASSPATH_CHECK_JAVAH
236 CLASSPATH_CHECK_JAVAH
238 AM_CONDITIONAL(USER_SPECIFIED_JAVAH, test "x${USER_JAVAH}" != x)
242 dnl -----------------------------------------------------------
243 dnl Checking for a javah like program
244 dnl -----------------------------------------------------------
245 AC_DEFUN([CLASSPATH_CHECK_JAVAH],
247 if test "x$1" != x; then
248 if test -f "$1"; then
251 AC_PATH_PROG(USER_JAVAH, "$1")
254 for javah_name in gcjh javah; do
255 AC_PATH_PROG(USER_JAVAH, "$javah_name")
256 if test "x${USER_JAVAH}" != x; then
262 # if test "x${USER_JAVAH}" = x; then
263 # echo "configure: cannot find javah" 1>&2
268 dnl -----------------------------------------------------------
269 dnl CLASSPATH_WITH_CLASSLIB - checks for user specified classpath additions
270 dnl -----------------------------------------------------------
271 AC_DEFUN([CLASSPATH_WITH_CLASSLIB],
273 AC_ARG_WITH([classpath],
274 [AS_HELP_STRING(--with-classpath,specify path to a classes.zip like file)],
276 if test "x${withval}" = xyes; then
277 # set user classpath to CLASSPATH from env
278 AC_MSG_CHECKING(for classlib)
279 USER_CLASSLIB=${CLASSPATH}
280 AC_SUBST(USER_CLASSLIB)
281 AC_MSG_RESULT(${USER_CLASSLIB})
282 conditional_with_classlib=true
283 elif test "x${withval}" != x && test "x${withval}" != xno; then
284 # set user classpath to specified value
285 AC_MSG_CHECKING(for classlib)
286 USER_CLASSLIB=${withval}
287 AC_SUBST(USER_CLASSLIB)
288 AC_MSG_RESULT(${withval})
289 conditional_with_classlib=true
292 [ conditional_with_classlib=false ])
293 AM_CONDITIONAL(USER_SPECIFIED_CLASSLIB, test "x${conditional_with_classlib}" = xtrue)
295 AC_ARG_WITH([vm-classes],
296 [AS_HELP_STRING(--with-vm-classes,specify path to VM override source files)], [vm_classes="$with_vm_classes"],
297 [vm_classes='${top_srcdir}/vm/reference'])
301 dnl -----------------------------------------------------------
302 dnl CLASSPATH_WITH_GLIBJ - specify what to install
303 dnl -----------------------------------------------------------
304 AC_DEFUN([CLASSPATH_WITH_GLIBJ],
306 AC_PATH_PROG(ZIP, zip)
307 AC_ARG_WITH([fastjar],
308 [AS_HELP_STRING([--with-fastjar=PATH], [define to use a fastjar style tool])],
310 AC_MSG_CHECKING([for user supplied fastjar])
312 AC_MSG_RESULT([${FASTJAR}])
314 [AC_PATH_PROG(FASTJAR, fastjar)])
315 dnl We disable ZIP by default if we find fastjar.
316 if test x"${FASTJAR}" != x; then
321 [AS_HELP_STRING([--with-glibj],[define what to install (zip|flat|both|none|build) [default=zip]])],
323 if test "x${withval}" = xyes || test "x${withval}" = xzip; then
324 install_class_files=no
325 build_class_files=yes
327 elif test "x${withval}" = xboth; then
328 install_class_files=yes
329 build_class_files=yes
331 elif test "x${withval}" = xflat; then
332 install_class_files=yes
333 build_class_files=yes
335 elif test "x${withval}" = xno || test "x${withval}" = xnone; then
336 install_class_files=no
339 elif test "x${withval}" = xbuild; then
340 install_class_files=no
341 build_class_files=yes
344 AC_MSG_ERROR([unknown value given to --with-glibj])
348 install_class_files=no
351 AM_CONDITIONAL(INSTALL_GLIBJ_ZIP, test "x${use_zip}" = xyes)
352 AM_CONDITIONAL(INSTALL_CLASS_FILES, test "x${install_class_files}" = xyes)
353 AM_CONDITIONAL(BUILD_CLASS_FILES, test "x${build_class_files}" = xyes)
355 AC_ARG_ENABLE([examples],
356 [AS_HELP_STRING(--enable-examples,enable build of the examples [default=yes])],
357 [case "${enableval}" in
358 yes) EXAMPLESDIR="examples" ;;
359 no) EXAMPLESDIR="" ;;
360 *) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;;
362 [EXAMPLESDIR="examples"])
363 if test "x${use_zip}" = xno && test "x${install_class_files}" = xno; then
366 AC_SUBST(EXAMPLESDIR)
369 dnl -----------------------------------------------------------
370 dnl Enable generation of API documentation, with gjdoc if it
371 dnl has been compiled to an executable (or a suitable script
372 dnl is in your PATH) or using the argument as gjdoc executable.
373 dnl -----------------------------------------------------------
374 AC_DEFUN([CLASSPATH_WITH_GJDOC],
377 AS_HELP_STRING([--with-gjdoc],
378 [generate documentation using gjdoc (default is NO)]),
379 [if test "x${withval}" = xno; then
381 elif test "x${withval}" = xyes -o "x{withval}" = x; then
383 AC_PATH_PROG(GJDOC, gjdoc, "no")
384 if test "x${GJDOC}" = xno; then
385 AC_MSG_ERROR("gjdoc executable not found");
390 AC_CHECK_FILE(${GJDOC}, AC_SUBST(GJDOC),
391 AC_MSG_ERROR("Cannot use ${withval} as gjdoc executable since it doesn't exist"))
395 AM_CONDITIONAL(CREATE_API_DOCS, test "x${WITH_GJDOC}" = xyes)
398 dnl -----------------------------------------------------------
399 dnl Enable regeneration of parsers using jay
400 dnl http://www.informatik.uni-osnabrueck.de/alumni/bernd/jay/
401 dnl -----------------------------------------------------------
402 AC_DEFUN([REGEN_WITH_JAY],
405 [AS_HELP_STRING(--with-jay,Regenerate the parsers with jay must be given the path to the jay executable)],
407 if test -d "${withval}"; then
408 JAY_DIR_PATH="${withval}"
409 AC_PATH_PROG(JAY, jay, "no", ${JAY_DIR_PATH})
410 if test "x${JAY}" = xno; then
411 AC_MSG_ERROR("jay executable not found");
414 JAY_DIR_PATH=$(dirname "${withval}")
418 JAY_SKELETON="${JAY_DIR_PATH}/skeleton"
419 AC_CHECK_FILE(${JAY_SKELETON}, AC_SUBST(JAY_SKELETON),
420 AC_MSG_ERROR("Expected skeleton file in $(dirname ${withval})"))
426 AM_CONDITIONAL(REGEN_PARSERS, test "x${JAY_FOUND}" = xyes)
429 dnl -----------------------------------------------------------
430 AC_DEFUN([CLASSPATH_WITH_ECJ],
433 [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)],
435 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
436 CLASSPATH_CHECK_ECJ(${withval})
438 if test "x${withval}" != xno; then
442 user_specified_javac=ecj
450 dnl -----------------------------------------------------------
451 AC_DEFUN([CLASSPATH_CHECK_ECJ],
453 if test "x$1" != x; then
454 if test -f "$1"; then
457 AC_PATH_PROG(ECJ, "$1")
460 AC_PATH_PROG(ECJ, "ecj")