mirror of https://github.com/YosysHQ/yosys.git
use Homebrew only if installed
This commit is contained in:
parent
7481ba4750
commit
44b47b57e3
14
Makefile
14
Makefile
|
@ -62,15 +62,17 @@ SED = sed
|
||||||
BISON = bison
|
BISON = bison
|
||||||
|
|
||||||
ifeq (Darwin,$(findstring Darwin,$(shell uname)))
|
ifeq (Darwin,$(findstring Darwin,$(shell uname)))
|
||||||
|
BREW := $(shell command -v brew 2> /dev/null)
|
||||||
|
ifdef BREW
|
||||||
|
export PKG_CONFIG_PATH = $(shell $(BREW) list libffi | grep pkgconfig | xargs dirname)
|
||||||
|
BISON = $(shell $(BREW) list bison | grep -m1 "bin/bison")
|
||||||
|
endif
|
||||||
# add macports/homebrew include and library path to search directories, don't use '-rdynamic' and '-lrt':
|
# 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
|
CXXFLAGS += -I/opt/local/include -I/usr/local/opt/readline/include
|
||||||
LDFLAGS += -L/opt/local/lib -L/usr/local/opt/readline/lib
|
LDFLAGS += -L/opt/local/lib -L/usr/local/opt/readline/lib
|
||||||
# add homebrew's libffi include and library path
|
# add macports/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)
|
CXXFLAGS += $(shell pkg-config --silence-errors --cflags libffi)
|
||||||
LDFLAGS += $(shell PKG_CONFIG_PATH=$$(brew list libffi | grep pkgconfig | xargs dirname) pkg-config --silence-errors --libs libffi)
|
LDFLAGS += $(shell 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 = sed
|
|
||||||
else
|
else
|
||||||
LDFLAGS += -rdynamic
|
LDFLAGS += -rdynamic
|
||||||
LDLIBS += -lrt
|
LDLIBS += -lrt
|
||||||
|
|
Loading…
Reference in New Issue