Skip to content

Commit

Permalink
Makefile: use flex -B flag for versions lower than 2.5.6
Browse files Browse the repository at this point in the history
Reported by Dragomir Haralambiev
  • Loading branch information
razvancrainea committed Nov 18, 2015
1 parent 8268bf8 commit 1a41bb1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile.defs
Expand Up @@ -1495,7 +1495,19 @@ ifeq ($(YACC),)
YACC=$(DEFAULT_YACC)
endif
YACC_FLAGS ?= -d -b cfg
LEX_FLAGS ?= --never-interactive

ifeq ($(LEX_FLAGS),)
LEX_VER=$(shell $(LEX) --version | \
tr -d "[a-zA-Z ]" | \
tr "\." " " | \
awk '{printf "%02d%02d%02d", $$1, $$2, $$3}')
# versions lower than 2.5.6 don't have never-interactive
ifeq ($(shell [ $(LEX_VER) -lt 020506 ] && echo old), old)
LEX_FLAGS = -B
else
LEX_FLAGS = --never-interactive
endif
endif

ifdef DEBUG_PARSER
CFLAGS+=-DYYDEBUG -DDEBUG_PARSER
Expand Down

0 comments on commit 1a41bb1

Please sign in to comment.