From 8f516b83e24da3dd8e8aec2fc21c29760f2b566f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Thu, 7 Jan 2021 18:40:01 +0100
Subject: [PATCH] macOS package: fixes related to flex and bison in Homebrew

(manually cherry picked from commit 80460af6d7ec4dfe5e9496edd54cc84388ef8604)
---
 README.md      | 2 +-
 macOS/build.sh | 2 ++
 preprocessor   | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index c575d05647..77ea9355a3 100644
--- a/README.md
+++ b/README.md
@@ -348,5 +348,5 @@ folder where you want Dynare installed.
 - `make -j`
 - **(Optional)** To then build mex files for Octave, run
      - `cd mex/build/octave`
-     - `CC=gcc-9 CXX=g++-9 ./configure --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local LDFLAGS=-L/usr/local/lib`
+     - `CC=gcc-9 CXX=g++-9 ./configure --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local LDFLAGS=-L/usr/local/lib LEX=/usr/local/opt/flex/bin/flex YACC=/usr/local/opt/bison/bin/bison`
      - `make -j`
diff --git a/macOS/build.sh b/macOS/build.sh
index dd696db5d8..fec2090562 100755
--- a/macOS/build.sh
+++ b/macOS/build.sh
@@ -69,6 +69,8 @@ CC=$CC CXX=$CXX ./configure \
   PACKAGE_STRING="dynare $VERSION" \
   CXXFLAGS=-I/usr/local/include \
   LDFLAGS=-static-libgcc \
+  LEX=/usr/local/opt/flex/bin/flex \
+  YACC=/usr/local/opt/bison/bin/bison \
   --with-gsl="$LIB64"/gsl \
   --with-matio="$LIB64"/matio \
   --with-slicot="$LIB64"/Slicot/with-underscore \
diff --git a/preprocessor b/preprocessor
index 5365cc3b86..bfc002a054 160000
--- a/preprocessor
+++ b/preprocessor
@@ -1 +1 @@
-Subproject commit 5365cc3b86e0cb447d7c10d1b1ba83d1914dec74
+Subproject commit bfc002a054ad44449671ef2bc54d5fe9f2202138
-- 
GitLab