hostapd: use the new build variants feature to clean up the makefile
[openwrt.git] / package / hostapd / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=hostapd
11 PKG_VERSION:=0.6.9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://hostap.epitest.fi/releases/
16 PKG_SOURCE_SUBDIR:=hostapd-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=$(PKG_REV)
18 PKG_MD5SUM:=83630d11fa66ade9091f1b304fccd74c
19
20 PKG_BUILD_DEPENDS:= \
21 PACKAGE_kmod-madwifi:madwifi \
22 PACKAGE_kmod-mac80211:mac80211 \
23
24 PKG_CONFIG_DEPENDS:= \
25 CONFIG_PACKAGE_kmod-ath9k \
26 CONFIG_PACKAGE_kmod-mac80211 \
27 CONFIG_PACKAGE_kmod-madwifi \
28 CONFIG_PACKAGE_hostapd \
29 CONFIG_PACKAGE_hostapd-mini \
30 CONFIG_PACKAGE_kmod-hostap
31
32 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
33
34 include $(INCLUDE_DIR)/package.mk
35
36 DRIVER_MAKEOPTS= \
37 CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-mac80211) \
38 CONFIG_DRIVER_MADWIFI=$(CONFIG_PACKAGE_kmod-madwifi) \
39 CONFIG_DRIVER_HOSTAP=$(CONFIG_PACKAGE_kmod-hostap) \
40 CONFIG_IEEE80211N=$(CONFIG_PACKAGE_kmod-ath9k)
41
42 define Package/hostapd/Default
43 SECTION:=net
44 CATEGORY:=Network
45 TITLE:=IEEE 802.1x Authenticator
46 URL:=http://hostap.epitest.fi/
47 DEPENDS:=@!TARGET_avr32 @!TARGET_etrax +PACKAGE_kmod-mac80211:libnl-tiny
48 endef
49
50 define Package/hostapd
51 $(call Package/hostapd/Default)
52 TITLE+= (full)
53 DEPENDS+= +PACKAGE_hostapd:libopenssl
54 VARIANT:=full
55 endef
56
57 define Package/hostapd/description
58 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
59 Authenticator.
60 endef
61
62 define Package/hostapd-mini
63 $(call Package/hostapd/Default)
64 TITLE+= (WPA-PSK only)
65 VARIANT:=mini
66 endef
67
68 define Package/hostapd-mini/description
69 This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
70 endef
71
72 define Package/hostapd-utils
73 $(call Package/hostapd/Default)
74 TITLE+= (utils)
75 DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
76 endef
77
78 define Package/hostapd-utils/description
79 This package contains a command line utility to control the
80 IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
81 endef
82
83 define Build/Configure
84 $(CP) ./files/$(BUILD_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config
85 endef
86
87 TARGET_CPPFLAGS := \
88 -I$(STAGING_DIR)/usr/include/libnl-tiny \
89 -I$(PKG_BUILD_DIR)/src/crypto \
90 $(TARGET_CPPFLAGS) \
91 -I$(STAGING_DIR)/usr/include/madwifi \
92 -I$(STAGING_DIR)/usr/include/mac80211 \
93 -DCONFIG_LIBNL20 \
94 -D_GNU_SOURCE
95
96 ifdef CONFIG_PACKAGE_kmod-mac80211
97 TARGET_LDFLAGS += -lm -lnl-tiny
98 endif
99 ifeq ($(BUILD_VARIANT),full)
100 TARGET_LDFLAGS += -lssl -lcrypto
101 endif
102
103 define Build/Compile
104 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
105 $(MAKE) -C $(PKG_BUILD_DIR)/hostapd \
106 $(TARGET_CONFIGURE_OPTS) \
107 $(DRIVER_MAKEOPTS) \
108 LIBS="$(TARGET_LDFLAGS)" \
109 hostapd hostapd_cli
110 endef
111
112 define Package/InstallTemplate
113 $(INSTALL_DIR) $(1)/lib/wifi
114 $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/wifi/hostapd.sh
115 $(INSTALL_DIR) $(1)/usr/sbin
116 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
117 endef
118
119 ifeq ($(BUILD_VARIANT),full)
120 Package/hostapd/install = $(Package/InstallTemplate)
121 else
122 Package/hostapd-mini/install = $(Package/InstallTemplate)
123 endif
124
125 define Package/hostapd-utils/install
126 $(INSTALL_DIR) $(1)/usr/sbin
127 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd_cli $(1)/usr/sbin/
128 endef
129
130 $(eval $(call BuildPackage,hostapd))
131 $(eval $(call BuildPackage,hostapd-mini))
132 $(eval $(call BuildPackage,hostapd-utils))
This page took 0.053261 seconds and 5 git commands to generate.