From 97d9d774305b26c8bc43ef37a031a9d02b04e8b4 Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Wed, 4 Aug 2021 18:22:21 -0700 Subject: [PATCH] Add Makefile section to detect msgpackc with ld If all checks fail, use ld to look for -lmsgpackc. This doesn't work on macOS, but seems to pick up installs that were as of yet undetected. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index dda94be..841d7b7 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,14 @@ ifneq ($(strip $(MSGPACK_OSX_LIB)),) FORMAT_OBJS += src/formats/msgpack.o CFLAGS += -DMSGPACK=1 LDFLAGS += -lmsgpackc +else +# check for MessagePackC using ld (returns 1 in both cases on macOS) +MSGPACKC_LD=$(shell ld -lmsgpackc >/dev/null 2>/dev/null; echo $$?) +ifeq ($(strip $(MSGPACKC_LD)),0) + FORMAT_OBJS += src/formats/msgpack.o + CFLAGS += -DMSGPACK=1 + LDFLAGS += -lmsgpackc +endif endif endif endif