blob: 200400efa818e1ffd06153ed2477e8e80cf3636d [file] [log] [blame]
diff -aruN a/Makefile b/Makefile
--- a/Makefile 2011-08-09 16:36:19.000000000 -0700
+++ b/Makefile 2011-12-19 11:10:07.548686490 -0800
@@ -45,32 +45,64 @@
MKDIR ?= mkdir -p
INSTALL ?= install
-NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y)
-NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y)
-NL3FOUND := $(shell pkg-config --atleast-version=3 libnl-3.0 && echo Y)
+ifdef NLLIBNAME
+
+NLLIBS += -lnl
+
+ifeq ($(NLLIBNAME),libnl-1)
+NL1FOUND := Y
+endif
+
+ifeq ($(NLLIBNAME),libnl-2.0)
+NL2FOUND := Y
+endif
+
+ifeq ($(NLLIBNAME),libnl-3.0)
+NL3FOUND := Y
+endif
+
+ifdef NLCFLAGS
+CFLAGS += $(NLCFLAGS)
+endif
+
+ifdef NLLDFLAGS
+LDFLAGS += $(NLLDFLAGS)
+endif
+
+else
+NL1FOUND := $(shell $(PKG_CONFIG) --atleast-version=1 libnl-1 && echo Y)
+NL2FOUND := $(shell $(PKG_CONFIG) --atleast-version=2 libnl-2.0 && echo Y)
+NL3FOUND := $(shell $(PKG_CONFIG) --atleast-version=3 libnl-3.0 && echo Y)
+
+ifeq ($(NL1FOUND),Y)
+NLLIBNAME = libnl-1
+endif
+
+ifeq ($(NL2FOUND),Y)
+NLLIBNAME = libnl-2.0
+endif
ifeq ($(NL3FOUND),Y)
-CFLAGS += -DCONFIG_LIBNL30
-NLLIBS += -lnl-genl
NLLIBNAME = libnl-3.0
-else
- ifeq ($(NL2FOUND),Y)
- CFLAGS += -DCONFIG_LIBNL20
- NLLIBS += -lnl-genl
- NLLIBNAME = libnl-2.0
- else
- ifeq ($(NL1FOUND),Y)
- NLLIBNAME = libnl-1
- endif
- endif
endif
ifeq ($(NLLIBNAME),)
$(error Cannot find development files for any supported version of libnl)
endif
-NLLIBS += `pkg-config --libs $(NLLIBNAME)`
-CFLAGS += `pkg-config --cflags $(NLLIBNAME)`
+NLLIBS += $(shell $(PKG_CONFIG) --libs $(NLLIBNAME))
+CFLAGS += $(shell $(PKG_CONFIG) --cflags $(NLLIBNAME))
+endif
+
+ifeq ($(NL2FOUND),Y)
+CFLAGS += -DCONFIG_LIBNL20
+NLLIBS += -lnl-genl
+endif
+
+ifeq ($(NL3FOUND),Y)
+CFLAGS += -DCONFIG_LIBNL30
+NLLIBS += -lnl-genl
+endif
ifeq ($(V),1)
Q=