summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-03-30 20:22:33 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-03-30 20:22:33 +0000
commit8730e9320a833a9eb0e65074f9988950b7424c0c (patch)
tree1cb09404256743e208fece079ba473595e05edcd /config
parent8c87c05ac56a5f29b2ae1e658f2d7d3b7b588163 (diff)
Merging from branches/antlr3 (r246:354)
Diffstat (limited to 'config')
-rw-r--r--config/.gitignore11
-rw-r--r--config/antlr.m461
2 files changed, 27 insertions, 45 deletions
diff --git a/config/.gitignore b/config/.gitignore
new file mode 100644
index 000000000..dfeb8c222
--- /dev/null
+++ b/config/.gitignore
@@ -0,0 +1,11 @@
+/libtool.m4
+/depcomp
+/lt~obsolete.m4
+/config.guess
+/config.sub
+/ltmain.sh
+/ltsugar.m4
+/ltversion.m4
+/missing
+/ltoptions.m4
+/install-sh
diff --git a/config/antlr.m4 b/config/antlr.m4
index 408df0d84..842b9b51d 100644
--- a/config/antlr.m4
+++ b/config/antlr.m4
@@ -3,28 +3,18 @@
# runantlr script
##
AC_DEFUN([AC_PROG_ANTLR], [
- AC_ARG_VAR([ANTLR],[location of the runantlr script])
-
- # Get the location of the runantlr script
- # AC_ARG_WITH(
- # [antlr],
- # AS_HELP_STRING(
- # [--with-antlr=RUNANTLR],
- # [location of the ANTLR's `runantlr` script]
- # ),
- # ANTLR="$withval",
- # )
+ AC_ARG_VAR([ANTLR],[location of the antlr3 script])
# Check the existance of the runantlr script
if test -z "$ANTLR"; then
- AC_CHECK_PROGS(ANTLR, [runantlr antlr])
+ AC_CHECK_PROGS(ANTLR, [antlr3])
else
AC_CHECK_PROG(ANTLR, "$ANTLR", "$ANTLR", [])
fi
if test no$ANTLR = "no";
then
AC_MSG_WARN(
- [Couldn't find the runantlr script, make sure that the parser code has
+ [Couldn't find the antlr3 script, make sure that the parser code has
been generated already. To obtain ANTLR see <http://www.antlr.org/>.]
)
AC_MSG_RESULT(no)
@@ -35,7 +25,7 @@ AC_DEFUN([AC_PROG_ANTLR], [
])
##
-# Check the existnace of the ANTLR C++ runtime library and headers
+# Check the existance of the ANTLR C++ runtime library and headers
# Will set ANTLR_CPPFLAGS and ANTLR_LIBS to the location of the ANTLR headers
# and library respectively
##
@@ -46,16 +36,16 @@ AC_DEFUN([AC_LIB_ANTLR],[
[antlr-dir],
AS_HELP_STRING(
[--with-antlr-dir=PATH],
- [path to ANTLR C++ headers and libraries]
+ [path to ANTLR C headers and libraries]
),
ANTLR_PREFIXES="$withval",
ANTLR_PREFIXES="/usr/local /usr /opt/local /opt"
)
- AC_MSG_CHECKING(for antlr C++ runtime library)
+ AC_MSG_CHECKING(for ANTLR C runtime library)
- # Use C++ and remember the variables we are changing
- AC_LANG_PUSH(C++)
+ # Use C and remember the variables we are changing
+ AC_LANG_PUSH(C)
OLD_CPPFLAGS="$CPPFLAGS"
OLD_LIBS="$LIBS"
@@ -63,46 +53,27 @@ AC_DEFUN([AC_LIB_ANTLR],[
for antlr_prefix in $ANTLR_PREFIXES
do
CPPFLAGS="$OLD_CPPFLAGS -I$antlr_prefix/include"
- LIBS="$OLD_LIBS -L$antlr_prefix/lib -lantlr-pic"
+ LIBS="$OLD_LIBS -L$antlr_prefix/lib -lantlr3c"
AC_LINK_IFELSE(
[
- #include <antlr/CommonAST.hpp>
- class MyAST : public ANTLR_USE_NAMESPACE(antlr)CommonAST {
- };
+ #include <antlr3.h>
+
int main() {
- MyAST ast;
+ pANTLR3_UINT8 fName = (pANTLR3_UINT8)"foo";
+ pANTLR3_INPUT_STREAM input = antlr3AsciiFileStreamNew(fName);
+ return 0;
}
],
[
AC_MSG_RESULT(found in $antlr_prefix)
ANTLR_INCLUDES="-I$antlr_prefix/include"
- ANTLR_LDFLAGS="-L$antlr_prefix/lib -lantlr-pic"
+ ANTLR_LDFLAGS="-L$antlr_prefix/lib -lantlr3c"
break
],
- [
- CPPFLAGS="$OLD_CPPFLAGS -I$antlr_prefix/include"
- LIBS="$OLD_LIBS -L$antlr_prefix/lib -lantlr"
- AC_LINK_IFELSE(
- [
- #include <antlr/CommonAST.hpp>
- class MyAST : public ANTLR_USE_NAMESPACE(antlr)CommonAST {
- };
- int main() {
- MyAST ast;
- }
- ],
- [
- AC_MSG_RESULT(found in $antlr_prefix)
- ANTLR_INCLUDES="-I$antlr_prefix/include"
- ANTLR_LDFLAGS="-L$antlr_prefix/lib -lantlr"
- break
- ],
[
AC_MSG_RESULT(no)
- AC_MSG_ERROR([ANTLR C++ runtime not found, see <http://www.antlr.org/>])
+ AC_MSG_ERROR([ANTLR C runtime not found, see <http://www.antlr.org/>])
]
- )
- ]
)
done
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback