Android.mk 20 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  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. endif
  211. ifdef CONFIG_SAE
  212. L_CFLAGS += -DCONFIG_SAE
  213. OBJS += src/common/sae.c
  214. NEED_ECC=y
  215. NEED_DH_GROUPS=y
  216. endif
  217. ifdef CONFIG_FILS
  218. L_CFLAGS += -DCONFIG_FILS
  219. OBJS += src/ap/fils_hlp.c
  220. NEED_SHA384=y
  221. NEED_AES_SIV=y
  222. endif
  223. ifdef CONFIG_WNM
  224. L_CFLAGS += -DCONFIG_WNM
  225. OBJS += src/ap/wnm_ap.c
  226. endif
  227. ifdef CONFIG_IEEE80211N
  228. L_CFLAGS += -DCONFIG_IEEE80211N
  229. endif
  230. ifdef CONFIG_IEEE80211AC
  231. L_CFLAGS += -DCONFIG_IEEE80211AC
  232. endif
  233. ifdef CONFIG_IEEE80211AX
  234. L_CFLAGS += -DCONFIG_IEEE80211AX
  235. endif
  236. ifdef CONFIG_MBO
  237. L_CFLAGS += -DCONFIG_MBO
  238. OBJS += src/ap/mbo_ap.c
  239. endif
  240. ifdef CONFIG_FST
  241. L_CFLAGS += -DCONFIG_FST
  242. OBJS += src/fst/fst.c
  243. OBJS += src/fst/fst_group.c
  244. OBJS += src/fst/fst_iface.c
  245. OBJS += src/fst/fst_session.c
  246. OBJS += src/fst/fst_ctrl_aux.c
  247. ifdef CONFIG_FST_TEST
  248. L_CFLAGS += -DCONFIG_FST_TEST
  249. endif
  250. ifndef CONFIG_NO_CTRL_IFACE
  251. OBJS += src/fst/fst_ctrl_iface.c
  252. endif
  253. endif
  254. include $(LOCAL_PATH)/src/drivers/drivers.mk
  255. OBJS += $(DRV_AP_OBJS)
  256. L_CFLAGS += $(DRV_AP_CFLAGS)
  257. LDFLAGS += $(DRV_AP_LDFLAGS)
  258. LIBS += $(DRV_AP_LIBS)
  259. ifdef CONFIG_L2_PACKET
  260. ifdef CONFIG_DNET_PCAP
  261. ifdef CONFIG_L2_FREEBSD
  262. LIBS += -lpcap
  263. OBJS += src/l2_packet/l2_packet_freebsd.c
  264. else
  265. LIBS += -ldnet -lpcap
  266. OBJS += src/l2_packet/l2_packet_pcap.c
  267. endif
  268. else
  269. OBJS += src/l2_packet/l2_packet_linux.c
  270. endif
  271. else
  272. OBJS += src/l2_packet/l2_packet_none.c
  273. endif
  274. ifdef CONFIG_EAP_MD5
  275. L_CFLAGS += -DEAP_SERVER_MD5
  276. OBJS += src/eap_server/eap_server_md5.c
  277. CHAP=y
  278. endif
  279. ifdef CONFIG_EAP_TLS
  280. L_CFLAGS += -DEAP_SERVER_TLS
  281. OBJS += src/eap_server/eap_server_tls.c
  282. TLS_FUNCS=y
  283. endif
  284. ifdef CONFIG_EAP_UNAUTH_TLS
  285. L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS
  286. ifndef CONFIG_EAP_TLS
  287. OBJS += src/eap_server/eap_server_tls.c
  288. TLS_FUNCS=y
  289. endif
  290. endif
  291. ifdef CONFIG_EAP_PEAP
  292. L_CFLAGS += -DEAP_SERVER_PEAP
  293. OBJS += src/eap_server/eap_server_peap.c
  294. OBJS += src/eap_common/eap_peap_common.c
  295. TLS_FUNCS=y
  296. CONFIG_EAP_MSCHAPV2=y
  297. endif
  298. ifdef CONFIG_EAP_TTLS
  299. L_CFLAGS += -DEAP_SERVER_TTLS
  300. OBJS += src/eap_server/eap_server_ttls.c
  301. TLS_FUNCS=y
  302. CHAP=y
  303. endif
  304. ifdef CONFIG_EAP_MSCHAPV2
  305. L_CFLAGS += -DEAP_SERVER_MSCHAPV2
  306. OBJS += src/eap_server/eap_server_mschapv2.c
  307. MS_FUNCS=y
  308. endif
  309. ifdef CONFIG_EAP_GTC
  310. L_CFLAGS += -DEAP_SERVER_GTC
  311. OBJS += src/eap_server/eap_server_gtc.c
  312. endif
  313. ifdef CONFIG_EAP_SIM
  314. L_CFLAGS += -DEAP_SERVER_SIM
  315. OBJS += src/eap_server/eap_server_sim.c
  316. CONFIG_EAP_SIM_COMMON=y
  317. NEED_AES_CBC=y
  318. endif
  319. ifdef CONFIG_EAP_AKA
  320. L_CFLAGS += -DEAP_SERVER_AKA
  321. OBJS += src/eap_server/eap_server_aka.c
  322. CONFIG_EAP_SIM_COMMON=y
  323. NEED_SHA256=y
  324. NEED_AES_CBC=y
  325. endif
  326. ifdef CONFIG_EAP_AKA_PRIME
  327. L_CFLAGS += -DEAP_SERVER_AKA_PRIME
  328. endif
  329. ifdef CONFIG_EAP_SIM_COMMON
  330. OBJS += src/eap_common/eap_sim_common.c
  331. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  332. # replaced with another file implementating the interface specified in
  333. # eap_sim_db.h.
  334. OBJS += src/eap_server/eap_sim_db.c
  335. NEED_FIPS186_2_PRF=y
  336. endif
  337. ifdef CONFIG_EAP_PAX
  338. L_CFLAGS += -DEAP_SERVER_PAX
  339. OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
  340. endif
  341. ifdef CONFIG_EAP_PSK
  342. L_CFLAGS += -DEAP_SERVER_PSK
  343. OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
  344. NEED_AES_OMAC1=y
  345. NEED_AES_ENCBLOCK=y
  346. NEED_AES_EAX=y
  347. endif
  348. ifdef CONFIG_EAP_SAKE
  349. L_CFLAGS += -DEAP_SERVER_SAKE
  350. OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
  351. endif
  352. ifdef CONFIG_EAP_GPSK
  353. L_CFLAGS += -DEAP_SERVER_GPSK
  354. OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
  355. ifdef CONFIG_EAP_GPSK_SHA256
  356. L_CFLAGS += -DEAP_GPSK_SHA256
  357. endif
  358. NEED_SHA256=y
  359. NEED_AES_OMAC1=y
  360. endif
  361. ifdef CONFIG_EAP_PWD
  362. L_CFLAGS += -DEAP_SERVER_PWD
  363. OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
  364. NEED_SHA256=y
  365. endif
  366. ifdef CONFIG_EAP_EKE
  367. L_CFLAGS += -DEAP_SERVER_EKE
  368. OBJS += src/eap_server/eap_server_eke.c src/eap_common/eap_eke_common.c
  369. NEED_DH_GROUPS=y
  370. NEED_DH_GROUPS_ALL=y
  371. endif
  372. ifdef CONFIG_EAP_VENDOR_TEST
  373. L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
  374. OBJS += src/eap_server/eap_server_vendor_test.c
  375. endif
  376. ifdef CONFIG_EAP_FAST
  377. L_CFLAGS += -DEAP_SERVER_FAST
  378. OBJS += src/eap_server/eap_server_fast.c
  379. OBJS += src/eap_common/eap_fast_common.c
  380. TLS_FUNCS=y
  381. NEED_T_PRF=y
  382. NEED_AES_UNWRAP=y
  383. endif
  384. ifdef CONFIG_WPS
  385. L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  386. OBJS += src/utils/uuid.c
  387. OBJS += src/ap/wps_hostapd.c
  388. OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
  389. OBJS += src/wps/wps.c
  390. OBJS += src/wps/wps_common.c
  391. OBJS += src/wps/wps_attr_parse.c
  392. OBJS += src/wps/wps_attr_build.c
  393. OBJS += src/wps/wps_attr_process.c
  394. OBJS += src/wps/wps_dev_attr.c
  395. OBJS += src/wps/wps_enrollee.c
  396. OBJS += src/wps/wps_registrar.c
  397. NEED_DH_GROUPS=y
  398. NEED_SHA256=y
  399. NEED_BASE64=y
  400. NEED_AES_CBC=y
  401. NEED_MODEXP=y
  402. CONFIG_EAP=y
  403. ifdef CONFIG_WPS_NFC
  404. L_CFLAGS += -DCONFIG_WPS_NFC
  405. OBJS += src/wps/ndef.c
  406. NEED_WPS_OOB=y
  407. endif
  408. ifdef NEED_WPS_OOB
  409. L_CFLAGS += -DCONFIG_WPS_OOB
  410. endif
  411. ifdef CONFIG_WPS_UPNP
  412. L_CFLAGS += -DCONFIG_WPS_UPNP
  413. OBJS += src/wps/wps_upnp.c
  414. OBJS += src/wps/wps_upnp_ssdp.c
  415. OBJS += src/wps/wps_upnp_web.c
  416. OBJS += src/wps/wps_upnp_event.c
  417. OBJS += src/wps/wps_upnp_ap.c
  418. OBJS += src/wps/upnp_xml.c
  419. OBJS += src/wps/httpread.c
  420. OBJS += src/wps/http_client.c
  421. OBJS += src/wps/http_server.c
  422. endif
  423. ifdef CONFIG_WPS_STRICT
  424. L_CFLAGS += -DCONFIG_WPS_STRICT
  425. OBJS += src/wps/wps_validate.c
  426. endif
  427. ifdef CONFIG_WPS_TESTING
  428. L_CFLAGS += -DCONFIG_WPS_TESTING
  429. endif
  430. endif
  431. ifdef CONFIG_EAP_IKEV2
  432. L_CFLAGS += -DEAP_SERVER_IKEV2
  433. OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
  434. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  435. NEED_DH_GROUPS=y
  436. NEED_DH_GROUPS_ALL=y
  437. NEED_MODEXP=y
  438. NEED_CIPHER=y
  439. endif
  440. ifdef CONFIG_EAP_TNC
  441. L_CFLAGS += -DEAP_SERVER_TNC
  442. OBJS += src/eap_server/eap_server_tnc.c
  443. OBJS += src/eap_server/tncs.c
  444. NEED_BASE64=y
  445. ifndef CONFIG_DRIVER_BSD
  446. LIBS += -ldl
  447. endif
  448. endif
  449. # Basic EAP functionality is needed for EAPOL
  450. OBJS += eap_register.c
  451. OBJS += src/eap_server/eap_server.c
  452. OBJS += src/eap_common/eap_common.c
  453. OBJS += src/eap_server/eap_server_methods.c
  454. OBJS += src/eap_server/eap_server_identity.c
  455. L_CFLAGS += -DEAP_SERVER_IDENTITY
  456. ifdef CONFIG_EAP
  457. L_CFLAGS += -DEAP_SERVER
  458. endif
  459. ifdef CONFIG_PKCS12
  460. L_CFLAGS += -DPKCS12_FUNCS
  461. endif
  462. ifdef MS_FUNCS
  463. OBJS += src/crypto/ms_funcs.c
  464. NEED_DES=y
  465. NEED_MD4=y
  466. endif
  467. ifdef CHAP
  468. OBJS += src/eap_common/chap.c
  469. endif
  470. ifdef TLS_FUNCS
  471. NEED_DES=y
  472. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  473. L_CFLAGS += -DEAP_TLS_FUNCS
  474. OBJS += src/eap_server/eap_server_tls_common.c
  475. NEED_TLS_PRF=y
  476. endif
  477. ifndef CONFIG_TLS
  478. CONFIG_TLS=openssl
  479. endif
  480. ifdef CONFIG_TLSV11
  481. L_CFLAGS += -DCONFIG_TLSV11
  482. endif
  483. ifdef CONFIG_TLSV12
  484. L_CFLAGS += -DCONFIG_TLSV12
  485. NEED_SHA256=y
  486. endif
  487. ifeq ($(CONFIG_TLS), openssl)
  488. ifdef TLS_FUNCS
  489. OBJS += src/crypto/tls_openssl.c
  490. OBJS += src/crypto/tls_openssl_ocsp.c
  491. LIBS += -lssl
  492. endif
  493. OBJS += src/crypto/crypto_openssl.c
  494. HOBJS += src/crypto/crypto_openssl.c
  495. ifdef NEED_FIPS186_2_PRF
  496. OBJS += src/crypto/fips_prf_openssl.c
  497. endif
  498. NEED_SHA256=y
  499. NEED_TLS_PRF_SHA256=y
  500. LIBS += -lcrypto
  501. LIBS_h += -lcrypto
  502. endif
  503. ifeq ($(CONFIG_TLS), gnutls)
  504. ifdef TLS_FUNCS
  505. OBJS += src/crypto/tls_gnutls.c
  506. LIBS += -lgnutls -lgpg-error
  507. endif
  508. OBJS += src/crypto/crypto_gnutls.c
  509. HOBJS += src/crypto/crypto_gnutls.c
  510. ifdef NEED_FIPS186_2_PRF
  511. OBJS += src/crypto/fips_prf_internal.c
  512. OBJS += src/crypto/sha1-internal.c
  513. endif
  514. LIBS += -lgcrypt
  515. LIBS_h += -lgcrypt
  516. CONFIG_INTERNAL_SHA256=y
  517. CONFIG_INTERNAL_RC4=y
  518. CONFIG_INTERNAL_DH_GROUP5=y
  519. endif
  520. ifeq ($(CONFIG_TLS), internal)
  521. ifndef CONFIG_CRYPTO
  522. CONFIG_CRYPTO=internal
  523. endif
  524. ifdef TLS_FUNCS
  525. OBJS += src/crypto/crypto_internal-rsa.c
  526. OBJS += src/crypto/tls_internal.c
  527. OBJS += src/tls/tlsv1_common.c
  528. OBJS += src/tls/tlsv1_record.c
  529. OBJS += src/tls/tlsv1_cred.c
  530. OBJS += src/tls/tlsv1_server.c
  531. OBJS += src/tls/tlsv1_server_write.c
  532. OBJS += src/tls/tlsv1_server_read.c
  533. OBJS += src/tls/asn1.c
  534. OBJS += src/tls/rsa.c
  535. OBJS += src/tls/x509v3.c
  536. OBJS += src/tls/pkcs1.c
  537. OBJS += src/tls/pkcs5.c
  538. OBJS += src/tls/pkcs8.c
  539. NEED_SHA256=y
  540. NEED_BASE64=y
  541. NEED_TLS_PRF=y
  542. ifdef CONFIG_TLSV12
  543. NEED_TLS_PRF_SHA256=y
  544. endif
  545. NEED_MODEXP=y
  546. NEED_CIPHER=y
  547. L_CFLAGS += -DCONFIG_TLS_INTERNAL
  548. L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  549. endif
  550. ifdef NEED_CIPHER
  551. NEED_DES=y
  552. OBJS += src/crypto/crypto_internal-cipher.c
  553. endif
  554. ifdef NEED_MODEXP
  555. OBJS += src/crypto/crypto_internal-modexp.c
  556. OBJS += src/tls/bignum.c
  557. endif
  558. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  559. OBJS += src/crypto/crypto_libtomcrypt.c
  560. LIBS += -ltomcrypt -ltfm
  561. LIBS_h += -ltomcrypt -ltfm
  562. CONFIG_INTERNAL_SHA256=y
  563. CONFIG_INTERNAL_RC4=y
  564. CONFIG_INTERNAL_DH_GROUP5=y
  565. endif
  566. ifeq ($(CONFIG_CRYPTO), internal)
  567. OBJS += src/crypto/crypto_internal.c
  568. NEED_AES_DEC=y
  569. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  570. ifdef CONFIG_INTERNAL_LIBTOMMATH
  571. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  572. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  573. L_CFLAGS += -DLTM_FAST
  574. endif
  575. else
  576. LIBS += -ltommath
  577. LIBS_h += -ltommath
  578. endif
  579. CONFIG_INTERNAL_AES=y
  580. CONFIG_INTERNAL_DES=y
  581. CONFIG_INTERNAL_SHA1=y
  582. CONFIG_INTERNAL_MD4=y
  583. CONFIG_INTERNAL_MD5=y
  584. CONFIG_INTERNAL_SHA256=y
  585. CONFIG_INTERNAL_SHA384=y
  586. CONFIG_INTERNAL_SHA512=y
  587. CONFIG_INTERNAL_RC4=y
  588. CONFIG_INTERNAL_DH_GROUP5=y
  589. endif
  590. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  591. OBJS += src/crypto/crypto_cryptoapi.c
  592. OBJS_p += src/crypto/crypto_cryptoapi.c
  593. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  594. CONFIG_INTERNAL_SHA256=y
  595. CONFIG_INTERNAL_RC4=y
  596. endif
  597. endif
  598. ifeq ($(CONFIG_TLS), none)
  599. ifdef TLS_FUNCS
  600. OBJS += src/crypto/tls_none.c
  601. L_CFLAGS += -DEAP_TLS_NONE
  602. CONFIG_INTERNAL_AES=y
  603. CONFIG_INTERNAL_SHA1=y
  604. CONFIG_INTERNAL_MD5=y
  605. endif
  606. OBJS += src/crypto/crypto_none.c
  607. OBJS_p += src/crypto/crypto_none.c
  608. CONFIG_INTERNAL_SHA256=y
  609. CONFIG_INTERNAL_RC4=y
  610. endif
  611. ifndef TLS_FUNCS
  612. OBJS += src/crypto/tls_none.c
  613. ifeq ($(CONFIG_TLS), internal)
  614. CONFIG_INTERNAL_AES=y
  615. CONFIG_INTERNAL_SHA1=y
  616. CONFIG_INTERNAL_MD5=y
  617. CONFIG_INTERNAL_RC4=y
  618. endif
  619. endif
  620. AESOBJS = # none so far
  621. ifdef CONFIG_INTERNAL_AES
  622. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
  623. endif
  624. ifneq ($(CONFIG_TLS), openssl)
  625. AESOBJS += src/crypto/aes-wrap.c
  626. endif
  627. ifdef NEED_AES_EAX
  628. AESOBJS += src/crypto/aes-eax.c
  629. NEED_AES_CTR=y
  630. endif
  631. ifdef NEED_AES_CTR
  632. AESOBJS += src/crypto/aes-ctr.c
  633. endif
  634. ifdef NEED_AES_ENCBLOCK
  635. AESOBJS += src/crypto/aes-encblock.c
  636. endif
  637. ifdef NEED_AES_OMAC1
  638. AESOBJS += src/crypto/aes-omac1.c
  639. endif
  640. ifdef NEED_AES_UNWRAP
  641. ifneq ($(CONFIG_TLS), openssl)
  642. NEED_AES_DEC=y
  643. AESOBJS += src/crypto/aes-unwrap.c
  644. endif
  645. endif
  646. ifdef NEED_AES_CBC
  647. NEED_AES_DEC=y
  648. ifneq ($(CONFIG_TLS), openssl)
  649. AESOBJS += src/crypto/aes-cbc.c
  650. endif
  651. endif
  652. ifdef NEED_AES_SIV
  653. AESOBJS += src/crypto/aes-siv.c
  654. endif
  655. ifdef NEED_AES_DEC
  656. ifdef CONFIG_INTERNAL_AES
  657. AESOBJS += src/crypto/aes-internal-dec.c
  658. endif
  659. endif
  660. ifdef NEED_AES
  661. OBJS += $(AESOBJS)
  662. endif
  663. SHA1OBJS =
  664. ifdef NEED_SHA1
  665. ifneq ($(CONFIG_TLS), openssl)
  666. SHA1OBJS += src/crypto/sha1.c
  667. endif
  668. SHA1OBJS += src/crypto/sha1-prf.c
  669. ifdef CONFIG_INTERNAL_SHA1
  670. SHA1OBJS += src/crypto/sha1-internal.c
  671. ifdef NEED_FIPS186_2_PRF
  672. SHA1OBJS += src/crypto/fips_prf_internal.c
  673. endif
  674. endif
  675. ifneq ($(CONFIG_TLS), openssl)
  676. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  677. endif
  678. ifdef NEED_T_PRF
  679. SHA1OBJS += src/crypto/sha1-tprf.c
  680. endif
  681. ifdef NEED_TLS_PRF
  682. SHA1OBJS += src/crypto/sha1-tlsprf.c
  683. endif
  684. endif
  685. ifdef NEED_SHA1
  686. OBJS += $(SHA1OBJS)
  687. endif
  688. ifneq ($(CONFIG_TLS), openssl)
  689. OBJS += src/crypto/md5.c
  690. endif
  691. ifdef NEED_MD5
  692. ifdef CONFIG_INTERNAL_MD5
  693. OBJS += src/crypto/md5-internal.c
  694. HOBJS += src/crypto/md5-internal.c
  695. endif
  696. endif
  697. ifdef NEED_MD4
  698. ifdef CONFIG_INTERNAL_MD4
  699. OBJS += src/crypto/md4-internal.c
  700. endif
  701. endif
  702. ifdef NEED_DES
  703. ifdef CONFIG_INTERNAL_DES
  704. OBJS += src/crypto/des-internal.c
  705. endif
  706. endif
  707. ifdef CONFIG_NO_RC4
  708. L_CFLAGS += -DCONFIG_NO_RC4
  709. endif
  710. ifdef NEED_RC4
  711. ifdef CONFIG_INTERNAL_RC4
  712. ifndef CONFIG_NO_RC4
  713. OBJS += src/crypto/rc4.c
  714. endif
  715. endif
  716. endif
  717. ifdef NEED_SHA256
  718. L_CFLAGS += -DCONFIG_SHA256
  719. ifneq ($(CONFIG_TLS), openssl)
  720. OBJS += src/crypto/sha256.c
  721. endif
  722. OBJS += src/crypto/sha256-prf.c
  723. ifdef CONFIG_INTERNAL_SHA256
  724. OBJS += src/crypto/sha256-internal.c
  725. endif
  726. ifdef NEED_TLS_PRF_SHA256
  727. OBJS += src/crypto/sha256-tlsprf.c
  728. endif
  729. endif
  730. ifdef NEED_SHA384
  731. L_CFLAGS += -DCONFIG_SHA384
  732. ifneq ($(CONFIG_TLS), openssl)
  733. OBJS += src/crypto/sha384.c
  734. endif
  735. OBJS += src/crypto/sha384-prf.c
  736. endif
  737. ifdef CONFIG_INTERNAL_SHA384
  738. L_CFLAGS += -DCONFIG_INTERNAL_SHA384
  739. OBJS += src/crypto/sha384-internal.c
  740. endif
  741. ifdef CONFIG_INTERNAL_SHA512
  742. L_CFLAGS += -DCONFIG_INTERNAL_SHA512
  743. OBJS += src/crypto/sha512-internal.c
  744. endif
  745. ifdef NEED_DH_GROUPS
  746. OBJS += src/crypto/dh_groups.c
  747. endif
  748. ifdef NEED_DH_GROUPS_ALL
  749. L_CFLAGS += -DALL_DH_GROUPS
  750. endif
  751. ifdef CONFIG_INTERNAL_DH_GROUP5
  752. ifdef NEED_DH_GROUPS
  753. OBJS += src/crypto/dh_group5.c
  754. endif
  755. endif
  756. ifdef NEED_ECC
  757. L_CFLAGS += -DCONFIG_ECC
  758. endif
  759. ifdef CONFIG_NO_RANDOM_POOL
  760. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  761. else
  762. OBJS += src/crypto/random.c
  763. HOBJS += src/crypto/random.c
  764. HOBJS += src/utils/eloop.c
  765. HOBJS += $(SHA1OBJS)
  766. ifneq ($(CONFIG_TLS), openssl)
  767. HOBJS += src/crypto/md5.c
  768. endif
  769. endif
  770. ifdef CONFIG_RADIUS_SERVER
  771. L_CFLAGS += -DRADIUS_SERVER
  772. OBJS += src/radius/radius_server.c
  773. endif
  774. ifdef CONFIG_IPV6
  775. L_CFLAGS += -DCONFIG_IPV6
  776. endif
  777. ifdef CONFIG_DRIVER_RADIUS_ACL
  778. L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  779. endif
  780. ifdef NEED_BASE64
  781. OBJS += src/utils/base64.c
  782. endif
  783. ifdef NEED_AP_MLME
  784. OBJS += src/ap/wmm.c
  785. OBJS += src/ap/ap_list.c
  786. OBJS += src/ap/ieee802_11.c
  787. OBJS += src/ap/hw_features.c
  788. OBJS += src/ap/dfs.c
  789. L_CFLAGS += -DNEED_AP_MLME
  790. endif
  791. ifdef CONFIG_IEEE80211N
  792. OBJS += src/ap/ieee802_11_ht.c
  793. endif
  794. ifdef CONFIG_IEEE80211AC
  795. OBJS += src/ap/ieee802_11_vht.c
  796. endif
  797. ifdef CONFIG_P2P_MANAGER
  798. L_CFLAGS += -DCONFIG_P2P_MANAGER
  799. OBJS += src/ap/p2p_hostapd.c
  800. endif
  801. ifdef CONFIG_HS20
  802. L_CFLAGS += -DCONFIG_HS20
  803. OBJS += src/ap/hs20.c
  804. CONFIG_INTERWORKING=y
  805. endif
  806. ifdef CONFIG_INTERWORKING
  807. L_CFLAGS += -DCONFIG_INTERWORKING
  808. OBJS += src/common/gas.c
  809. OBJS += src/ap/gas_serv.c
  810. endif
  811. ifdef CONFIG_PROXYARP
  812. L_CFLAGS += -DCONFIG_PROXYARP
  813. OBJS += src/ap/x_snoop.c
  814. OBJS += src/ap/dhcp_snoop.c
  815. ifdef CONFIG_IPV6
  816. OBJS += src/ap/ndisc_snoop.c
  817. endif
  818. endif
  819. OBJS += src/drivers/driver_common.c
  820. ifdef CONFIG_ACS
  821. L_CFLAGS += -DCONFIG_ACS
  822. OBJS += src/ap/acs.c
  823. LIBS += -lm
  824. endif
  825. ifdef CONFIG_NO_STDOUT_DEBUG
  826. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  827. endif
  828. ifdef CONFIG_DEBUG_SYSLOG
  829. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  830. endif
  831. ifdef CONFIG_DEBUG_LINUX_TRACING
  832. L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  833. endif
  834. ifdef CONFIG_DEBUG_FILE
  835. L_CFLAGS += -DCONFIG_DEBUG_FILE
  836. endif
  837. ifdef CONFIG_ANDROID_LOG
  838. L_CFLAGS += -DCONFIG_ANDROID_LOG
  839. endif
  840. OBJS_c = hostapd_cli.c
  841. OBJS_c += src/common/wpa_ctrl.c
  842. OBJS_c += src/utils/os_$(CONFIG_OS).c
  843. OBJS_c += src/common/cli.c
  844. OBJS_c += src/utils/eloop.c
  845. OBJS_c += src/utils/common.c
  846. ifdef CONFIG_WPA_TRACE
  847. OBJS_c += src/utils/trace.c
  848. endif
  849. OBJS_c += src/utils/wpa_debug.c
  850. ifdef CONFIG_WPA_CLI_EDIT
  851. OBJS_c += src/utils/edit.c
  852. else
  853. OBJS_c += src/utils/edit_simple.c
  854. endif
  855. ########################
  856. include $(CLEAR_VARS)
  857. LOCAL_MODULE := hostapd_cli
  858. LOCAL_MODULE_TAGS := debug
  859. LOCAL_SHARED_LIBRARIES := libc libcutils liblog
  860. LOCAL_CFLAGS := $(L_CFLAGS)
  861. LOCAL_SRC_FILES := $(OBJS_c)
  862. LOCAL_C_INCLUDES := $(INCLUDES)
  863. include $(BUILD_EXECUTABLE)
  864. ########################
  865. include $(CLEAR_VARS)
  866. LOCAL_MODULE := hostapd
  867. LOCAL_MODULE_TAGS := optional
  868. ifdef CONFIG_DRIVER_CUSTOM
  869. LOCAL_STATIC_LIBRARIES := libCustomWifi
  870. endif
  871. ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  872. LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
  873. endif
  874. LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
  875. ifdef CONFIG_DRIVER_NL80211
  876. ifneq ($(wildcard external/libnl),)
  877. LOCAL_SHARED_LIBRARIES += libnl
  878. else
  879. LOCAL_STATIC_LIBRARIES += libnl_2
  880. endif
  881. endif
  882. LOCAL_CFLAGS := $(L_CFLAGS)
  883. LOCAL_SRC_FILES := $(OBJS)
  884. LOCAL_C_INCLUDES := $(INCLUDES)
  885. LOCAL_INIT_RC := hostapd.android.rc
  886. include $(BUILD_EXECUTABLE)
  887. endif # ifeq ($(WPA_BUILD_HOSTAPD),true)