Add homebrew's libffi paths
authorFabio Utzig <utzig@utzig.org>
Thu, 8 Jan 2015 11:54:28 +0000 (09:54 -0200)
committerFabio Utzig <utzig@utzig.org>
Thu, 8 Jan 2015 11:54:28 +0000 (09:54 -0200)
Makefile

index 546f5722cb53d4d26c67e4be547a1dd3492ae6ac..970c11b8e753aed1b0ffd458709798667b61ee78 100644 (file)
--- 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