Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=hostapd
  9. PKG_VERSION:=20091111
  10. PKG_RELEASE:=1
  11. PKG_REV:=dc6d9ac250f793a62b21ca828445967fb484305f
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
  14. PKG_SOURCE_SUBDIR:=hostapd-$(PKG_VERSION)
  15. PKG_SOURCE_VERSION:=$(PKG_REV)
  16. PKG_SOURCE_PROTO:=git
  17. PKG_BUILD_DEPENDS:= \
  18. PACKAGE_kmod-madwifi:madwifi \
  19. PACKAGE_kmod-mac80211:mac80211 \
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_PACKAGE_kmod-ath9k \
  22. CONFIG_PACKAGE_kmod-mac80211 \
  23. CONFIG_PACKAGE_kmod-madwifi \
  24. CONFIG_PACKAGE_hostapd \
  25. CONFIG_PACKAGE_hostapd-mini \
  26. CONFIG_PACKAGE_kmod-hostap
  27. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  28. include $(INCLUDE_DIR)/package.mk
  29. DRIVER_MAKEOPTS= \
  30. CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-mac80211) \
  31. CONFIG_DRIVER_MADWIFI=$(CONFIG_PACKAGE_kmod-madwifi) \
  32. CONFIG_DRIVER_HOSTAP=$(CONFIG_PACKAGE_kmod-hostap) \
  33. CONFIG_IEEE80211N=$(CONFIG_PACKAGE_kmod-ath9k)
  34. define Package/hostapd/Default
  35. SECTION:=net
  36. CATEGORY:=Network
  37. TITLE:=IEEE 802.1x Authenticator
  38. URL:=http://hostap.epitest.fi/
  39. DEPENDS:=@!TARGET_avr32 @!TARGET_etrax +PACKAGE_kmod-mac80211:libnl-tiny
  40. endef
  41. define Package/hostapd
  42. $(call Package/hostapd/Default)
  43. TITLE+= (full)
  44. VARIANT:=full
  45. endef
  46. define Package/hostapd/description
  47. This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
  48. Authenticator.
  49. endef
  50. define Package/hostapd-mini
  51. $(call Package/hostapd/Default)
  52. TITLE+= (WPA-PSK only)
  53. VARIANT:=mini
  54. endef
  55. define Package/hostapd-mini/description
  56. This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
  57. endef
  58. define Package/hostapd-utils
  59. $(call Package/hostapd/Default)
  60. TITLE+= (utils)
  61. DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
  62. endef
  63. define Package/hostapd-utils/description
  64. This package contains a command line utility to control the
  65. IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
  66. endef
  67. ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
  68. $(warning $(wildcard $(PKG_BUILD_DIR)/.config_*) != $(subst .configured_,.config_,$(STAMP_CONFIGURED)))
  69. define Build/Configure/rebuild
  70. rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
  71. rm -f $(PKG_BUILD_DIR)/hostapd/*.o
  72. rm -f $(PKG_BUILD_DIR)/src/drivers/drivers.o
  73. rm -f $(PKG_BUILD_DIR)/.config_*
  74. touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
  75. endef
  76. endif
  77. define Build/Configure
  78. $(Build/Configure/rebuild)
  79. $(CP) ./files/$(BUILD_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config
  80. endef
  81. TARGET_CPPFLAGS := \
  82. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  83. -I$(PKG_BUILD_DIR)/src/crypto \
  84. $(TARGET_CPPFLAGS) \
  85. -I$(STAGING_DIR)/usr/include/madwifi \
  86. -I$(STAGING_DIR)/usr/include/mac80211 \
  87. -DCONFIG_LIBNL20 \
  88. -D_GNU_SOURCE
  89. ifdef CONFIG_PACKAGE_kmod-mac80211
  90. TARGET_LDFLAGS += -lm -lnl-tiny
  91. endif
  92. define Build/Compile
  93. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  94. $(MAKE) -C $(PKG_BUILD_DIR)/hostapd \
  95. $(TARGET_CONFIGURE_OPTS) \
  96. $(DRIVER_MAKEOPTS) \
  97. LIBS="$(TARGET_LDFLAGS)" \
  98. hostapd hostapd_cli
  99. endef
  100. define Package/hostapd/install
  101. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  102. $(INSTALL_DATA) ./files/hostapd.hotplug $(1)/etc/hotplug.d/net/
  103. $(INSTALL_DIR) $(1)/lib/wifi
  104. $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/wifi/hostapd.sh
  105. $(INSTALL_DIR) $(1)/usr/sbin
  106. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
  107. endef
  108. Package/hostapd-mini/install = $(Package/hostapd/install)
  109. define Package/hostapd-utils/install
  110. $(INSTALL_DIR) $(1)/usr/sbin
  111. $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
  112. endef
  113. $(eval $(call BuildPackage,hostapd))
  114. $(eval $(call BuildPackage,hostapd-mini))
  115. $(eval $(call BuildPackage,hostapd-utils))