Skip to content

Commit

Permalink
mqtt: Makefile split check for pkg-config
Browse files Browse the repository at this point in the history
libev doesn't have pkg-config file .pc on Debian
  • Loading branch information
linuxmaniac committed Jan 7, 2020
1 parent 1a035ea commit 50e1bb8
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/modules/mqtt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,34 @@ NAME=mqtt.so
ifeq ($(CROSS_COMPILE),)
BUILDER = $(shell which pkg-config)
ifneq ($(BUILDER),)
PKGLIBUV = $(shell $(BUILDER) --exists libmosquitto > /dev/null 2>&1 ; echo $$? )
ifneq ($(PKGLIBUV),0)
BUILDER =
endif
PKGLIBMO = $(shell $(BUILDER) --exists libmosquitto > /dev/null 2>&1 ; echo $$? )
PKGLIBEV = $(shell $(BUILDER) --exists libev > /dev/null 2>&1 ; echo $$? )
endif
endif

ifneq ($(BUILDER),)
ifeq ($(PKGLIBMO),0)
DEFS += $(shell $(BUILDER) --cflags libmosquitto)
LIBS += $(shell $(BUILDER) --libs libmosquitto)
else
ifneq (,$(findstring darwin,$(OS)))
DEFS += -I/opt/local/include -I$(LOCALBASE)/include
LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lmosquitto
else
DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include
LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lmosquitto
endif
endif

ifeq ($(PKGLIBEV),0)
DEFS += $(shell $(BUILDER) --cflags libev)
LIBS += $(shell $(BUILDER) --libs libev)
else
ifneq (,$(findstring darwin,$(OS)))
DEFS += -I/opt/local/include -I$(LOCALBASE)/include
LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lmosquitto -lev
LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lev
else
DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include
LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lmosquitto -lev
LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lev
endif
endif

Expand Down

0 comments on commit 50e1bb8

Please sign in to comment.