From: Braden M. <br...@us...> - 2006-04-27 04:51:27
|
Update of /cvsroot/openvrml/openvrml/m4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25598/m4 Modified Files: antlr.m4 Log Message: Ensure the version of antlr that gets used to generate code is the same as the version of libantlr that is included with OpenVRML. Index: antlr.m4 =================================================================== RCS file: /cvsroot/openvrml/openvrml/m4/antlr.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** antlr.m4 4 Nov 2005 07:47:29 -0000 1.1 --- antlr.m4 27 Apr 2006 04:51:24 -0000 1.2 *************** *** 1,15 **** AC_DEFUN([OV_PROG_ANTLR], [AC_REQUIRE([OV_PROG_JAVA]) ! AC_ARG_VAR([ANTLR]) AC_PATH_PROG([ANTLR], [antlr]) if test -z "$ANTLR"; then cat <<EOF > conftest.g class TestParser extends Parser; rule:; EOF ! AS_IF([$JAVA antlr.Tool conftest.g], ! [ANTLR="$JAVA antlr.Tool"], ! []) rm -rf conftest.g TestParser.java TestParserTokenTypes.java TestParserTokenTypes.txt fi ]) --- 1,28 ---- + dnl -*- mode: autoconf -*- AC_DEFUN([OV_PROG_ANTLR], [AC_REQUIRE([OV_PROG_JAVA]) ! AC_ARG_VAR([ANTLR], [antlr parser generator]) AC_PATH_PROG([ANTLR], [antlr]) if test -z "$ANTLR"; then + AC_MSG_CHECKING([if antlr is available to the Java runtime]) cat <<EOF > conftest.g class TestParser extends Parser; rule:; EOF ! AS_IF([$JAVA $JAVAFLAGS antlr.Tool conftest.g], ! [ANTLR="$JAVA $JAVAFLAGS antlr.Tool" ! AC_MSG_RESULT([yes])], ! [AC_MSG_RESULT([no])]) rm -rf conftest.g TestParser.java TestParserTokenTypes.java TestParserTokenTypes.txt fi + if test -n "$1" -a -n "$ANTLR"; then + AC_MSG_CHECKING([if antlr version is $1]) + version=`$ANTLR 2>&1 | head -n1 | cut -d' ' -f7` + if test X$version = X$1; then + AC_MSG_RESULT([yes]) + else + ANTLR= + AC_MSG_RESULT([no]) + fi + fi ]) |