OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [classpath/] [m4/] [ac_prog_antlr.m4] - Blame information for rev 773

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 773 jeremybenn
 
2
AC_DEFUN([AC_LIB_ANTLR],[
3
  AC_MSG_CHECKING([for the ANTLR parser generator JAR file])
4
  if test -z "$ANTLR_JAR"; then
5
    for antlr_lib_home in `ls -d /usr/local/share/antlr* 2> /dev/null` \
6
        /usr/share/antlr/lib /usr/share/java /usr/lib;
7
        do
8
            if test -f "$antlr_lib_home/antlr.jar"; then
9
              ANTLR_JAR="$antlr_lib_home/antlr.jar"
10
              break
11
            fi
12
     done
13
  fi
14
  test -f $ANTLR_JAR || AC_MSG_ERROR([specified ANTLR jar file $ANTLR_JAR not found.]) \
15
        && AC_MSG_RESULT([$ANTLR_JAR])
16
  AC_SUBST(ANTLR_JAR)
17
  AC_PROVIDE([$0])dnl
18
])
19
 
20
AC_DEFUN([AC_PROG_ANTLR],[
21
  AC_REQUIRE([AC_PROG_JAVA])dnl
22
  AC_CHECK_TOOLS([ANTLR], [cantlr runantlr antlr])
23
  if test "x$ANTLR" = x; then
24
      if test -z "$JAVA"; then
25
        AC_MSG_ERROR(Failed to find either an antlr binary or a suitable Java runtime for ANTLR.)
26
      else
27
        if test -z "$ANTLR_JAR"; then
28
          AC_MSG_ERROR(Failed to find either an antlr binary or a suitable antlr jar file.)
29
        else
30
          ANTLR="$JAVA -classpath $ANTLR_JAR antlr.Tool"
31
        fi
32
      fi
33
  fi
34
  AC_SUBST(ANTLR)
35
  AC_MSG_CHECKING([for antlr $1.$2.$3 or better])
36
  antlr_version_str=`$ANTLR 2>&1 | head -n 1 | sed '/.*Version */!d; s///;q'`
37
  if test "$antlr_version_str"; then
38
    antlr_version_regex='s/\([[[:digit:]]]\+\)\.\([[[:digit:]]]\+\)\.\([[[:digit:]]]\+\).*$/'
39
    antlr_version_major=`echo $antlr_version_str | sed "$antlr_version_regex\\1/"`
40
    antlr_version_minor=`echo $antlr_version_str | sed "$antlr_version_regex\\2/"`
41
    antlr_version_micro=`echo $antlr_version_str | sed "$antlr_version_regex\\3/"`
42
    (test $antlr_version_major -gt $1 || \
43
    (test $antlr_version_major -eq $1 && \
44
     test $antlr_version_minor -gt $2) || \
45
    (test $antlr_version_major -eq $1 && \
46
     test $antlr_version_minor -eq $2 && \
47
     test $antlr_version_micro -ge $3))
48
  fi
49
  AC_MSG_RESULT($antlr_version_major.$antlr_version_minor.$antlr_version_micro)
50
])

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.