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 AC_MSG_ERROR([cannot find javac, try --with-gcj, --with-jikes, --with-kjc, --with-ecj, or --with-gcjx])
31 dnl -----------------------------------------------------------
32 AC_DEFUN([CLASSPATH_WITH_GCJ],
35 [AS_HELP_STRING(--with-gcj,bytecode compilation with gcj)],
37 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
38 CLASSPATH_CHECK_GCJ(${withval})
40 if test "x${withval}" != xno; then
44 user_specified_javac=gcj
52 dnl -----------------------------------------------------------
53 AC_DEFUN([CLASSPATH_CHECK_GCJ],
55 if test "x$1" != x; then
59 AC_PATH_PROG(GCJ, "$1")
62 AC_PATH_PROG(GCJ, "gcj")
64 dnl Test the given GCJ, but use it as C (!) compiler to check version
65 if test "x$GCJ" != x; then
66 AC_MSG_CHECKING([gcj version 4.0])
70 #error GCJ 4.0.0 or higher is required
73 $GCJ -E conftest.c > /dev/null
75 if test "x$gcj_4_result" = "x0"; then
76 AC_MSG_RESULT([4.0 or higher found])
78 AC_MSG_WARN([4.0 or higher required])
84 dnl -----------------------------------------------------------
85 AC_DEFUN([CLASSPATH_WITH_JIKES],
88 [AS_HELP_STRING(--with-jikes,bytecode compilation with jikes)],
90 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
91 CLASSPATH_CHECK_JIKES(${withval})
93 if test "x${withval}" != xno; then
97 user_specified_javac=jikes
100 CLASSPATH_CHECK_JIKES
105 dnl -----------------------------------------------------------
106 AC_DEFUN([CLASSPATH_CHECK_JIKES],
108 if test "x$1" != x; then
109 if test -f "$1"; then
112 AC_PATH_PROG(JIKES, "$1")
115 AC_PATH_PROG(JIKES, "jikes")
117 if test "x$JIKES" != "x"; then
118 dnl Require at least version 1.19
119 AC_MSG_CHECKING(jikes version)
120 JIKES_VERSION=`$JIKES --version | awk '/^Jikes Compiler/' | cut -d ' ' -f 5`
121 JIKES_VERSION_MAJOR=`echo "$JIKES_VERSION" | cut -d '.' -f 1`
122 JIKES_VERSION_MINOR=`echo "$JIKES_VERSION" | cut -d '.' -f 2`
123 if expr "$JIKES_VERSION_MAJOR" = 1 > /dev/null; then
124 if expr "$JIKES_VERSION_MINOR" \< 19 > /dev/null; then
128 if test "x$JIKES" != "x"; then
129 AC_MSG_RESULT($JIKES_VERSION)
131 AC_MSG_WARN($JIKES_VERSION: jikes 1.19 or higher required)
135 if test -n "`$JIKES --help 2>&1 | grep encoding`"; then
136 JIKESENCODING='-encoding UTF-8'
138 AC_SUBST(JIKESENCODING)
140 JIKESWARNINGS="+Pno-switchcheck"
141 if test "x$JIKES_VERSION_MAJOR" = x"1" ; then
142 if ! test "x$JIKES_VERSION_MINOR" = x"19"; then
143 JIKESWARNINGS="$JIKESWARNINGS +Pno-shadow"
146 AC_SUBST(JIKESWARNINGS)
151 dnl -----------------------------------------------------------
152 AC_DEFUN([CLASSPATH_WITH_KJC],
155 [AS_HELP_STRING(--with-kjc,bytecode compilation with kjc)],
157 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
158 CLASSPATH_CHECK_KJC(${withval})
160 if test "x${withval}" != xno; then
164 user_specified_javac=kjc
172 dnl -----------------------------------------------------------
173 AC_DEFUN([CLASSPATH_CHECK_KJC],
175 if test "x$1" != x; then
176 if test -f "$1"; then
179 AC_PATH_PROG(KJC, "$1")
182 AC_PATH_PROG(KJC, "kJC")
186 dnl -----------------------------------------------------------
187 AC_DEFUN([CLASSPATH_WITH_GCJX],
190 [AS_HELP_STRING(--with-gcjx,bytecode compilation with gcjx)],
192 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
193 CLASSPATH_CHECK_GCJX(${withval})
195 if test "x${withval}" != xno; then
199 user_specified_javac=gcjx
207 dnl -----------------------------------------------------------
208 AC_DEFUN([CLASSPATH_CHECK_GCJX],
210 if test "x$1" != x; then
211 if test -f "$1"; then
214 AC_PATH_PROG(GCJX, "$1")
217 AC_PATH_PROG(GCJX, "gcjx")
221 dnl -----------------------------------------------------------
222 AC_DEFUN([CLASSPATH_WITH_JAVAH],
225 [AS_HELP_STRING(--with-javah,specify path or name of a javah-like program)],
227 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
228 CLASSPATH_CHECK_JAVAH(${withval})
230 CLASSPATH_CHECK_JAVAH
234 CLASSPATH_CHECK_JAVAH
236 AM_CONDITIONAL(USER_SPECIFIED_JAVAH, test "x${USER_JAVAH}" != x)
240 dnl -----------------------------------------------------------
241 dnl Checking for a javah like program
242 dnl -----------------------------------------------------------
243 AC_DEFUN([CLASSPATH_CHECK_JAVAH],
245 if test "x$1" != x; then
246 if test -f "$1"; then
249 AC_PATH_PROG(USER_JAVAH, "$1")
252 for javah_name in gcjh javah; do
253 AC_PATH_PROG(USER_JAVAH, "$javah_name")
254 if test "x${USER_JAVAH}" != x; then
260 # if test "x${USER_JAVAH}" = x; then
261 # echo "configure: cannot find javah" 1>&2
266 dnl -----------------------------------------------------------
267 dnl CLASSPATH_WITH_CLASSLIB - checks for user specified classpath additions
268 dnl -----------------------------------------------------------
269 AC_DEFUN([CLASSPATH_WITH_CLASSLIB],
271 AC_ARG_WITH([classpath],
272 [AS_HELP_STRING(--with-classpath,specify path to a classes.zip like file)],
274 if test "x${withval}" = xyes; then
275 # set user classpath to CLASSPATH from env
276 AC_MSG_CHECKING(for classlib)
277 USER_CLASSLIB=${CLASSPATH}
278 AC_SUBST(USER_CLASSLIB)
279 AC_MSG_RESULT(${USER_CLASSLIB})
280 conditional_with_classlib=true
281 elif test "x${withval}" != x && test "x${withval}" != xno; then
282 # set user classpath to specified value
283 AC_MSG_CHECKING(for classlib)
284 USER_CLASSLIB=${withval}
285 AC_SUBST(USER_CLASSLIB)
286 AC_MSG_RESULT(${withval})
287 conditional_with_classlib=true
290 [ conditional_with_classlib=false ])
291 AM_CONDITIONAL(USER_SPECIFIED_CLASSLIB, test "x${conditional_with_classlib}" = xtrue)
293 AC_ARG_WITH([vm-classes],
294 [AS_HELP_STRING(--with-vm-classes,specify path to VM override source files)], [vm_classes="$with_vm_classes"],
295 [vm_classes='${top_srcdir}/vm/reference'])
299 dnl -----------------------------------------------------------
300 dnl CLASSPATH_WITH_GLIBJ - specify what to install
301 dnl -----------------------------------------------------------
302 AC_DEFUN([CLASSPATH_WITH_GLIBJ],
304 AC_PATH_PROG(ZIP, zip)
305 AC_ARG_WITH([fastjar],
306 [AS_HELP_STRING([--with-fastjar=PATH], [define to use a fastjar style tool])],
308 AC_MSG_CHECKING([for user supplied fastjar])
310 AC_MSG_RESULT([${FASTJAR}])
312 [AC_PATH_PROG(FASTJAR, fastjar)])
313 dnl We disable ZIP by default if we find fastjar.
314 if test x"${FASTJAR}" != x; then
319 [AS_HELP_STRING([--with-glibj],[define what to install (zip|flat|both|none|build) [default=zip]])],
321 if test "x${withval}" = xyes || test "x${withval}" = xzip; then
322 install_class_files=no
323 build_class_files=yes
325 elif test "x${withval}" = xboth; then
326 install_class_files=yes
327 build_class_files=yes
329 elif test "x${withval}" = xflat; then
330 install_class_files=yes
331 build_class_files=yes
333 elif test "x${withval}" = xno || test "x${withval}" = xnone; then
334 install_class_files=no
337 elif test "x${withval}" = xbuild; then
338 install_class_files=no
339 build_class_files=yes
342 AC_MSG_ERROR([unknown value given to --with-glibj])
346 install_class_files=no
349 AM_CONDITIONAL(INSTALL_GLIBJ_ZIP, test "x${use_zip}" = xyes)
350 AM_CONDITIONAL(INSTALL_CLASS_FILES, test "x${install_class_files}" = xyes)
351 AM_CONDITIONAL(BUILD_CLASS_FILES, test "x${build_class_files}" = xyes)
353 AC_ARG_ENABLE([examples],
354 [AS_HELP_STRING(--enable-examples,enable build of the examples [default=yes])],
355 [case "${enableval}" in
356 yes) EXAMPLESDIR="examples" ;;
357 no) EXAMPLESDIR="" ;;
358 *) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;;
360 [EXAMPLESDIR="examples"])
361 if test "x${use_zip}" = xno && test "x${install_class_files}" = xno; then
364 AC_SUBST(EXAMPLESDIR)
367 dnl -----------------------------------------------------------
368 dnl Enable generation of API documentation, with gjdoc if it
369 dnl has been compiled to an executable (or a suitable script
370 dnl is in your PATH) or using the argument as gjdoc executable.
371 dnl -----------------------------------------------------------
372 AC_DEFUN([CLASSPATH_WITH_GJDOC],
375 AS_HELP_STRING([--with-gjdoc],
376 [generate documentation using gjdoc (default is NO)]),
377 [if test "x${withval}" = xno; then
379 elif test "x${withval}" = xyes -o "x{withval}" = x; then
381 AC_PATH_PROG(GJDOC, gjdoc, "no")
382 if test "x${GJDOC}" = xno; then
383 AC_MSG_ERROR("gjdoc executable not found");
388 AC_CHECK_FILE(${GJDOC}, AC_SUBST(GJDOC),
389 AC_MSG_ERROR("Cannot use ${withval} as gjdoc executable since it doesn't exist"))
393 AM_CONDITIONAL(CREATE_API_DOCS, test "x${WITH_GJDOC}" = xyes)
396 dnl -----------------------------------------------------------
397 dnl Enable regeneration of parsers using jay
398 dnl http://www.informatik.uni-osnabrueck.de/alumni/bernd/jay/
399 dnl -----------------------------------------------------------
400 AC_DEFUN([REGEN_WITH_JAY],
403 [AS_HELP_STRING(--with-jay,Regenerate the parsers with jay must be given the path to the jay executable)],
405 if test -d "${withval}"; then
406 JAY_DIR_PATH="${withval}"
407 AC_PATH_PROG(JAY, jay, "no", ${JAY_DIR_PATH})
408 if test "x${JAY}" = xno; then
409 AC_MSG_ERROR("jay executable not found");
412 JAY_DIR_PATH=`dirname "${withval}"`
416 JAY_SKELETON="${JAY_DIR_PATH}/skeleton"
417 AC_CHECK_FILE(${JAY_SKELETON}, AC_SUBST(JAY_SKELETON),
418 AC_MSG_ERROR("Expected skeleton file in `dirname ${withval}`"))
424 AM_CONDITIONAL(REGEN_PARSERS, test "x${JAY_FOUND}" = xyes)
427 dnl -----------------------------------------------------------
428 AC_DEFUN([CLASSPATH_WITH_ECJ],
431 [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)],
433 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
434 CLASSPATH_CHECK_ECJ(${withval})
436 if test "x${withval}" != xno; then
440 user_specified_javac=ecj
448 dnl -----------------------------------------------------------
449 AC_DEFUN([CLASSPATH_CHECK_ECJ],
451 if test "x$1" != x; then
452 if test -f "$1"; then
455 AC_PATH_PROG(ECJ, "$1")
458 AC_PATH_PROG(ECJ, "ecj")
462 dnl -----------------------------------------------------------
463 dnl GCJ LOCAL: Calculate toolexeclibdir
464 dnl -----------------------------------------------------------
465 AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR],
467 multi_os_directory=`$CC -print-multi-os-directory`
468 case $multi_os_directory in
469 .) toolexeclibdir=${libdir} ;; # Avoid trailing /.
470 *) toolexeclibdir=${libdir}/${multi_os_directory} ;;
472 AC_SUBST(toolexeclibdir)