Skip to content

Instantly share code, notes, and snippets.

@andreypopp
Created October 20, 2022 18:12
Show Gist options
  • Save andreypopp/361ad2eb854021ed1839447737f32b27 to your computer and use it in GitHub Desktop.
Save andreypopp/361ad2eb854021ed1839447737f32b27 to your computer and use it in GitHub Desktop.
diff --git a/makefile b/makefile
index bf26179..6f02914 100644
--- a/makefile
+++ b/makefile
@@ -87,8 +87,13 @@ else
endif
endif
ifeq ($(i_FFI),2)
+ifeq ($(shell command -v pkg-config 2>&1 > /dev/null && pkg-config --exists libffi && echo $$?),0)
+ i_LD_LIBS += $(shell pkg-config --libs libffi)
+ CCFLAGS += $(shell pkg-config --cflags libffi)
+else
i_LD_LIBS += -lffi
endif
+endif
ifeq ($(origin LD_LIBS),command line)
i_LD_LIBS := $(LD_LIBS)
custom = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment