libiwinfo: compile with -D_GNU_SOURCE, fixes eglibc compatibility
[project/luci.git] / contrib / package / iwinfo / Makefile
1 #
2 # Copyright (C) 2010-2011 Jo-Philipp Wich <xm@subsignal.org>
3 #
4 # This is free software, licensed under the GPL 2 license.
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=libiwinfo
10 PKG_RELEASE:=15
11
12 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
13
14 include $(INCLUDE_DIR)/package.mk
15
16
17 define Package/libiwinfo
18   SECTION:=luci
19   CATEGORY:=LuCI
20   SUBMENU:=Libraries
21   TITLE:=Generalized Wireless Information Library (iwinfo)
22   DEPENDS:=+PACKAGE_kmod-mac80211:libnl-tiny +liblua +lua
23   DEFAULT:=PACKAGE_luci-lib-sys
24 endef
25
26 define Package/libiwinfo/description
27   Wireless information library with consistent interface for proprietary Broadcom,
28   madwifi, nl80211 and wext driver interfaces.
29 endef
30
31 define Build/Prepare
32         mkdir -p $(PKG_BUILD_DIR)
33         $(CP) ./src/* $(PKG_BUILD_DIR)/
34 endef
35
36 define Build/Configure
37 endef
38
39 IWINFO_BACKENDS := \
40         $(if $(CONFIG_PACKAGE_kmod-brcm-wl),wl) \
41         $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mini),wl) \
42         $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mimo),wl) \
43         $(if $(CONFIG_PACKAGE_kmod-madwifi),madwifi) \
44         $(if $(CONFIG_PACKAGE_kmod-mac80211),nl80211)
45
46 TARGET_CFLAGS += \
47         -I$(STAGING_DIR)/usr/include/libnl-tiny \
48         -I$(STAGING_DIR)/usr/include \
49         -D_GNU_SOURCE
50
51 MAKE_FLAGS += \
52         FPIC="$(FPIC)" \
53         CFLAGS="$(TARGET_CFLAGS)" \
54         LDFLAGS="$(TARGET_LDFLAGS)" \
55         BACKENDS="$(IWINFO_BACKENDS)"
56
57 define Package/libiwinfo/install
58         $(INSTALL_DIR) $(1)/usr/bin
59         $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.lua $(1)/usr/bin/iwinfo
60         $(INSTALL_DIR) $(1)/usr/lib/lua
61         $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so
62 endef
63
64 $(eval $(call BuildPackage,libiwinfo))