summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2005-01-02 20:08:50 +0000
committerMark Wielaard <mark@klomp.org>2005-01-02 20:08:50 +0000
commita532a017e0d3aacfd3243f3c15f62d141ff38662 (patch)
tree7989da1c315c6e202ebbefade811d2e931b8b496
parent62f3192d5d25296ae1eb6f5559ca49710fa3cac8 (diff)
downloadclasspath-a532a017e0d3aacfd3243f3c15f62d141ff38662.tar.gz
* acinclude.m4 (REGEN_WITH_JAY): New macro.
* configure.ac: Call REGEN_WITH_JAY. * lib/Makefile.am (gen-xpath-parser): New rule, depends on REGEN_PARSER being defined. (genclasses): Depend on gen-xpath-parser.
-rw-r--r--ChangeLog8
-rw-r--r--acinclude.m430
-rw-r--r--configure.ac5
-rw-r--r--lib/Makefile.am17
4 files changed, 59 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 53c840260..d0d643869 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-01-02 Mark Wielaard <mark@klomp.org>
+
+ * acinclude.m4 (REGEN_WITH_JAY): New macro.
+ * configure.ac: Call REGEN_WITH_JAY.
+ * lib/Makefile.am (gen-xpath-parser): New rule, depends on
+ REGEN_PARSER being defined.
+ (genclasses): Depend on gen-xpath-parser.
+
2005-01-02 Archie Cobbs <archie@dellroad.org>
* vm/reference/java/lang/VMThread.java (sleep()): revert behavior
diff --git a/acinclude.m4 b/acinclude.m4
index f45f0e00b..1b643a0f2 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -371,3 +371,33 @@ AC_DEFUN([CLASSPATH_ENABLE_GJDOC],
AM_CONDITIONAL(CREATE_API_DOCS, test "x${ENABLE_GJDOC}" = xyes)
])
+dnl -----------------------------------------------------------
+dnl Enable regeneration of parsers using jay
+dnl http://www.informatik.uni-osnabrueck.de/alumni/bernd/jay/
+dnl -----------------------------------------------------------
+AC_DEFUN([REGEN_WITH_JAY],
+[
+ AC_ARG_WITH([jay],
+ [AS_HELP_STRING(--with-jay,Regenerate the parsers with jay must be given the path to the jay executable)],
+ [
+ if test -d "${withval}"; then
+ JAY_DIR_PATH="${withval}"
+ AC_PATH_PROG(JAY, jay, "no", ${JAY_DIR_PATH})
+ if test "x${JAY}" = xno; then
+ AC_MSG_ERROR("jay executable not found");
+ fi
+ else
+ JAY_DIR_PATH=$(dirname "${withval}")
+ JAY="${withval}"
+ AC_SUBST(JAY)
+ fi
+ JAY_SKELETON="${JAY_DIR_PATH}/skeleton"
+ AC_CHECK_FILE(${JAY_SKELETON}, AC_SUBST(JAY_SKELETON),
+ AC_MSG_ERROR("Expected skeleton file in $(dirname ${withval})"))
+ JAY_FOUND=yes
+ ],
+ [
+ JAY_FOUND=no
+ ])
+ AM_CONDITIONAL(REGEN_PARSERS, test "x${JAY_FOUND}" = xyes)
+])
diff --git a/configure.ac b/configure.ac
index ab7718a2d..be1aa9eb0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -361,6 +361,11 @@ dnl -----------------------------------------------------------
CLASSPATH_ENABLE_GJDOC
dnl -----------------------------------------------------------
+dnl Whether to use jay to regenerate parsers.
+dnl -----------------------------------------------------------
+REGEN_WITH_JAY
+
+dnl -----------------------------------------------------------
dnl This sets the build-time default, which can now be overridden
dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
dnl to "true" or "false".
diff --git a/lib/Makefile.am b/lib/Makefile.am
index e83515533..014f2b103 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -83,9 +83,24 @@ $(top_builddir)/java/util/LocaleData.java: $(top_srcdir)/scripts/generate-locale
mkdir -p $(top_builddir)/java/util
$(top_srcdir)/scripts/generate-locale-list.sh > $(top_builddir)/java/util/LocaleData.java
-genclasses: gen-classlist.sh standard.omit $(top_builddir)/java/util/LocaleData.java
+genclasses: gen-classlist.sh standard.omit $(top_builddir)/java/util/LocaleData.java gen-xpath-parser
top_builddir=$(top_builddir) $(SHELL) ./gen-classlist.sh standard
+# Only rebuild parsers when explicitly asked to.
+if REGEN_PARSERS
+
+gen-xpath-parser: $(top_srcdir)/gnu/xml/xpath/XPathParser.java
+
+$(top_srcdir)/gnu/xml/xpath/XPathParser.java: $(top_srcdir)/gnu/xml/xpath/XPathParser.y
+ ( cd $(top_srcdir)/gnu/xml/xpath; \
+ $(JAY) XPathParser.y < $(JAY_SKELETON) > XPathParser.java )
+else
+
+gen-xpath-parser:
+ true
+
+endif # REGEN_PARSER
+
$(JAVA_DEPEND): genclasses
compile-classes: classes $(JAVA_SRCS) Makefile