summaryrefslogtreecommitdiff
path: root/libjava/classpath/m4/ac_prog_antlr.m4
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libjava/classpath/m4/ac_prog_antlr.m4
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libjava/classpath/m4/ac_prog_antlr.m4')
-rw-r--r--libjava/classpath/m4/ac_prog_antlr.m450
1 files changed, 50 insertions, 0 deletions
diff --git a/libjava/classpath/m4/ac_prog_antlr.m4 b/libjava/classpath/m4/ac_prog_antlr.m4
new file mode 100644
index 000000000..df377e8b6
--- /dev/null
+++ b/libjava/classpath/m4/ac_prog_antlr.m4
@@ -0,0 +1,50 @@
+
+AC_DEFUN([AC_LIB_ANTLR],[
+ AC_MSG_CHECKING([for the ANTLR parser generator JAR file])
+ if test -z "$ANTLR_JAR"; then
+ 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
+ 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], [cantlr runantlr antlr])
+ if test "x$ANTLR" = x; then
+ if test -z "$JAVA"; then
+ AC_MSG_ERROR(Failed to find either an antlr binary or a suitable Java runtime for ANTLR.)
+ else
+ if test -z "$ANTLR_JAR"; then
+ AC_MSG_ERROR(Failed to find either an antlr binary or a suitable antlr jar file.)
+ else
+ ANTLR="$JAVA -classpath $ANTLR_JAR antlr.Tool"
+ fi
+ fi
+ fi
+ AC_SUBST(ANTLR)
+ 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))
+ fi
+ AC_MSG_RESULT($antlr_version_major.$antlr_version_minor.$antlr_version_micro)
+])