Android.mk 22 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094
  1. # Copyright (C) 2008 The Android Open Source Project
  2. #
  3. # This software may be distributed under the terms of the BSD license.
  4. # See README for more details.
  5. #
  6. LOCAL_PATH := $(call my-dir)
  7. WPA_BUILD_HOSTAPD := false
  8. ifneq ($(BOARD_HOSTAPD_DRIVER),)
  9. WPA_BUILD_HOSTAPD := true
  10. CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y
  11. endif
  12. ifeq ($(WPA_BUILD_HOSTAPD),true)
  13. include $(LOCAL_PATH)/android.config
  14. # To ignore possible wrong network configurations
  15. L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
  16. L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
  17. # Set Android log name
  18. L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
  19. # Disable unused parameter warnings
  20. L_CFLAGS += -Wno-unused-parameter
  21. # Set Android extended P2P functionality
  22. L_CFLAGS += -DANDROID_P2P
  23. ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  24. L_CFLAGS += -DANDROID_LIB_STUB
  25. endif
  26. # Use Android specific directory for control interface sockets
  27. L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
  28. L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/hostapd\"
  29. # Use Android specific directory for hostapd_cli command completion history
  30. L_CFLAGS += -DCONFIG_HOSTAPD_CLI_HISTORY_DIR=\"/data/misc/wifi\"
  31. # To force sizeof(enum) = 4
  32. ifeq ($(TARGET_ARCH),arm)
  33. L_CFLAGS += -mabi=aapcs-linux
  34. endif
  35. INCLUDES = $(LOCAL_PATH)
  36. INCLUDES += $(LOCAL_PATH)/src
  37. INCLUDES += $(LOCAL_PATH)/src/utils
  38. INCLUDES += system/security/keystore/include
  39. ifdef CONFIG_DRIVER_NL80211
  40. ifneq ($(wildcard external/libnl),)
  41. INCLUDES += external/libnl/include
  42. else
  43. INCLUDES += external/libnl-headers
  44. endif
  45. endif
  46. ifndef CONFIG_OS
  47. ifdef CONFIG_NATIVE_WINDOWS
  48. CONFIG_OS=win32
  49. else
  50. CONFIG_OS=unix
  51. endif
  52. endif
  53. ifeq ($(CONFIG_OS), internal)
  54. L_CFLAGS += -DOS_NO_C_LIB_DEFINES
  55. endif
  56. ifdef CONFIG_NATIVE_WINDOWS
  57. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  58. LIBS += -lws2_32
  59. endif
  60. OBJS = main.c
  61. OBJS += config_file.c
  62. OBJS += src/ap/hostapd.c
  63. OBJS += src/ap/wpa_auth_glue.c
  64. OBJS += src/ap/drv_callbacks.c
  65. OBJS += src/ap/ap_drv_ops.c
  66. OBJS += src/ap/utils.c
  67. OBJS += src/ap/authsrv.c
  68. OBJS += src/ap/ieee802_1x.c
  69. OBJS += src/ap/ap_config.c
  70. OBJS += src/ap/eap_user_db.c
  71. OBJS += src/ap/ieee802_11_auth.c
  72. OBJS += src/ap/sta_info.c
  73. OBJS += src/ap/wpa_auth.c
  74. OBJS += src/ap/tkip_countermeasures.c
  75. OBJS += src/ap/ap_mlme.c
  76. OBJS += src/ap/wpa_auth_ie.c
  77. OBJS += src/ap/preauth_auth.c
  78. OBJS += src/ap/pmksa_cache_auth.c
  79. OBJS += src/ap/ieee802_11_shared.c
  80. OBJS += src/ap/beacon.c
  81. OBJS += src/ap/bss_load.c
  82. OBJS += src/ap/neighbor_db.c
  83. OBJS += src/ap/rrm.c
  84. OBJS_d =
  85. OBJS_p =
  86. LIBS =
  87. LIBS_c =
  88. HOBJS =
  89. LIBS_h =
  90. NEED_RC4=y
  91. NEED_AES=y
  92. NEED_MD5=y
  93. NEED_SHA1=y
  94. OBJS += src/drivers/drivers.c
  95. L_CFLAGS += -DHOSTAPD
  96. ifdef CONFIG_WPA_TRACE
  97. L_CFLAGS += -DWPA_TRACE
  98. OBJS += src/utils/trace.c
  99. HOBJS += src/utils/trace.c
  100. LDFLAGS += -rdynamic
  101. L_CFLAGS += -funwind-tables
  102. ifdef CONFIG_WPA_TRACE_BFD
  103. L_CFLAGS += -DWPA_TRACE_BFD
  104. LIBS += -lbfd
  105. LIBS_c += -lbfd
  106. LIBS_h += -lbfd
  107. endif
  108. endif
  109. OBJS += src/utils/eloop.c
  110. ifdef CONFIG_ELOOP_POLL
  111. L_CFLAGS += -DCONFIG_ELOOP_POLL
  112. endif
  113. ifdef CONFIG_ELOOP_EPOLL
  114. L_CFLAGS += -DCONFIG_ELOOP_EPOLL
  115. endif
  116. OBJS += src/utils/common.c
  117. OBJS += src/utils/wpa_debug.c
  118. OBJS += src/utils/wpabuf.c
  119. OBJS += src/utils/os_$(CONFIG_OS).c
  120. OBJS += src/utils/ip_addr.c
  121. OBJS += src/common/ieee802_11_common.c
  122. OBJS += src/common/wpa_common.c
  123. OBJS += src/common/hw_features_common.c
  124. OBJS += src/eapol_auth/eapol_auth_sm.c
  125. ifndef CONFIG_NO_DUMP_STATE
  126. # define HOSTAPD_DUMP_STATE to include support for dumping internal state
  127. # through control interface commands (undefine it, if you want to save in
  128. # binary size)
  129. L_CFLAGS += -DHOSTAPD_DUMP_STATE
  130. OBJS += src/eapol_auth/eapol_auth_dump.c
  131. endif
  132. ifdef CONFIG_NO_RADIUS
  133. L_CFLAGS += -DCONFIG_NO_RADIUS
  134. CONFIG_NO_ACCOUNTING=y
  135. else
  136. OBJS += src/radius/radius.c
  137. OBJS += src/radius/radius_client.c
  138. OBJS += src/radius/radius_das.c
  139. endif
  140. ifdef CONFIG_NO_ACCOUNTING
  141. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  142. else
  143. OBJS += src/ap/accounting.c
  144. endif
  145. ifdef CONFIG_NO_VLAN
  146. L_CFLAGS += -DCONFIG_NO_VLAN
  147. else
  148. OBJS += src/ap/vlan_init.c
  149. OBJS += src/ap/vlan_ifconfig.c
  150. OBJS += src/ap/vlan.c
  151. ifdef CONFIG_FULL_DYNAMIC_VLAN
  152. # Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
  153. # and VLAN interfaces for the VLAN feature.
  154. L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
  155. OBJS += src/ap/vlan_full.c
  156. ifdef CONFIG_VLAN_NETLINK
  157. OBJS += src/ap/vlan_util.c
  158. else
  159. OBJS += src/ap/vlan_ioctl.c
  160. endif
  161. endif
  162. endif
  163. ifdef CONFIG_NO_CTRL_IFACE
  164. L_CFLAGS += -DCONFIG_NO_CTRL_IFACE
  165. else
  166. OBJS += src/common/ctrl_iface_common.c
  167. OBJS += ctrl_iface.c
  168. OBJS += src/ap/ctrl_iface_ap.c
  169. endif
  170. L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
  171. ifdef CONFIG_IAPP
  172. L_CFLAGS += -DCONFIG_IAPP
  173. OBJS += src/ap/iapp.c
  174. endif
  175. ifdef CONFIG_RSN_PREAUTH
  176. L_CFLAGS += -DCONFIG_RSN_PREAUTH
  177. CONFIG_L2_PACKET=y
  178. endif
  179. ifdef CONFIG_PEERKEY
  180. L_CFLAGS += -DCONFIG_PEERKEY
  181. OBJS += src/ap/peerkey_auth.c
  182. endif
  183. ifdef CONFIG_HS20
  184. NEED_AES_OMAC1=y
  185. CONFIG_PROXYARP=y
  186. endif
  187. ifdef CONFIG_PROXYARP
  188. CONFIG_L2_PACKET=y
  189. endif
  190. ifdef CONFIG_SUITEB
  191. L_CFLAGS += -DCONFIG_SUITEB
  192. NEED_SHA256=y
  193. NEED_AES_OMAC1=y
  194. endif
  195. ifdef CONFIG_SUITEB192
  196. L_CFLAGS += -DCONFIG_SUITEB192
  197. NEED_SHA384=y
  198. endif
  199. ifdef CONFIG_IEEE80211W
  200. L_CFLAGS += -DCONFIG_IEEE80211W
  201. NEED_SHA256=y
  202. NEED_AES_OMAC1=y
  203. endif
  204. ifdef CONFIG_IEEE80211R
  205. L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
  206. OBJS += src/ap/wpa_auth_ft.c
  207. NEED_SHA256=y
  208. NEED_AES_OMAC1=y
  209. NEED_AES_UNWRAP=y
  210. NEED_AES_SIV=y
  211. NEED_ETH_P_OUI=y
  212. NEED_SHA256=y
  213. NEED_HMAC_SHA256_KDF=y
  214. endif
  215. ifdef NEED_ETH_P_OUI
  216. L_CFLAGS += -DCONFIG_ETH_P_OUI
  217. OBJS += src/ap/eth_p_oui.c
  218. endif
  219. ifdef CONFIG_SAE
  220. L_CFLAGS += -DCONFIG_SAE
  221. OBJS += src/common/sae.c
  222. NEED_ECC=y
  223. NEED_DH_GROUPS=y
  224. endif
  225. ifdef CONFIG_OWE
  226. L_CFLAGS += -DCONFIG_OWE
  227. NEED_ECC=y
  228. NEED_HMAC_SHA256_KDF=y
  229. endif
  230. ifdef CONFIG_FILS
  231. L_CFLAGS += -DCONFIG_FILS
  232. OBJS += src/ap/fils_hlp.c
  233. NEED_SHA384=y
  234. NEED_AES_SIV=y
  235. ifdef CONFIG_FILS_SK_PFS
  236. L_CFLAGS += -DCONFIG_FILS_SK_PFS
  237. NEED_ECC=y
  238. endif
  239. endif
  240. ifdef CONFIG_WNM
  241. L_CFLAGS += -DCONFIG_WNM
  242. OBJS += src/ap/wnm_ap.c
  243. endif
  244. ifdef CONFIG_IEEE80211N
  245. L_CFLAGS += -DCONFIG_IEEE80211N
  246. endif
  247. ifdef CONFIG_IEEE80211AC
  248. L_CFLAGS += -DCONFIG_IEEE80211AC
  249. endif
  250. ifdef CONFIG_IEEE80211AX
  251. L_CFLAGS += -DCONFIG_IEEE80211AX
  252. endif
  253. ifdef CONFIG_MBO
  254. L_CFLAGS += -DCONFIG_MBO
  255. OBJS += src/ap/mbo_ap.c
  256. endif
  257. ifdef CONFIG_FST
  258. L_CFLAGS += -DCONFIG_FST
  259. OBJS += src/fst/fst.c
  260. OBJS += src/fst/fst_group.c
  261. OBJS += src/fst/fst_iface.c
  262. OBJS += src/fst/fst_session.c
  263. OBJS += src/fst/fst_ctrl_aux.c
  264. ifdef CONFIG_FST_TEST
  265. L_CFLAGS += -DCONFIG_FST_TEST
  266. endif
  267. ifndef CONFIG_NO_CTRL_IFACE
  268. OBJS += src/fst/fst_ctrl_iface.c
  269. endif
  270. endif
  271. include $(LOCAL_PATH)/src/drivers/drivers.mk
  272. OBJS += $(DRV_AP_OBJS)
  273. L_CFLAGS += $(DRV_AP_CFLAGS)
  274. LDFLAGS += $(DRV_AP_LDFLAGS)
  275. LIBS += $(DRV_AP_LIBS)
  276. ifdef CONFIG_L2_PACKET
  277. ifdef CONFIG_DNET_PCAP
  278. ifdef CONFIG_L2_FREEBSD
  279. LIBS += -lpcap
  280. OBJS += src/l2_packet/l2_packet_freebsd.c
  281. else
  282. LIBS += -ldnet -lpcap
  283. OBJS += src/l2_packet/l2_packet_pcap.c
  284. endif
  285. else
  286. OBJS += src/l2_packet/l2_packet_linux.c
  287. endif
  288. else
  289. OBJS += src/l2_packet/l2_packet_none.c
  290. endif
  291. ifdef CONFIG_EAP_MD5
  292. L_CFLAGS += -DEAP_SERVER_MD5
  293. OBJS += src/eap_server/eap_server_md5.c
  294. CHAP=y
  295. endif
  296. ifdef CONFIG_EAP_TLS
  297. L_CFLAGS += -DEAP_SERVER_TLS
  298. OBJS += src/eap_server/eap_server_tls.c
  299. TLS_FUNCS=y
  300. endif
  301. ifdef CONFIG_EAP_UNAUTH_TLS
  302. L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS
  303. ifndef CONFIG_EAP_TLS
  304. OBJS += src/eap_server/eap_server_tls.c
  305. TLS_FUNCS=y
  306. endif
  307. endif
  308. ifdef CONFIG_EAP_PEAP
  309. L_CFLAGS += -DEAP_SERVER_PEAP
  310. OBJS += src/eap_server/eap_server_peap.c
  311. OBJS += src/eap_common/eap_peap_common.c
  312. TLS_FUNCS=y
  313. CONFIG_EAP_MSCHAPV2=y
  314. endif
  315. ifdef CONFIG_EAP_TTLS
  316. L_CFLAGS += -DEAP_SERVER_TTLS
  317. OBJS += src/eap_server/eap_server_ttls.c
  318. TLS_FUNCS=y
  319. CHAP=y
  320. endif
  321. ifdef CONFIG_EAP_MSCHAPV2
  322. L_CFLAGS += -DEAP_SERVER_MSCHAPV2
  323. OBJS += src/eap_server/eap_server_mschapv2.c
  324. MS_FUNCS=y
  325. endif
  326. ifdef CONFIG_EAP_GTC
  327. L_CFLAGS += -DEAP_SERVER_GTC
  328. OBJS += src/eap_server/eap_server_gtc.c
  329. endif
  330. ifdef CONFIG_EAP_SIM
  331. L_CFLAGS += -DEAP_SERVER_SIM
  332. OBJS += src/eap_server/eap_server_sim.c
  333. CONFIG_EAP_SIM_COMMON=y
  334. NEED_AES_CBC=y
  335. endif
  336. ifdef CONFIG_EAP_AKA
  337. L_CFLAGS += -DEAP_SERVER_AKA
  338. OBJS += src/eap_server/eap_server_aka.c
  339. CONFIG_EAP_SIM_COMMON=y
  340. NEED_SHA256=y
  341. NEED_AES_CBC=y
  342. endif
  343. ifdef CONFIG_EAP_AKA_PRIME
  344. L_CFLAGS += -DEAP_SERVER_AKA_PRIME
  345. endif
  346. ifdef CONFIG_EAP_SIM_COMMON
  347. OBJS += src/eap_common/eap_sim_common.c
  348. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  349. # replaced with another file implementating the interface specified in
  350. # eap_sim_db.h.
  351. OBJS += src/eap_server/eap_sim_db.c
  352. NEED_FIPS186_2_PRF=y
  353. endif
  354. ifdef CONFIG_EAP_PAX
  355. L_CFLAGS += -DEAP_SERVER_PAX
  356. OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
  357. endif
  358. ifdef CONFIG_EAP_PSK
  359. L_CFLAGS += -DEAP_SERVER_PSK
  360. OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
  361. NEED_AES_OMAC1=y
  362. NEED_AES_ENCBLOCK=y
  363. NEED_AES_EAX=y
  364. endif
  365. ifdef CONFIG_EAP_SAKE
  366. L_CFLAGS += -DEAP_SERVER_SAKE
  367. OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
  368. endif
  369. ifdef CONFIG_EAP_GPSK
  370. L_CFLAGS += -DEAP_SERVER_GPSK
  371. OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
  372. ifdef CONFIG_EAP_GPSK_SHA256
  373. L_CFLAGS += -DEAP_GPSK_SHA256
  374. endif
  375. NEED_SHA256=y
  376. NEED_AES_OMAC1=y
  377. endif
  378. ifdef CONFIG_EAP_PWD
  379. L_CFLAGS += -DEAP_SERVER_PWD
  380. OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
  381. NEED_SHA256=y
  382. endif
  383. ifdef CONFIG_EAP_EKE
  384. L_CFLAGS += -DEAP_SERVER_EKE
  385. OBJS += src/eap_server/eap_server_eke.c src/eap_common/eap_eke_common.c
  386. NEED_DH_GROUPS=y
  387. NEED_DH_GROUPS_ALL=y
  388. endif
  389. ifdef CONFIG_EAP_VENDOR_TEST
  390. L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
  391. OBJS += src/eap_server/eap_server_vendor_test.c
  392. endif
  393. ifdef CONFIG_EAP_FAST
  394. L_CFLAGS += -DEAP_SERVER_FAST
  395. OBJS += src/eap_server/eap_server_fast.c
  396. OBJS += src/eap_common/eap_fast_common.c
  397. TLS_FUNCS=y
  398. NEED_T_PRF=y
  399. NEED_AES_UNWRAP=y
  400. endif
  401. ifdef CONFIG_WPS
  402. L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  403. OBJS += src/utils/uuid.c
  404. OBJS += src/ap/wps_hostapd.c
  405. OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
  406. OBJS += src/wps/wps.c
  407. OBJS += src/wps/wps_common.c
  408. OBJS += src/wps/wps_attr_parse.c
  409. OBJS += src/wps/wps_attr_build.c
  410. OBJS += src/wps/wps_attr_process.c
  411. OBJS += src/wps/wps_dev_attr.c
  412. OBJS += src/wps/wps_enrollee.c
  413. OBJS += src/wps/wps_registrar.c
  414. NEED_DH_GROUPS=y
  415. NEED_SHA256=y
  416. NEED_BASE64=y
  417. NEED_AES_CBC=y
  418. NEED_MODEXP=y
  419. CONFIG_EAP=y
  420. ifdef CONFIG_WPS_NFC
  421. L_CFLAGS += -DCONFIG_WPS_NFC
  422. OBJS += src/wps/ndef.c
  423. NEED_WPS_OOB=y
  424. endif
  425. ifdef NEED_WPS_OOB
  426. L_CFLAGS += -DCONFIG_WPS_OOB
  427. endif
  428. ifdef CONFIG_WPS_UPNP
  429. L_CFLAGS += -DCONFIG_WPS_UPNP
  430. OBJS += src/wps/wps_upnp.c
  431. OBJS += src/wps/wps_upnp_ssdp.c
  432. OBJS += src/wps/wps_upnp_web.c
  433. OBJS += src/wps/wps_upnp_event.c
  434. OBJS += src/wps/wps_upnp_ap.c
  435. OBJS += src/wps/upnp_xml.c
  436. OBJS += src/wps/httpread.c
  437. OBJS += src/wps/http_client.c
  438. OBJS += src/wps/http_server.c
  439. endif
  440. ifdef CONFIG_WPS_STRICT
  441. L_CFLAGS += -DCONFIG_WPS_STRICT
  442. OBJS += src/wps/wps_validate.c
  443. endif
  444. ifdef CONFIG_WPS_TESTING
  445. L_CFLAGS += -DCONFIG_WPS_TESTING
  446. endif
  447. endif
  448. ifdef CONFIG_DPP
  449. L_CFLAGS += -DCONFIG_DPP
  450. OBJS += src/common/dpp.c
  451. OBJS += src/ap/dpp_hostapd.c
  452. OBJS += src/ap/gas_query_ap.c
  453. NEED_AES_SIV=y
  454. NEED_HMAC_SHA256_KDF=y
  455. NEED_HMAC_SHA384_KDF=y
  456. NEED_HMAC_SHA512_KDF=y
  457. NEED_SHA256=y
  458. NEED_SHA384=y
  459. NEED_SHA512=y
  460. NEED_JSON=y
  461. NEED_GAS=y
  462. endif
  463. ifdef CONFIG_EAP_IKEV2
  464. L_CFLAGS += -DEAP_SERVER_IKEV2
  465. OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
  466. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  467. NEED_DH_GROUPS=y
  468. NEED_DH_GROUPS_ALL=y
  469. NEED_MODEXP=y
  470. NEED_CIPHER=y
  471. endif
  472. ifdef CONFIG_EAP_TNC
  473. L_CFLAGS += -DEAP_SERVER_TNC
  474. OBJS += src/eap_server/eap_server_tnc.c
  475. OBJS += src/eap_server/tncs.c
  476. NEED_BASE64=y
  477. ifndef CONFIG_DRIVER_BSD
  478. LIBS += -ldl
  479. endif
  480. endif
  481. # Basic EAP functionality is needed for EAPOL
  482. OBJS += eap_register.c
  483. OBJS += src/eap_server/eap_server.c
  484. OBJS += src/eap_common/eap_common.c
  485. OBJS += src/eap_server/eap_server_methods.c
  486. OBJS += src/eap_server/eap_server_identity.c
  487. L_CFLAGS += -DEAP_SERVER_IDENTITY
  488. ifdef CONFIG_EAP
  489. L_CFLAGS += -DEAP_SERVER
  490. endif
  491. ifdef CONFIG_PKCS12
  492. L_CFLAGS += -DPKCS12_FUNCS
  493. endif
  494. ifdef MS_FUNCS
  495. OBJS += src/crypto/ms_funcs.c
  496. NEED_DES=y
  497. NEED_MD4=y
  498. endif
  499. ifdef CHAP
  500. OBJS += src/eap_common/chap.c
  501. endif
  502. ifdef TLS_FUNCS
  503. NEED_DES=y
  504. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  505. L_CFLAGS += -DEAP_TLS_FUNCS
  506. OBJS += src/eap_server/eap_server_tls_common.c
  507. NEED_TLS_PRF=y
  508. endif
  509. ifndef CONFIG_TLS
  510. CONFIG_TLS=openssl
  511. endif
  512. ifdef CONFIG_TLSV11
  513. L_CFLAGS += -DCONFIG_TLSV11
  514. endif
  515. ifdef CONFIG_TLSV12
  516. L_CFLAGS += -DCONFIG_TLSV12
  517. NEED_SHA256=y
  518. endif
  519. ifeq ($(CONFIG_TLS), openssl)
  520. ifdef TLS_FUNCS
  521. OBJS += src/crypto/tls_openssl.c
  522. OBJS += src/crypto/tls_openssl_ocsp.c
  523. LIBS += -lssl
  524. endif
  525. OBJS += src/crypto/crypto_openssl.c
  526. HOBJS += src/crypto/crypto_openssl.c
  527. ifdef NEED_FIPS186_2_PRF
  528. OBJS += src/crypto/fips_prf_openssl.c
  529. endif
  530. NEED_SHA256=y
  531. NEED_TLS_PRF_SHA256=y
  532. LIBS += -lcrypto
  533. LIBS_h += -lcrypto
  534. endif
  535. ifeq ($(CONFIG_TLS), gnutls)
  536. ifdef TLS_FUNCS
  537. OBJS += src/crypto/tls_gnutls.c
  538. LIBS += -lgnutls -lgpg-error
  539. endif
  540. OBJS += src/crypto/crypto_gnutls.c
  541. HOBJS += src/crypto/crypto_gnutls.c
  542. ifdef NEED_FIPS186_2_PRF
  543. OBJS += src/crypto/fips_prf_internal.c
  544. OBJS += src/crypto/sha1-internal.c
  545. endif
  546. LIBS += -lgcrypt
  547. LIBS_h += -lgcrypt
  548. CONFIG_INTERNAL_SHA256=y
  549. CONFIG_INTERNAL_RC4=y
  550. CONFIG_INTERNAL_DH_GROUP5=y
  551. endif
  552. ifeq ($(CONFIG_TLS), internal)
  553. ifndef CONFIG_CRYPTO
  554. CONFIG_CRYPTO=internal
  555. endif
  556. ifdef TLS_FUNCS
  557. OBJS += src/crypto/crypto_internal-rsa.c
  558. OBJS += src/crypto/tls_internal.c
  559. OBJS += src/tls/tlsv1_common.c
  560. OBJS += src/tls/tlsv1_record.c
  561. OBJS += src/tls/tlsv1_cred.c
  562. OBJS += src/tls/tlsv1_server.c
  563. OBJS += src/tls/tlsv1_server_write.c
  564. OBJS += src/tls/tlsv1_server_read.c
  565. OBJS += src/tls/asn1.c
  566. OBJS += src/tls/rsa.c
  567. OBJS += src/tls/x509v3.c
  568. OBJS += src/tls/pkcs1.c
  569. OBJS += src/tls/pkcs5.c
  570. OBJS += src/tls/pkcs8.c
  571. NEED_SHA256=y
  572. NEED_BASE64=y
  573. NEED_TLS_PRF=y
  574. ifdef CONFIG_TLSV12
  575. NEED_TLS_PRF_SHA256=y
  576. endif
  577. NEED_MODEXP=y
  578. NEED_CIPHER=y
  579. L_CFLAGS += -DCONFIG_TLS_INTERNAL
  580. L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  581. endif
  582. ifdef NEED_CIPHER
  583. NEED_DES=y
  584. OBJS += src/crypto/crypto_internal-cipher.c
  585. endif
  586. ifdef NEED_MODEXP
  587. OBJS += src/crypto/crypto_internal-modexp.c
  588. OBJS += src/tls/bignum.c
  589. endif
  590. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  591. OBJS += src/crypto/crypto_libtomcrypt.c
  592. LIBS += -ltomcrypt -ltfm
  593. LIBS_h += -ltomcrypt -ltfm
  594. CONFIG_INTERNAL_SHA256=y
  595. CONFIG_INTERNAL_RC4=y
  596. CONFIG_INTERNAL_DH_GROUP5=y
  597. endif
  598. ifeq ($(CONFIG_CRYPTO), internal)
  599. OBJS += src/crypto/crypto_internal.c
  600. NEED_AES_DEC=y
  601. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  602. ifdef CONFIG_INTERNAL_LIBTOMMATH
  603. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  604. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  605. L_CFLAGS += -DLTM_FAST
  606. endif
  607. else
  608. LIBS += -ltommath
  609. LIBS_h += -ltommath
  610. endif
  611. CONFIG_INTERNAL_AES=y
  612. CONFIG_INTERNAL_DES=y
  613. CONFIG_INTERNAL_SHA1=y
  614. CONFIG_INTERNAL_MD4=y
  615. CONFIG_INTERNAL_MD5=y
  616. CONFIG_INTERNAL_SHA256=y
  617. CONFIG_INTERNAL_SHA384=y
  618. CONFIG_INTERNAL_SHA512=y
  619. CONFIG_INTERNAL_RC4=y
  620. CONFIG_INTERNAL_DH_GROUP5=y
  621. endif
  622. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  623. OBJS += src/crypto/crypto_cryptoapi.c
  624. OBJS_p += src/crypto/crypto_cryptoapi.c
  625. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  626. CONFIG_INTERNAL_SHA256=y
  627. CONFIG_INTERNAL_RC4=y
  628. endif
  629. endif
  630. ifeq ($(CONFIG_TLS), none)
  631. ifdef TLS_FUNCS
  632. OBJS += src/crypto/tls_none.c
  633. L_CFLAGS += -DEAP_TLS_NONE
  634. CONFIG_INTERNAL_AES=y
  635. CONFIG_INTERNAL_SHA1=y
  636. CONFIG_INTERNAL_MD5=y
  637. endif
  638. OBJS += src/crypto/crypto_none.c
  639. OBJS_p += src/crypto/crypto_none.c
  640. CONFIG_INTERNAL_SHA256=y
  641. CONFIG_INTERNAL_RC4=y
  642. endif
  643. ifndef TLS_FUNCS
  644. OBJS += src/crypto/tls_none.c
  645. ifeq ($(CONFIG_TLS), internal)
  646. CONFIG_INTERNAL_AES=y
  647. CONFIG_INTERNAL_SHA1=y
  648. CONFIG_INTERNAL_MD5=y
  649. CONFIG_INTERNAL_RC4=y
  650. endif
  651. endif
  652. AESOBJS = # none so far
  653. ifdef CONFIG_INTERNAL_AES
  654. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
  655. endif
  656. ifneq ($(CONFIG_TLS), openssl)
  657. AESOBJS += src/crypto/aes-wrap.c
  658. endif
  659. ifdef NEED_AES_EAX
  660. AESOBJS += src/crypto/aes-eax.c
  661. NEED_AES_CTR=y
  662. NEED_AES_OMAC1=y
  663. endif
  664. ifdef NEED_AES_SIV
  665. AESOBJS += src/crypto/aes-siv.c
  666. NEED_AES_CTR=y
  667. NEED_AES_OMAC1=y
  668. endif
  669. ifdef NEED_AES_CTR
  670. AESOBJS += src/crypto/aes-ctr.c
  671. endif
  672. ifdef NEED_AES_ENCBLOCK
  673. AESOBJS += src/crypto/aes-encblock.c
  674. endif
  675. ifdef NEED_AES_OMAC1
  676. AESOBJS += src/crypto/aes-omac1.c
  677. endif
  678. ifdef NEED_AES_UNWRAP
  679. ifneq ($(CONFIG_TLS), openssl)
  680. NEED_AES_DEC=y
  681. AESOBJS += src/crypto/aes-unwrap.c
  682. endif
  683. endif
  684. ifdef NEED_AES_CBC
  685. NEED_AES_DEC=y
  686. ifneq ($(CONFIG_TLS), openssl)
  687. AESOBJS += src/crypto/aes-cbc.c
  688. endif
  689. endif
  690. ifdef NEED_AES_DEC
  691. ifdef CONFIG_INTERNAL_AES
  692. AESOBJS += src/crypto/aes-internal-dec.c
  693. endif
  694. endif
  695. ifdef NEED_AES
  696. OBJS += $(AESOBJS)
  697. endif
  698. SHA1OBJS =
  699. ifdef NEED_SHA1
  700. ifneq ($(CONFIG_TLS), openssl)
  701. SHA1OBJS += src/crypto/sha1.c
  702. endif
  703. SHA1OBJS += src/crypto/sha1-prf.c
  704. ifdef CONFIG_INTERNAL_SHA1
  705. SHA1OBJS += src/crypto/sha1-internal.c
  706. ifdef NEED_FIPS186_2_PRF
  707. SHA1OBJS += src/crypto/fips_prf_internal.c
  708. endif
  709. endif
  710. ifneq ($(CONFIG_TLS), openssl)
  711. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  712. endif
  713. ifdef NEED_T_PRF
  714. SHA1OBJS += src/crypto/sha1-tprf.c
  715. endif
  716. ifdef NEED_TLS_PRF
  717. SHA1OBJS += src/crypto/sha1-tlsprf.c
  718. endif
  719. endif
  720. ifdef NEED_SHA1
  721. OBJS += $(SHA1OBJS)
  722. endif
  723. ifneq ($(CONFIG_TLS), openssl)
  724. OBJS += src/crypto/md5.c
  725. endif
  726. ifdef NEED_MD5
  727. ifdef CONFIG_INTERNAL_MD5
  728. OBJS += src/crypto/md5-internal.c
  729. HOBJS += src/crypto/md5-internal.c
  730. endif
  731. endif
  732. ifdef NEED_MD4
  733. ifdef CONFIG_INTERNAL_MD4
  734. OBJS += src/crypto/md4-internal.c
  735. endif
  736. endif
  737. ifdef NEED_DES
  738. ifdef CONFIG_INTERNAL_DES
  739. OBJS += src/crypto/des-internal.c
  740. endif
  741. endif
  742. ifdef CONFIG_NO_RC4
  743. L_CFLAGS += -DCONFIG_NO_RC4
  744. endif
  745. ifdef NEED_RC4
  746. ifdef CONFIG_INTERNAL_RC4
  747. ifndef CONFIG_NO_RC4
  748. OBJS += src/crypto/rc4.c
  749. endif
  750. endif
  751. endif
  752. ifdef NEED_SHA256
  753. L_CFLAGS += -DCONFIG_SHA256
  754. ifneq ($(CONFIG_TLS), openssl)
  755. OBJS += src/crypto/sha256.c
  756. endif
  757. OBJS += src/crypto/sha256-prf.c
  758. ifdef CONFIG_INTERNAL_SHA256
  759. OBJS += src/crypto/sha256-internal.c
  760. endif
  761. ifdef NEED_TLS_PRF_SHA256
  762. OBJS += src/crypto/sha256-tlsprf.c
  763. endif
  764. ifdef NEED_HMAC_SHA256_KDF
  765. OBJS += src/crypto/sha256-kdf.c
  766. endif
  767. ifdef NEED_HMAC_SHA384_KDF
  768. OBJS += src/crypto/sha384-kdf.c
  769. endif
  770. ifdef NEED_HMAC_SHA512_KDF
  771. OBJS += src/crypto/sha512-kdf.c
  772. endif
  773. endif
  774. ifdef NEED_SHA384
  775. L_CFLAGS += -DCONFIG_SHA384
  776. ifneq ($(CONFIG_TLS), openssl)
  777. OBJS += src/crypto/sha384.c
  778. endif
  779. OBJS += src/crypto/sha384-prf.c
  780. endif
  781. ifdef NEED_SHA512
  782. L_CFLAGS += -DCONFIG_SHA512
  783. ifneq ($(CONFIG_TLS), openssl)
  784. ifneq ($(CONFIG_TLS), linux)
  785. OBJS += src/crypto/sha512.c
  786. endif
  787. endif
  788. OBJS += src/crypto/sha512-prf.c
  789. endif
  790. ifdef CONFIG_INTERNAL_SHA384
  791. L_CFLAGS += -DCONFIG_INTERNAL_SHA384
  792. OBJS += src/crypto/sha384-internal.c
  793. endif
  794. ifdef CONFIG_INTERNAL_SHA512
  795. L_CFLAGS += -DCONFIG_INTERNAL_SHA512
  796. OBJS += src/crypto/sha512-internal.c
  797. endif
  798. ifdef NEED_DH_GROUPS
  799. OBJS += src/crypto/dh_groups.c
  800. endif
  801. ifdef NEED_DH_GROUPS_ALL
  802. L_CFLAGS += -DALL_DH_GROUPS
  803. endif
  804. ifdef CONFIG_INTERNAL_DH_GROUP5
  805. ifdef NEED_DH_GROUPS
  806. OBJS += src/crypto/dh_group5.c
  807. endif
  808. endif
  809. ifdef NEED_ECC
  810. L_CFLAGS += -DCONFIG_ECC
  811. endif
  812. ifdef CONFIG_NO_RANDOM_POOL
  813. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  814. else
  815. OBJS += src/crypto/random.c
  816. HOBJS += src/crypto/random.c
  817. HOBJS += src/utils/eloop.c
  818. HOBJS += $(SHA1OBJS)
  819. ifneq ($(CONFIG_TLS), openssl)
  820. HOBJS += src/crypto/md5.c
  821. endif
  822. endif
  823. ifdef CONFIG_RADIUS_SERVER
  824. L_CFLAGS += -DRADIUS_SERVER
  825. OBJS += src/radius/radius_server.c
  826. endif
  827. ifdef CONFIG_IPV6
  828. L_CFLAGS += -DCONFIG_IPV6
  829. endif
  830. ifdef CONFIG_DRIVER_RADIUS_ACL
  831. L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  832. endif
  833. ifdef NEED_BASE64
  834. OBJS += src/utils/base64.c
  835. endif
  836. ifdef NEED_JSON
  837. OBJS += src/utils/json.c
  838. L_CFLAGS += -DCONFIG_JSON
  839. endif
  840. ifdef NEED_AP_MLME
  841. OBJS += src/ap/wmm.c
  842. OBJS += src/ap/ap_list.c
  843. OBJS += src/ap/ieee802_11.c
  844. OBJS += src/ap/hw_features.c
  845. OBJS += src/ap/dfs.c
  846. L_CFLAGS += -DNEED_AP_MLME
  847. endif
  848. ifdef CONFIG_IEEE80211N
  849. OBJS += src/ap/ieee802_11_ht.c
  850. endif
  851. ifdef CONFIG_IEEE80211AC
  852. OBJS += src/ap/ieee802_11_vht.c
  853. endif
  854. ifdef CONFIG_IEEE80211AX
  855. OBJS += src/ap/ieee802_11_he.c
  856. endif
  857. ifdef CONFIG_P2P_MANAGER
  858. L_CFLAGS += -DCONFIG_P2P_MANAGER
  859. OBJS += src/ap/p2p_hostapd.c
  860. endif
  861. ifdef CONFIG_HS20
  862. L_CFLAGS += -DCONFIG_HS20
  863. OBJS += src/ap/hs20.c
  864. CONFIG_INTERWORKING=y
  865. endif
  866. ifdef CONFIG_INTERWORKING
  867. L_CFLAGS += -DCONFIG_INTERWORKING
  868. NEED_GAS=y
  869. endif
  870. ifdef NEED_GAS
  871. OBJS += src/common/gas.c
  872. OBJS += src/ap/gas_serv.c
  873. endif
  874. ifdef CONFIG_PROXYARP
  875. L_CFLAGS += -DCONFIG_PROXYARP
  876. OBJS += src/ap/x_snoop.c
  877. OBJS += src/ap/dhcp_snoop.c
  878. ifdef CONFIG_IPV6
  879. OBJS += src/ap/ndisc_snoop.c
  880. endif
  881. endif
  882. OBJS += src/drivers/driver_common.c
  883. ifdef CONFIG_ACS
  884. L_CFLAGS += -DCONFIG_ACS
  885. OBJS += src/ap/acs.c
  886. LIBS += -lm
  887. endif
  888. ifdef CONFIG_NO_STDOUT_DEBUG
  889. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  890. endif
  891. ifdef CONFIG_DEBUG_SYSLOG
  892. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  893. endif
  894. ifdef CONFIG_DEBUG_LINUX_TRACING
  895. L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  896. endif
  897. ifdef CONFIG_DEBUG_FILE
  898. L_CFLAGS += -DCONFIG_DEBUG_FILE
  899. endif
  900. ifdef CONFIG_ANDROID_LOG
  901. L_CFLAGS += -DCONFIG_ANDROID_LOG
  902. endif
  903. OBJS_c = hostapd_cli.c
  904. OBJS_c += src/common/wpa_ctrl.c
  905. OBJS_c += src/utils/os_$(CONFIG_OS).c
  906. OBJS_c += src/common/cli.c
  907. OBJS_c += src/utils/eloop.c
  908. OBJS_c += src/utils/common.c
  909. ifdef CONFIG_WPA_TRACE
  910. OBJS_c += src/utils/trace.c
  911. endif
  912. OBJS_c += src/utils/wpa_debug.c
  913. ifdef CONFIG_WPA_CLI_EDIT
  914. OBJS_c += src/utils/edit.c
  915. else
  916. OBJS_c += src/utils/edit_simple.c
  917. endif
  918. ########################
  919. include $(CLEAR_VARS)
  920. LOCAL_MODULE := hostapd_cli
  921. LOCAL_MODULE_TAGS := debug
  922. LOCAL_SHARED_LIBRARIES := libc libcutils liblog
  923. LOCAL_CFLAGS := $(L_CFLAGS)
  924. LOCAL_SRC_FILES := $(OBJS_c)
  925. LOCAL_C_INCLUDES := $(INCLUDES)
  926. include $(BUILD_EXECUTABLE)
  927. ########################
  928. include $(CLEAR_VARS)
  929. LOCAL_MODULE := hostapd
  930. LOCAL_MODULE_TAGS := optional
  931. ifdef CONFIG_DRIVER_CUSTOM
  932. LOCAL_STATIC_LIBRARIES := libCustomWifi
  933. endif
  934. ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  935. LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
  936. endif
  937. LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
  938. ifdef CONFIG_DRIVER_NL80211
  939. ifneq ($(wildcard external/libnl),)
  940. LOCAL_SHARED_LIBRARIES += libnl
  941. else
  942. LOCAL_STATIC_LIBRARIES += libnl_2
  943. endif
  944. endif
  945. LOCAL_CFLAGS := $(L_CFLAGS)
  946. LOCAL_SRC_FILES := $(OBJS)
  947. LOCAL_C_INCLUDES := $(INCLUDES)
  948. LOCAL_INIT_RC := hostapd.android.rc
  949. include $(BUILD_EXECUTABLE)
  950. endif # ifeq ($(WPA_BUILD_HOSTAPD),true)