blob: 471d120b0b3b974d48ef38e0573d232c792f324d [file] [log] [blame] [edit]
diff -aruN iw-3.10/Makefile iw-3.10.n/Makefile
--- iw-3.10/Makefile 2013-05-02 00:29:10.000000000 -0700
+++ iw-3.10.n/Makefile 2015-03-24 12:35:45.731563338 -0700
@@ -25,6 +25,31 @@
ALL = iw
+ifdef NLLIBNAME
+
+NLLIBS = -lnl
+
+ifeq ($(NLLIBNAME),libnl-1)
+NL1FOUND := Y
+endif
+
+ifeq ($(NLLIBNAME),libnl-2.0)
+NL2FOUND := Y
+endif
+
+ifdef NLCFLAGS
+CFLAGS += $(NLCFLAGS)
+endif
+
+ifdef NLLDFLAGS
+LDFLAGS += $(NLLDFLAGS)
+endif
+
+ifdef NLLIBS
+LIBS += $(NLLIBS)
+endif
+
+else
ifeq ($(NO_PKG_CONFIG),)
NL3xFOUND := $(shell $(PKG_CONFIG) --atleast-version=3.2 libnl-3.0 && echo Y)
ifneq ($(NL3xFOUND),Y)
@@ -39,14 +64,13 @@
endif
endif
endif
+endif
ifeq ($(NL1FOUND),Y)
NLLIBNAME = libnl-1
endif
ifeq ($(NL2FOUND),Y)
-CFLAGS += -DCONFIG_LIBNL20
-LIBS += -lnl-genl
NLLIBNAME = libnl-2.0
endif
@@ -80,6 +104,11 @@
CFLAGS += $(shell $(PKG_CONFIG) --cflags $(NLLIBNAME))
endif # NO_PKG_CONFIG
+ifeq ($(NL2FOUND),Y)
+CFLAGS += -DCONFIG_LIBNL20
+LIBS += -lnl-genl
+endif
+
ifeq ($(V),1)
Q=
NQ=true
@@ -88,7 +117,17 @@
NQ=echo
endif
-all: $(ALL)
+all: version_check $(ALL)
+
+version_check:
+ifeq ($(NL2FOUND),Y)
+else
+ifeq ($(NL1FOUND),Y)
+else
+ $(error No libnl found)
+endif
+endif
+
VERSION_OBJS := $(filter-out version.o, $(OBJS))