From 93eaa01b4b9e9c6add23bc77e6aa521f8ee1515f Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Mon, 15 Aug 2011 18:43:14 +0100 Subject: [PATCH] Check for msgpack support --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 90ca0cf..0e04b7f 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,20 @@ INSTALL_DIRS = $(DESTDIR) \ $(DESTDIR)/$(PREFIX)/bin \ $(CONFDIR) -all: $(OUT) Makefile +all: .CHECK_FOR_MSGPACK + +.CHECK_FOR_MSGPACK: + @if [ -f /usr/lib/libmsgpack.so ]; then make .WITH_MSGPACK; else make .WITHOUT_MSGPACK ; fi + +.WITH_MSGPACK: + @echo "Building with MsgPack support" + @make CFLAGS="$(CFLAGS) -DMSGPACK=1" .REAL_BUILD + +.WITHOUT_MSGPACK: + @echo "Building without MsgPack support" + @make .REAL_BUILD + +.REAL_BUILD: $(OUT) Makefile $(OUT): $(OBJS) Makefile $(CC) $(LDFLAGS) -o $(OUT) $(OBJS)