From 0ca889a4331b4439444a64b4b1fde9a31472fd1a Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Thu, 8 Jan 2015 09:52:30 -0200 Subject: [PATCH 1/4] Add homebrew's readline paths --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8d2e7679d..546f5722c 100644 --- a/Makefile +++ b/Makefile @@ -37,9 +37,9 @@ LDLIBS = -lstdc++ -lm SED = sed ifeq (Darwin,$(findstring Darwin,$(shell uname))) - # add macports include and library path to search directories, don't use '-rdynamic' and '-lrt': - CXXFLAGS += -I/opt/local/include - LDFLAGS += -L/opt/local/lib + # add macports/homebrew include and library path to search directories, don't use '-rdynamic' and '-lrt': + CXXFLAGS += -I/opt/local/include -I/usr/local/opt/readline/include + LDFLAGS += -L/opt/local/lib -L/usr/local/opt/readline/lib SED = gsed else LDFLAGS += -rdynamic From b16ed78b4317448828ce4b3163ab8a5f94ef1891 Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Thu, 8 Jan 2015 09:54:28 -0200 Subject: [PATCH 2/4] Add homebrew's libffi paths --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 546f5722c..970c11b8e 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,9 @@ ifeq (Darwin,$(findstring Darwin,$(shell uname))) # add macports/homebrew include and library path to search directories, don't use '-rdynamic' and '-lrt': CXXFLAGS += -I/opt/local/include -I/usr/local/opt/readline/include LDFLAGS += -L/opt/local/lib -L/usr/local/opt/readline/lib + # add homebrew's libffi include and library path + CXXFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --cflags libffi) + LDFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --libs libffi) SED = gsed else LDFLAGS += -rdynamic From fff6f00b3c8704473bbb8149c82a2805fb1c32d2 Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Thu, 8 Jan 2015 09:56:20 -0200 Subject: [PATCH 3/4] Enable bison to be customized --- Makefile | 1 + frontends/ilang/Makefile.inc | 2 +- frontends/verilog/Makefile.inc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 970c11b8e..0ac0b7efd 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ CXXFLAGS = -Wall -Wextra -ggdb -I"$(shell pwd)" -MD -DYOSYS_SRC='"$(shell pwd)"' LDFLAGS = -L${DESTDIR}/lib LDLIBS = -lstdc++ -lm SED = sed +BISON = bison ifeq (Darwin,$(findstring Darwin,$(shell uname))) # add macports/homebrew include and library path to search directories, don't use '-rdynamic' and '-lrt': diff --git a/frontends/ilang/Makefile.inc b/frontends/ilang/Makefile.inc index 984d436c6..c15e2cc47 100644 --- a/frontends/ilang/Makefile.inc +++ b/frontends/ilang/Makefile.inc @@ -5,7 +5,7 @@ GENFILES += frontends/ilang/ilang_parser.output GENFILES += frontends/ilang/ilang_lexer.cc frontends/ilang/ilang_parser.tab.cc: frontends/ilang/ilang_parser.y - $(P) bison -d -r all -b frontends/ilang/ilang_parser frontends/ilang/ilang_parser.y + $(P) $(BISON) -d -r all -b frontends/ilang/ilang_parser frontends/ilang/ilang_parser.y $(Q) mv frontends/ilang/ilang_parser.tab.c frontends/ilang/ilang_parser.tab.cc frontends/ilang/ilang_parser.tab.h: frontends/ilang/ilang_parser.tab.cc diff --git a/frontends/verilog/Makefile.inc b/frontends/verilog/Makefile.inc index 1b6854bb5..92cbd0b87 100644 --- a/frontends/verilog/Makefile.inc +++ b/frontends/verilog/Makefile.inc @@ -5,7 +5,7 @@ GENFILES += frontends/verilog/verilog_parser.output GENFILES += frontends/verilog/verilog_lexer.cc frontends/verilog/verilog_parser.tab.cc: frontends/verilog/verilog_parser.y - $(P) bison -d -r all -b frontends/verilog/verilog_parser frontends/verilog/verilog_parser.y + $(P) $(BISON) -d -r all -b frontends/verilog/verilog_parser frontends/verilog/verilog_parser.y $(Q) mv frontends/verilog/verilog_parser.tab.c frontends/verilog/verilog_parser.tab.cc frontends/verilog/verilog_parser.tab.h: frontends/verilog/verilog_parser.tab.cc From 0a231f96d79d3eae927bf33571846c98f78eedfd Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Thu, 8 Jan 2015 09:58:24 -0200 Subject: [PATCH 4/4] Enable use of homebrew's provided bison if available --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 0ac0b7efd..a3aa2a397 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,8 @@ ifeq (Darwin,$(findstring Darwin,$(shell uname))) # add homebrew's libffi include and library path CXXFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --cflags libffi) LDFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --libs libffi) + # use bison installed by homebrew if available + BISON = $(shell (brew list bison | grep -m1 "bin/bison") || echo bison) SED = gsed else LDFLAGS += -rdynamic