Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
ac6a0815
Commit
ac6a0815
authored
Nov 04, 2015
by
Tomek Mrugalski
🛰
Browse files
[4088] Bison version is now detected during configure.
parent
41146ec3
Changes
3
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
ac6a0815
...
...
@@ -1262,6 +1262,48 @@ AC_SUBST(PERL)
AC_PATH_PROGS(AWK, gawk awk)
AC_SUBST(AWK)
AC_ARG_ENABLE(generate_parser, [AC_HELP_STRING([--enable-generate-parser],
[indicates that the parsers will be regenerated. This implies that the
bison and flex are required [default=no]])],
enable_generate_parser=$enableval, enable_generate_parser=no)
# Check if flex is avaible. Flex is not needed for building Kea sources,
# unless you want to regenerate grammar in src/lib/eval
AC_PROG_LEX
# Check if bison is available. Bison is not needed for building Kea sources,
# unless you want to regenerate grammar in src/lib/eval
AC_PROG_YACC
if test "x$enable_generate_parser" != xno; then
if test "x$LEX" == "x"; then
AC_MSG_ERROR("Flex is required for enable-generate-parser, but was not found")
fi
if test "x$YACC" == "x"; then
AC_MSG_ERROR("Bison it required for enable-generate-parser, but was not found")
fi
# Ok, let's check if we have at least 3.0.0 version of the bison. The code used
# to generate src/lib/eval parser is roughly based on bison 3.0 examples.
cat > bisontest.y << EOF
%require "3.0.0"
%token X
%%
%start Y;
Y: X;
EOF
# Try to compile.
$YACC bisontest.y -o bisontest.cc
if test $? -ne 0 ; then
$YACC -V
AC_MSG_ERROR("Error with $YACC. Possibly incorrect version? Required at least 3.0.0.")
fi
rm -f bisontest.y bisontest.cc
fi
AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
[regenerate documentation using Docbook [default=no]])],
enable_generate_docs=$enableval, enable_generate_docs=no)
...
...
@@ -1577,6 +1619,10 @@ Log4cplus:
Kea config backend:
CONFIG_BACKEND: ${CONFIG_BACKEND}
Flex/bison:
FLEX: ${LEX}
BISON: ${YACC}
END
# Avoid confusion on DNS/DHCP and only mention MySQL if it
...
...
@@ -1637,6 +1683,7 @@ Developer:
C++ Code Coverage: $USE_LCOV
Logger checks: $enable_logger_checks
Generate Documentation: $enable_generate_docs
Parser Generation: $enable_generate_parser
END
...
...
src/lib/eval/Makefile.am
View file @
ac6a0815
...
...
@@ -68,9 +68,9 @@ parser: lexer.cc location.hh position.hh stack.hh parser.cc parser.h
# --- Flex/Bison stuff below --------------------------------------------------
location.hh position.hh stack.hh parser.cc parser.h
:
parser.yy
bison
--defines
=
parser.h
-oparser
.cc parser.yy
$(YACC)
--defines
=
parser.h
-oparser
.cc parser.yy
lexer.cc
:
lexer.ll
flex
-olexer
.cc lexer.ll
$(LEX)
-olexer
.cc lexer.ll
driver.o
:
driver.cc
src/lib/eval/parser.yy
View file @
ac6a0815
%skeleton "lalr1.cc" /* -*- C++ -*- */
%require "3.0.
2
"
%require "3.0.
0
"
%defines
%define parser_class_name {EvalParser}
%define api.token.constructor
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment