CATEGORY:=LuCI
SUBMENU:=Libraries
TITLE:=Generalized Wireless Information Library (iwinfo)
- DEPENDS:=+libnl-tiny +liblua +lua
+ DEPENDS:=+PACKAGE_kmod-mac80211:libnl-tiny +liblua +lua
endef
define Package/libiwinfo/description
define Build/Configure
endef
+IWINFO_BACKENDS := \
+ $(if $(CONFIG_PACKAGE_kmod-brcm-wl),wl) \
+ $(if $(CONFIG_PACKAGE_kmod-madwifi),madwifi) \
+ $(if $(CONFIG_PACKAGE_kmod-mac80211),nl80211)
+
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl-tiny
MAKE_FLAGS += \
FPIC="$(FPIC)" \
CFLAGS="$(TARGET_CFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)"
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ BACKENDS="$(IWINFO_BACKENDS)"
define Package/libiwinfo/install
$(INSTALL_DIR) $(1)/usr/bin
-IWINFO_LDFLAGS = $(LDFLAGS) -shared -llua $(if $(CRAP),,-lnl-tiny)
-IWINFO_CFLAGS = $(CFLAGS) -std=gnu99 -fstrict-aliasing $(if $(CRAP),-DUSE_WL,-DUSE_MADWIFI -DUSE_NL80211)
+IWINFO_BACKENDS = $(if $(BACKENDS),$(BACKENDS),madwifi nl80211)
+IWINFO_LDFLAGS = $(LDFLAGS) -shared -llua
+IWINFO_CFLAGS = $(CFLAGS) -std=gnu99 -fstrict-aliasing
IWINFO_SO = iwinfo.so
-IWINFO_OBJ = $(if $(CRAP),iwinfo_wl.o,iwinfo_madwifi.o iwinfo_nl80211.o) \
- iwinfo_wext.o iwinfo_wext_scan.o iwinfo_lualib.o
+IWINFO_OBJ = iwinfo_wext.o iwinfo_wext_scan.o iwinfo_lualib.o
+
+ifneq ($(filter wl,$(IWINFO_BACKENDS)),)
+ IWINFO_CFLAGS += -DUSE_WL
+ IWINFO_OBJ += iwinfo_wl.o
+endif
+
+ifneq ($(filter madwifi,$(IWINFO_BACKENDS)),)
+ IWINFO_CFLAGS += -DUSE_MADWIFI
+ IWINFO_OBJ += iwinfo_madwifi.o
+endif
+
+ifneq ($(filter nl80211,$(IWINFO_BACKENDS)),)
+ IWINFO_CFLAGS += -DUSE_NL80211
+ IWINFO_LDFLAGS += -lnl-tiny
+ IWINFO_OBJ += iwinfo_nl80211.o
+endif
+
%.o: %.c
$(CC) $(IWINFO_CFLAGS) $(LUA_CFLAGS) $(FPIC) -c -o $@ $<
c->auth_algs |= IWINFO_AUTH_SHARED;
/* ToDo: evaluate WEP key lengths */
- c->auth_ciphers = IWINFO_CIPHER_WEP40 | IWINFO_CIPHER_WEP104;
+ c->pair_ciphers = IWINFO_CIPHER_WEP40 | IWINFO_CIPHER_WEP104;
c->auth_suites |= IWINFO_KMGMT_NONE;
break;