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)
18 AM_CONDITIONAL(FOUND_JAVAC, test "x${JAVAC}" != x)
20 AM_CONDITIONAL(FOUND_GCJ, test "x${user_specified_javac}" = xgcj)
21 AM_CONDITIONAL(FOUND_JIKES, test "x${user_specified_javac}" = xjikes)
22 AM_CONDITIONAL(FOUND_ECJ, test "x${user_specified_javac}" = xecj)
23 AM_CONDITIONAL(FOUND_JAVAC, test "x${user_specified_javac}" = xjavac)
25 AM_CONDITIONAL(FOUND_KJC, test "x${user_specified_javac}" = xkjc)
28 if test "x${GCJ}" = x && test "x${JIKES}" = x && test "x${ECJ}" = x \
29 && test "x${JAVAC}" = x && test "x${user_specified_javac}" != xkjc
31 AC_MSG_ERROR([cannot find javac, try --with-ecj])
36 dnl -----------------------------------------------------------
37 AC_DEFUN([CLASSPATH_WITH_GCJ],
40 [AS_HELP_STRING(--with-gcj,bytecode compilation with gcj)],
42 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
43 CLASSPATH_CHECK_GCJ(${withval})
45 if test "x${withval}" != xno; then
49 user_specified_javac=gcj
57 dnl -----------------------------------------------------------
58 AC_DEFUN([CLASSPATH_CHECK_GCJ],
60 if test "x$1" != x; then
64 AC_PATH_PROG(GCJ, "$1")
67 AC_PATH_PROG(GCJ, "gcj")
69 dnl Test the given GCJ, but use it as C (!) compiler to check version
70 if test "x$GCJ" != x; then
71 AC_MSG_CHECKING([gcj version 4.0])
75 #error GCJ 4.0.0 or higher is required
78 $GCJ -E conftest.c > /dev/null
80 if test "x$gcj_4_result" = "x0"; then
81 AC_MSG_RESULT([4.0 or higher found])
83 AC_MSG_WARN([4.0 or higher required])
89 dnl -----------------------------------------------------------
90 AC_DEFUN([CLASSPATH_WITH_JIKES],
93 [AS_HELP_STRING(--with-jikes,bytecode compilation with jikes)],
95 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
96 CLASSPATH_CHECK_JIKES(${withval})
98 if test "x${withval}" != xno; then
102 user_specified_javac=jikes
105 CLASSPATH_CHECK_JIKES
110 dnl -----------------------------------------------------------
111 AC_DEFUN([CLASSPATH_CHECK_JIKES],
113 if test "x$1" != x; then
114 if test -f "$1"; then
117 AC_PATH_PROG(JIKES, "$1")
120 AC_PATH_PROG(JIKES, "jikes")
122 if test "x$JIKES" != "x"; then
123 dnl Require at least version 1.19
124 AC_MSG_CHECKING(jikes version)
125 JIKES_VERSION=`$JIKES --version | awk '/^Jikes Compiler/' | cut -d ' ' -f 5`
126 JIKES_VERSION_MAJOR=`echo "$JIKES_VERSION" | cut -d '.' -f 1`
127 JIKES_VERSION_MINOR=`echo "$JIKES_VERSION" | cut -d '.' -f 2`
128 if expr "$JIKES_VERSION_MAJOR" = 1 > /dev/null; then
129 if expr "$JIKES_VERSION_MINOR" \< 19 > /dev/null; then
133 if test "x$JIKES" != "x"; then
134 AC_MSG_RESULT($JIKES_VERSION)
136 AC_MSG_WARN($JIKES_VERSION: jikes 1.19 or higher required)
140 if test -n "`$JIKES --help 2>&1 | grep encoding`"; then
141 JIKESENCODING='-encoding UTF-8'
143 AC_SUBST(JIKESENCODING)
145 JIKESWARNINGS="+Pno-switchcheck"
146 if test "x$JIKES_VERSION_MAJOR" = x"1" ; then
147 if ! test "x$JIKES_VERSION_MINOR" = x"19"; then
148 JIKESWARNINGS="$JIKESWARNINGS +Pno-shadow"
151 AC_SUBST(JIKESWARNINGS)
156 dnl -----------------------------------------------------------
157 AC_DEFUN([CLASSPATH_WITH_KJC],
160 [AS_HELP_STRING(--with-kjc,bytecode compilation with kjc)],
162 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
163 CLASSPATH_CHECK_KJC(${withval})
165 if test "x${withval}" != xno; then
169 user_specified_javac=kjc
177 dnl -----------------------------------------------------------
178 AC_DEFUN([CLASSPATH_CHECK_KJC],
180 if test "x$1" != x; then
181 if test -f "$1"; then
184 AC_PATH_PROG(KJC, "$1")
187 AC_PATH_PROG(KJC, "kJC")
191 dnl -----------------------------------------------------------
192 AC_DEFUN([CLASSPATH_WITH_JAVAH],
195 [AS_HELP_STRING(--with-javah,specify path or name of a javah-like program)],
197 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
198 CLASSPATH_CHECK_JAVAH(${withval})
200 CLASSPATH_CHECK_JAVAH
204 CLASSPATH_CHECK_JAVAH
209 dnl -----------------------------------------------------------
210 dnl Checking for a javah like program
211 dnl -----------------------------------------------------------
212 AC_DEFUN([CLASSPATH_CHECK_JAVAH],
214 if test "x$1" != x; then
215 if test -f "$1"; then
218 AC_PATH_PROG(USER_JAVAH, "$1")
221 AC_PATH_PROGS([USER_JAVAH],[gjavah gcjh-wrapper-4.1 gcjh-4.1 gcjh javah])
224 if test "x${USER_JAVAH}" = x; then
225 AC_MSG_ERROR([can not find javah])
229 dnl -----------------------------------------------------------
230 dnl CLASSPATH_WITH_CLASSLIB - checks for user specified classpath additions
231 dnl -----------------------------------------------------------
232 AC_DEFUN([CLASSPATH_WITH_CLASSLIB],
234 AC_ARG_WITH([classpath],
235 [AS_HELP_STRING(--with-classpath,specify path to a classes.zip like file)],
237 if test "x${withval}" = xyes; then
238 # set user classpath to CLASSPATH from env
239 AC_MSG_CHECKING(for classlib)
240 USER_CLASSLIB=${CLASSPATH}
241 AC_SUBST(USER_CLASSLIB)
242 AC_MSG_RESULT(${USER_CLASSLIB})
243 conditional_with_classlib=true
244 elif test "x${withval}" != x && test "x${withval}" != xno; then
245 # set user classpath to specified value
246 AC_MSG_CHECKING(for classlib)
247 USER_CLASSLIB=${withval}
248 AC_SUBST(USER_CLASSLIB)
249 AC_MSG_RESULT(${withval})
250 conditional_with_classlib=true
253 [ conditional_with_classlib=false ])
254 AM_CONDITIONAL(USER_SPECIFIED_CLASSLIB, test "x${conditional_with_classlib}" = xtrue)
256 AC_ARG_WITH([vm-classes],
257 [AS_HELP_STRING(--with-vm-classes,specify path to VM override source files)], [vm_classes="$with_vm_classes"],
258 [vm_classes='${top_srcdir}/vm/reference'])
262 dnl -----------------------------------------------------------
263 dnl CLASSPATH_WITH_GLIBJ - specify what to install
264 dnl -----------------------------------------------------------
265 AC_DEFUN([CLASSPATH_WITH_GLIBJ],
267 AC_PATH_PROG(ZIP, zip)
268 AC_ARG_WITH([fastjar],
269 [AS_HELP_STRING([--with-fastjar=PATH], [define to use a fastjar style tool])],
271 AC_MSG_CHECKING([for user supplied fastjar])
273 AC_MSG_RESULT([${FASTJAR}])
275 [AC_PATH_PROG(FASTJAR, fastjar)])
276 dnl We disable ZIP by default if we find fastjar.
277 if test x"${FASTJAR}" != x; then
282 [AS_HELP_STRING([--with-glibj],[define what to install (zip|flat|both|none|build) [default=zip]])],
284 if test "x${withval}" = xyes || test "x${withval}" = xzip; then
285 install_class_files=no
286 build_class_files=yes
288 elif test "x${withval}" = xboth; then
289 install_class_files=yes
290 build_class_files=yes
292 elif test "x${withval}" = xflat; then
293 install_class_files=yes
294 build_class_files=yes
296 elif test "x${withval}" = xno || test "x${withval}" = xnone; then
297 install_class_files=no
300 elif test "x${withval}" = xbuild; then
301 install_class_files=no
302 build_class_files=yes
305 AC_MSG_ERROR([unknown value given to --with-glibj])
309 install_class_files=no
312 AM_CONDITIONAL(INSTALL_GLIBJ_ZIP, test "x${use_zip}" = xyes)
313 AM_CONDITIONAL(INSTALL_CLASS_FILES, test "x${install_class_files}" = xyes)
314 AM_CONDITIONAL(BUILD_CLASS_FILES, test "x${build_class_files}" = xyes)
316 AC_ARG_ENABLE([examples],
317 [AS_HELP_STRING(--enable-examples,enable build of the examples [default=yes])],
318 [case "${enableval}" in
319 yes) EXAMPLESDIR="examples" ;;
320 no) EXAMPLESDIR="" ;;
321 *) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;;
323 [EXAMPLESDIR="examples"])
324 if test "x${use_zip}" = xno && test "x${install_class_files}" = xno; then
327 AC_SUBST(EXAMPLESDIR)
330 dnl -----------------------------------------------------------
331 dnl Enable generation of API documentation, with gjdoc if it
332 dnl has been compiled to an executable (or a suitable script
333 dnl is in your PATH) or using the argument as gjdoc executable.
334 dnl -----------------------------------------------------------
335 AC_DEFUN([CLASSPATH_WITH_GJDOC],
338 AS_HELP_STRING([--with-gjdoc],
339 [generate documentation using gjdoc (default is NO)]),
340 [if test "x${withval}" = xno; then
342 elif test "x${withval}" = xyes -o "x{withval}" = x; then
344 AC_PATH_PROG(GJDOC, gjdoc, "no")
345 if test "x${GJDOC}" = xno; then
346 AC_MSG_ERROR("gjdoc executable not found");
351 AC_CHECK_FILE(${GJDOC}, AC_SUBST(GJDOC),
352 AC_MSG_ERROR("Cannot use ${withval} as gjdoc executable since it doesn't exist"))
356 AM_CONDITIONAL(CREATE_API_DOCS, test "x${WITH_GJDOC}" = xyes)
359 dnl -----------------------------------------------------------
360 dnl Enable regeneration of parsers using jay
361 dnl http://www.informatik.uni-osnabrueck.de/alumni/bernd/jay/
362 dnl -----------------------------------------------------------
363 AC_DEFUN([REGEN_WITH_JAY],
366 [AS_HELP_STRING(--with-jay,Regenerate the parsers with jay must be given the path to the jay executable)],
368 if test -d "${withval}"; then
369 JAY_DIR_PATH="${withval}"
370 AC_PATH_PROG(JAY, jay, "no", ${JAY_DIR_PATH})
371 if test "x${JAY}" = xno; then
372 AC_MSG_ERROR("jay executable not found");
375 JAY_DIR_PATH=`dirname "${withval}"`
379 JAY_SKELETON="${JAY_DIR_PATH}/skeleton"
380 AC_CHECK_FILE(${JAY_SKELETON}, AC_SUBST(JAY_SKELETON),
381 AC_MSG_ERROR("Expected skeleton file in `dirname ${withval}`"))
387 AM_CONDITIONAL(REGEN_PARSERS, test "x${JAY_FOUND}" = xyes)
390 dnl -----------------------------------------------------------
391 AC_DEFUN([CLASSPATH_WITH_ECJ],
394 [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)],
396 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
397 CLASSPATH_CHECK_ECJ(${withval})
399 if test "x${withval}" != xno; then
403 user_specified_javac=ecj
411 dnl -----------------------------------------------------------
412 AC_DEFUN([CLASSPATH_CHECK_ECJ],
414 if test "x$1" != x; then
415 if test -f "$1"; then
418 AC_PATH_PROG(ECJ, "$1")
421 AC_PATH_PROG(ECJ, "ecj")
425 dnl -----------------------------------------------------------
426 dnl GCJ LOCAL: Calculate toolexeclibdir
427 dnl -----------------------------------------------------------
428 AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR],
430 multi_os_directory=`$CC -print-multi-os-directory`
431 case $multi_os_directory in
432 .) toolexeclibdir=${libdir} ;; # Avoid trailing /.
433 *) toolexeclibdir=${libdir}/${multi_os_directory} ;;
435 AC_SUBST(toolexeclibdir)
438 dnl -----------------------------------------------------------
439 AC_DEFUN([CLASSPATH_WITH_JAVAC],
442 [AS_HELP_STRING(--with-javac,bytecode compilation with javac)],
444 if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
445 CLASSPATH_CHECK_JAVAC(${withval})
447 if test "x${withval}" != xno; then
448 CLASSPATH_CHECK_JAVAC
451 user_specified_javac=javac
454 CLASSPATH_CHECK_JAVAC
459 dnl -----------------------------------------------------------
460 AC_DEFUN([CLASSPATH_CHECK_JAVAC],
462 if test "x$1" != x; then
465 AC_PATH_PROG(JAVAC, "javac")