From 2814f05a67b8d375036a025698cca842ebdac180 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Tue, 3 Dec 2019 15:10:45 +0100
Subject: [PATCH] Add flag to compilation of flex file

Without this flag flex errors out because it hits a hard-coded size limit
---
 src/Makefile.am | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index b14f11a0..24c56e11 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -68,8 +68,11 @@ dynare_m_CPPFLAGS = $(BOOST_CPPFLAGS) -I.
 dynare_m_LDFLAGS = $(AM_LDFLAGS) $(BOOST_LDFLAGS)
 dynare_m_LDADD = macro/libmacro.a -lstdc++fs
 
+# -Ca flag comes from hitting a hard-coded size limit.
+# Partial explanation: https://www.owlfolio.org/possibly-useful/flex-input-scanner-rules-are-too-complicated
+# There is a Debian bug report about this: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=642040
 DynareFlex.cc: DynareFlex.ll
-	$(LEX) -o DynareFlex.cc DynareFlex.ll
+	$(LEX) -Ca -o DynareFlex.cc DynareFlex.ll
 
 FlexLexer.h:
 	cp $(LEXINC)/FlexLexer.h . || test -f ./FlexLexer.h
-- 
GitLab