For --as-needed to work (and for traditional ld too) the libraries should
always be passed _after_ the object files, move them so that they are
picked up properly.
Also rename LIBS to NLLIBS to avoid confusion between LIBS/LDLIBS.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
ifeq ($(NL2FOUND),Y)
CFLAGS += -DCONFIG_LIBNL20
-LIBS += -lnl-genl
+NLLIBS += -lnl-genl
NLLIBNAME = libnl-2.0
endif
-LIBS += `pkg-config --libs $(NLLIBNAME)`
+NLLIBS += `pkg-config --libs $(NLLIBNAME)`
CFLAGS += `pkg-config --cflags $(NLLIBNAME)`
ifeq ($(V),1)
crda: reglib.o crda.o
$(NQ) ' LD ' $@
- $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $^ $(LDLIBS)
+ $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(NLLIBS)
regdbdump: reglib.o regdbdump.o print-regdom.o
$(NQ) ' LD ' $@