summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-10-05 21:19:16 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-10-05 21:19:16 +0000
commitcae9a32cbcc4c133301d64f49d36709ccbc994da (patch)
tree2c41753d6c88c8b8817cc0a811bb7c0801ec9f02
parente93c4ea50e2390957e16c1d4c8de76de1666725f (diff)
downloadclasspath-cae9a32cbcc4c133301d64f49d36709ccbc994da.tar.gz
Add -regen-gjdoc-parser option.
2008-10-02 Andrew John Hughes <gnu_andrew@member.fsf.org> * configure.ac: Add regen-gjdoc-parser option, and separate antlr tests. * m4/ac_prog_antlr.m4: Turn single test into AC_LIB_ANTLR and AC_PROG_ANTLR. * m4/ac_prog_java.m4: Quote tests. * tools/Makefile.am: Support CREATE_GJDOC_PARSER option.
-rw-r--r--ChangeLog13
-rw-r--r--configure.ac30
-rw-r--r--m4/ac_prog_antlr.m476
-rw-r--r--m4/ac_prog_java.m48
-rwxr-xr-xtools/Makefile.am16
5 files changed, 95 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ac3e1860..9d2b5c213 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-10-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * configure.ac:
+ Add regen-gjdoc-parser option,
+ and separate antlr tests.
+ * m4/ac_prog_antlr.m4:
+ Turn single test into AC_LIB_ANTLR
+ and AC_PROG_ANTLR.
+ * m4/ac_prog_java.m4:
+ Quote tests.
+ * tools/Makefile.am:
+ Support CREATE_GJDOC_PARSER option.
+
2008-09-29 Matthias Klose <doko@ubuntu.com>
* m4/ac_prog_antlr.m4:
diff --git a/configure.ac b/configure.ac
index cd045a6a2..073c38b71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -312,8 +312,9 @@ AC_ARG_WITH([antlr-jar],
])
dnl -----------------------------------------------------------
-dnl Regenerate headers at build time (disabled by default)
+dnl Regenerate headers at build time (enabled if not found)
dnl -----------------------------------------------------------
+AC_MSG_CHECKING([whether to regenerate the headers])
AC_ARG_ENABLE([regen-headers],
[AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=yes if headers don't exist])],
[case "${enableval}" in
@@ -321,13 +322,33 @@ AC_ARG_ENABLE([regen-headers],
no) REGENERATE_JNI_HEADERS=no ;;
*) REGENERATE_JNI_HEADERS=yes ;;
esac],
- [if test -e include/java_lang_VMSystem.h; then
+ [if test -e ${srcdir}/include/java_lang_VMSystem.h; then
REGENERATE_JNI_HEADERS=no ;
else
REGENERATE_JNI_HEADERS=yes ;
fi])
+AC_MSG_RESULT(${REGENERATE_JNI_HEADERS})
AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
+dnl ------------------------------------------------------------------------
+dnl Regenerate GJDoc parser at build time (enabled if not found)
+dnl ------------------------------------------------------------------------
+AC_MSG_CHECKING([whether to regenerate the GJDoc parser])
+AC_ARG_ENABLE([regen-gjdoc-parser],
+ [AS_HELP_STRING(--enable-regen-gjdoc-parser,automatically regenerate the GJDoc parser [default=yes if generated source doesn't exist])],
+ [case "${enableval}" in
+ yes) REGENERATE_GJDOC_PARSER=yes ;;
+ no) REGENERATE_GJDOC_PARSER=no ;;
+ *) REGENERATE_GJDOC_PARSER=yes ;;
+ esac],
+ [if test -e ${srcdir}/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java; then
+ REGENERATE_GJDOC_PARSER=no ;
+ else
+ REGENERATE_GJDOC_PARSER=yes ;
+ fi])
+AC_MSG_RESULT(${REGENERATE_GJDOC_PARSER})
+AM_CONDITIONAL(CREATE_GJDOC_PARSER, test "x${REGENERATE_GJDOC_PARSER}" = xyes)
+
dnl -----------------------------------------------------------
dnl Enable tool wrapper binaries (disabled by default)
dnl -----------------------------------------------------------
@@ -943,7 +964,10 @@ if test "x${TOOLSDIR}" != x; then
fi
if test "x${COMPILE_GJDOC}" = xyes; then
AC_PROG_JAVA
- AC_PROG_ANTLR(2,7,1)
+ AC_LIB_ANTLR
+ if test "x${REGENERATE_GJDOC_PARSER}" = xyes; then
+ AC_PROG_ANTLR(2,7,1)
+ fi
fi
fi
diff --git a/m4/ac_prog_antlr.m4 b/m4/ac_prog_antlr.m4
index 356a4f3e0..cb7d8cd92 100644
--- a/m4/ac_prog_antlr.m4
+++ b/m4/ac_prog_antlr.m4
@@ -1,39 +1,24 @@
-AC_DEFUN([AC_PROG_ANTLR],[
+AC_DEFUN([AC_LIB_ANTLR],[
+ AC_MSG_CHECKING([for the ANTLR parser generator JAR file])
if test -z "$ANTLR_JAR"; then
- AC_REQUIRE([AC_PROG_JAVA])dnl
- AC_MSG_CHECKING([for antlr $1.$2.$3 or better])
- for antlr_lib_home in `ls -d /usr/local/share/antlr* 2> /dev/null` /usr/share/antlr/lib /usr/share/java /usr/lib; do
- antlr_version_str=`$JAVA -classpath "$antlr_lib_home/antlr.jar" antlr.Tool 2>&1 | head -n 1 | sed '/.*Version */!d; s///;q'`
- if test "$antlr_version_str"; then
- antlr_version_regex='s/\([[[:digit:]]]\+\)\.\([[[:digit:]]]\+\)\.\([[[:digit:]]]\+\).*$/'
- antlr_version_major=`echo $antlr_version_str | sed "$antlr_version_regex\\1/"`
- antlr_version_minor=`echo $antlr_version_str | sed "$antlr_version_regex\\2/"`
- antlr_version_micro=`echo $antlr_version_str | sed "$antlr_version_regex\\3/"`
- (test $antlr_version_major -gt $1 ||
- (test $antlr_version_major -eq $1 && \
- test $antlr_version_minor -gt $2) || \
- (test $antlr_version_major -eq $1 && \
- test $antlr_version_minor -eq $2 && \
- test $antlr_version_micro -ge $3)) && \
-
- (test -z $ANTLR_JAR || \
- (test $antlr_version_major -gt $antlr_use_major ||
- (test $antlr_version_major -eq $antlr_use_major && \
- test $antlr_version_minor -gt $antlr_use_minor) || \
- (test $antlr_version_major -eq $antlr_use_major && \
- test $antlr_version_minor -eq $antlr_use_minor && \
- test $antlr_version_micro -ge $antlr_use_micro))) && \
- ANTLR_JAR=$antlr_lib_home/antlr.jar && \
- antlr_use_major=$antlr_version_major && \
- antlr_use_minor=$antlr_version_minor && \
- antlr_use_micro=$antlr_version_micro
- fi
+ for antlr_lib_home in `ls -d /usr/local/share/antlr* 2> /dev/null` \
+ /usr/share/antlr/lib /usr/share/java /usr/lib;
+ do
+ if test -f "$antlr_lib_home/antlr.jar"; then
+ ANTLR_JAR="$antlr_lib_home/antlr.jar"
+ break
+ fi
done
- else
- test -f $ANTLR_JAR || AC_MSG_ERROR([specified ANTLR jar file $ANTLR_JAR not found.]) \
- && AC_MSG_NOTICE([using ANTLR parser generator in $ANTLR_JAR])
fi
+ test -f $ANTLR_JAR || AC_MSG_ERROR([specified ANTLR jar file $ANTLR_JAR not found.]) \
+ && AC_MSG_RESULT([$ANTLR_JAR])
+ AC_SUBST(ANTLR_JAR)
+ AC_PROVIDE([$0])dnl
+])
+
+AC_DEFUN([AC_PROG_ANTLR],[
+ AC_REQUIRE([AC_PROG_JAVA])dnl
AC_CHECK_TOOLS([ANTLR], [runantlr antlr])
if test "x$ANTLR" = x; then
if test -z "$JAVA"; then
@@ -42,10 +27,27 @@ AC_DEFUN([AC_PROG_ANTLR],[
ANTLR="$JAVA -classpath $ANTLR_JAR antlr.Tool"
fi
fi
- test -z "$ANTLR_JAR" && \
- AC_MSG_ERROR(no suitable antlr.jar found for version $1.$2.$3)
- AC_MSG_RESULT($antlr_use_major.$antlr_use_minor.$antlr_use_micro)
AC_SUBST(ANTLR)
- AC_SUBST(ANTLR_JAR)
- AC_PROVIDE([$0])dnl
+ AC_MSG_CHECKING([for antlr $1.$2.$3 or better])
+ antlr_version_str=`$ANTLR 2>&1 | head -n 1 | sed '/.*Version */!d; s///;q'`
+ if test "$antlr_version_str"; then
+ antlr_version_regex='s/\([[[:digit:]]]\+\)\.\([[[:digit:]]]\+\)\.\([[[:digit:]]]\+\).*$/'
+ antlr_version_major=`echo $antlr_version_str | sed "$antlr_version_regex\\1/"`
+ antlr_version_minor=`echo $antlr_version_str | sed "$antlr_version_regex\\2/"`
+ antlr_version_micro=`echo $antlr_version_str | sed "$antlr_version_regex\\3/"`
+ (test $antlr_version_major -gt $1 ||
+ (test $antlr_version_major -eq $1 && \
+ test $antlr_version_minor -gt $2) || \
+ (test $antlr_version_major -eq $1 && \
+ test $antlr_version_minor -eq $2 && \
+ test $antlr_version_micro -ge $3)) && \
+ (test -z $ANTLR_JAR || \
+ (test $antlr_version_major -gt $antlr_use_major ||
+ (test $antlr_version_major -eq $antlr_use_major && \
+ test $antlr_version_minor -gt $antlr_use_minor) || \
+ (test $antlr_version_major -eq $antlr_use_major && \
+ test $antlr_version_minor -eq $antlr_use_minor && \
+ test $antlr_version_micro -ge $antlr_use_micro)))
+ fi
+ AC_MSG_RESULT($antlr_use_major.$antlr_use_minor.$antlr_use_micro)
])
diff --git a/m4/ac_prog_java.m4 b/m4/ac_prog_java.m4
index b0f237d16..356d99d80 100644
--- a/m4/ac_prog_java.m4
+++ b/m4/ac_prog_java.m4
@@ -6,12 +6,12 @@ dnl Changes for GNU Classpath: check for "cacao, jamvm" as well
dnl
AC_DEFUN([AC_PROG_JAVA],[
AC_REQUIRE([AC_EXEEXT])dnl
-if test x$JAVAPREFIX = x; then
- test x$JAVA = x && AC_CHECK_PROGS(JAVA, cacao$EXEEXT jamvm$EXEEXT kaffe$EXEEXT gij$EXEEXT java$EXEEXT)
+if test "x$JAVAPREFIX" = x; then
+ test "x$JAVA" = x && AC_CHECK_PROGS(JAVA, cacao$EXEEXT jamvm$EXEEXT kaffe$EXEEXT gij$EXEEXT java$EXEEXT)
else
- test x$JAVA = x && AC_CHECK_PROGS(JAVA, cacao$EXEEXT jamvm$EXEEXT kaffe$EXEEXT gij$EXEEXT java$EXEEXT, $JAVAPREFIX)
+ test "x$JAVA" = x && AC_CHECK_PROGS(JAVA, cacao$EXEEXT jamvm$EXEEXT kaffe$EXEEXT gij$EXEEXT java$EXEEXT, $JAVAPREFIX)
fi
-test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
+test "x$JAVA" = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
AC_PROG_JAVA_WORKS
AC_PROVIDE([$0])dnl
])
diff --git a/tools/Makefile.am b/tools/Makefile.am
index e39c3b466..30c9be6d8 100755
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,7 +1,12 @@
## Input file for automake to generate the Makefile.in used by configure
if CREATE_GJDOC
-ANTLR_CLASSPATH = $(ANTLR_JAR):generated
+if CREATE_GJDOC_PARSER
+gjdoc_gendir = ${top_builddir}/tools/generated
+else
+gjdoc_gendir = ${top_srcdir}/tools/generated
+endif
+ANTLR_CLASSPATH = $(ANTLR_JAR):$(gjdoc_gendir)
endif
GLIBJ_BOOTCLASSPATH='$(top_builddir)/lib/glibj.zip:$(top_builddir)/lib'
@@ -306,9 +311,9 @@ dist-hook:
# immediately. And copy the template files we use to the classes dir
# so they get also included.
$(TOOLS_ZIP): $(ALL_TOOLS_FILES)
- @rm -rf classes asm generated
+ @rm -rf classes asm
@mkdir_p@ classes asm
-if CREATE_GJDOC
+if CREATE_GJDOC_PARSER
## Generate antlr sources.
@mkdir_p@ generated/gnu/classpath/tools/gjdoc/expr
$(ANTLR) -o generated/gnu/classpath/tools/gjdoc/expr \
@@ -368,7 +373,10 @@ endif
# Zip file be gone! (and make sure the classes are gone too)
clean-local:
- rm -rf $(TOOLS_ZIP) classes classes.lst asm asm.lst all-classes.lst generated
+ rm -rf $(TOOLS_ZIP) classes classes.lst asm asm.lst all-classes.lst
+if CREATE_GJDOC_PARSER
+ rm -rf $(gjdoc_gendir)
+endif
# FIXME: remove this when GNU Classpath includes a bootstrap VM.
installcheck-binSCRIPTS: