From 3e3278d01101583f314f44fb8b84fe2250848f5e Mon Sep 17 00:00:00 2001 From: Gianni Chiappetta Date: Mon, 25 Nov 2024 21:06:20 -0500 Subject: [PATCH] fix: force linking of shared libraries during build --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 20d98ca..d738d07 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ MIX = mix -CFLAGS += -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter +CFLAGS += -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Wl,--no-as-needed ERLANG_PATH = $(shell erl -eval 'io:format("~s", [lists:concat([code:root_dir(), "/erts-", erlang:system_info(version), "/include"])])' -s init stop -noshell) CFLAGS += -I$(ERLANG_PATH) -CFLAGS += -I/usr/local/include -I/usr/include -L/usr/local/lib -L/usr/lib -CFLAGS += -lpostal +CFLAGS += $(shell pkg-config --cflags libpostal) CFLAGS += -std=gnu99 -Wno-unused-function +LDFLAGS=$(shell pkg-config --libs libpostal) + ifeq ($(wildcard deps/libpostal),) LIBPOSTAL_PATH = ../libpostal else