Android.mk 22 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099
  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 -DCONFIG_WNM_AP
  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. NEED_BASE64=y
  463. endif
  464. ifdef CONFIG_EAP_IKEV2
  465. L_CFLAGS += -DEAP_SERVER_IKEV2
  466. OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
  467. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  468. NEED_DH_GROUPS=y
  469. NEED_DH_GROUPS_ALL=y
  470. NEED_MODEXP=y
  471. NEED_CIPHER=y
  472. endif
  473. ifdef CONFIG_EAP_TNC
  474. L_CFLAGS += -DEAP_SERVER_TNC
  475. OBJS += src/eap_server/eap_server_tnc.c
  476. OBJS += src/eap_server/tncs.c
  477. NEED_BASE64=y
  478. ifndef CONFIG_DRIVER_BSD
  479. LIBS += -ldl
  480. endif
  481. endif
  482. # Basic EAP functionality is needed for EAPOL
  483. OBJS += eap_register.c
  484. OBJS += src/eap_server/eap_server.c
  485. OBJS += src/eap_common/eap_common.c
  486. OBJS += src/eap_server/eap_server_methods.c
  487. OBJS += src/eap_server/eap_server_identity.c
  488. L_CFLAGS += -DEAP_SERVER_IDENTITY
  489. ifdef CONFIG_EAP
  490. L_CFLAGS += -DEAP_SERVER
  491. endif
  492. ifdef CONFIG_PKCS12
  493. L_CFLAGS += -DPKCS12_FUNCS
  494. endif
  495. ifdef MS_FUNCS
  496. OBJS += src/crypto/ms_funcs.c
  497. NEED_DES=y
  498. NEED_MD4=y
  499. endif
  500. ifdef CHAP
  501. OBJS += src/eap_common/chap.c
  502. endif
  503. ifdef TLS_FUNCS
  504. NEED_DES=y
  505. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  506. L_CFLAGS += -DEAP_TLS_FUNCS
  507. OBJS += src/eap_server/eap_server_tls_common.c
  508. NEED_TLS_PRF=y
  509. endif
  510. ifndef CONFIG_TLS
  511. CONFIG_TLS=openssl
  512. endif
  513. ifdef CONFIG_TLSV11
  514. L_CFLAGS += -DCONFIG_TLSV11
  515. endif
  516. ifdef CONFIG_TLSV12
  517. L_CFLAGS += -DCONFIG_TLSV12
  518. NEED_SHA256=y
  519. endif
  520. ifeq ($(CONFIG_TLS), openssl)
  521. ifdef TLS_FUNCS
  522. OBJS += src/crypto/tls_openssl.c
  523. OBJS += src/crypto/tls_openssl_ocsp.c
  524. LIBS += -lssl
  525. endif
  526. OBJS += src/crypto/crypto_openssl.c
  527. HOBJS += src/crypto/crypto_openssl.c
  528. ifdef NEED_FIPS186_2_PRF
  529. OBJS += src/crypto/fips_prf_openssl.c
  530. endif
  531. NEED_SHA256=y
  532. NEED_TLS_PRF_SHA256=y
  533. LIBS += -lcrypto
  534. LIBS_h += -lcrypto
  535. ifndef CONFIG_TLS_DEFAULT_CIPHERS
  536. CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
  537. endif
  538. L_CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
  539. endif
  540. ifeq ($(CONFIG_TLS), gnutls)
  541. ifdef TLS_FUNCS
  542. OBJS += src/crypto/tls_gnutls.c
  543. LIBS += -lgnutls -lgpg-error
  544. endif
  545. OBJS += src/crypto/crypto_gnutls.c
  546. HOBJS += src/crypto/crypto_gnutls.c
  547. ifdef NEED_FIPS186_2_PRF
  548. OBJS += src/crypto/fips_prf_internal.c
  549. OBJS += src/crypto/sha1-internal.c
  550. endif
  551. LIBS += -lgcrypt
  552. LIBS_h += -lgcrypt
  553. CONFIG_INTERNAL_SHA256=y
  554. CONFIG_INTERNAL_RC4=y
  555. CONFIG_INTERNAL_DH_GROUP5=y
  556. endif
  557. ifeq ($(CONFIG_TLS), internal)
  558. ifndef CONFIG_CRYPTO
  559. CONFIG_CRYPTO=internal
  560. endif
  561. ifdef TLS_FUNCS
  562. OBJS += src/crypto/crypto_internal-rsa.c
  563. OBJS += src/crypto/tls_internal.c
  564. OBJS += src/tls/tlsv1_common.c
  565. OBJS += src/tls/tlsv1_record.c
  566. OBJS += src/tls/tlsv1_cred.c
  567. OBJS += src/tls/tlsv1_server.c
  568. OBJS += src/tls/tlsv1_server_write.c
  569. OBJS += src/tls/tlsv1_server_read.c
  570. OBJS += src/tls/asn1.c
  571. OBJS += src/tls/rsa.c
  572. OBJS += src/tls/x509v3.c
  573. OBJS += src/tls/pkcs1.c
  574. OBJS += src/tls/pkcs5.c
  575. OBJS += src/tls/pkcs8.c
  576. NEED_SHA256=y
  577. NEED_BASE64=y
  578. NEED_TLS_PRF=y
  579. ifdef CONFIG_TLSV12
  580. NEED_TLS_PRF_SHA256=y
  581. endif
  582. NEED_MODEXP=y
  583. NEED_CIPHER=y
  584. L_CFLAGS += -DCONFIG_TLS_INTERNAL
  585. L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  586. endif
  587. ifdef NEED_CIPHER
  588. NEED_DES=y
  589. OBJS += src/crypto/crypto_internal-cipher.c
  590. endif
  591. ifdef NEED_MODEXP
  592. OBJS += src/crypto/crypto_internal-modexp.c
  593. OBJS += src/tls/bignum.c
  594. endif
  595. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  596. OBJS += src/crypto/crypto_libtomcrypt.c
  597. LIBS += -ltomcrypt -ltfm
  598. LIBS_h += -ltomcrypt -ltfm
  599. CONFIG_INTERNAL_SHA256=y
  600. CONFIG_INTERNAL_RC4=y
  601. CONFIG_INTERNAL_DH_GROUP5=y
  602. endif
  603. ifeq ($(CONFIG_CRYPTO), internal)
  604. OBJS += src/crypto/crypto_internal.c
  605. NEED_AES_DEC=y
  606. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  607. ifdef CONFIG_INTERNAL_LIBTOMMATH
  608. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  609. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  610. L_CFLAGS += -DLTM_FAST
  611. endif
  612. else
  613. LIBS += -ltommath
  614. LIBS_h += -ltommath
  615. endif
  616. CONFIG_INTERNAL_AES=y
  617. CONFIG_INTERNAL_DES=y
  618. CONFIG_INTERNAL_SHA1=y
  619. CONFIG_INTERNAL_MD4=y
  620. CONFIG_INTERNAL_MD5=y
  621. CONFIG_INTERNAL_SHA256=y
  622. CONFIG_INTERNAL_SHA384=y
  623. CONFIG_INTERNAL_SHA512=y
  624. CONFIG_INTERNAL_RC4=y
  625. CONFIG_INTERNAL_DH_GROUP5=y
  626. endif
  627. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  628. OBJS += src/crypto/crypto_cryptoapi.c
  629. OBJS_p += src/crypto/crypto_cryptoapi.c
  630. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  631. CONFIG_INTERNAL_SHA256=y
  632. CONFIG_INTERNAL_RC4=y
  633. endif
  634. endif
  635. ifeq ($(CONFIG_TLS), none)
  636. ifdef TLS_FUNCS
  637. OBJS += src/crypto/tls_none.c
  638. L_CFLAGS += -DEAP_TLS_NONE
  639. CONFIG_INTERNAL_AES=y
  640. CONFIG_INTERNAL_SHA1=y
  641. CONFIG_INTERNAL_MD5=y
  642. endif
  643. OBJS += src/crypto/crypto_none.c
  644. OBJS_p += src/crypto/crypto_none.c
  645. CONFIG_INTERNAL_SHA256=y
  646. CONFIG_INTERNAL_RC4=y
  647. endif
  648. ifndef TLS_FUNCS
  649. OBJS += src/crypto/tls_none.c
  650. ifeq ($(CONFIG_TLS), internal)
  651. CONFIG_INTERNAL_AES=y
  652. CONFIG_INTERNAL_SHA1=y
  653. CONFIG_INTERNAL_MD5=y
  654. CONFIG_INTERNAL_RC4=y
  655. endif
  656. endif
  657. AESOBJS = # none so far
  658. ifdef CONFIG_INTERNAL_AES
  659. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
  660. endif
  661. ifneq ($(CONFIG_TLS), openssl)
  662. AESOBJS += src/crypto/aes-wrap.c
  663. endif
  664. ifdef NEED_AES_EAX
  665. AESOBJS += src/crypto/aes-eax.c
  666. NEED_AES_CTR=y
  667. NEED_AES_OMAC1=y
  668. endif
  669. ifdef NEED_AES_SIV
  670. AESOBJS += src/crypto/aes-siv.c
  671. NEED_AES_CTR=y
  672. NEED_AES_OMAC1=y
  673. endif
  674. ifdef NEED_AES_CTR
  675. AESOBJS += src/crypto/aes-ctr.c
  676. endif
  677. ifdef NEED_AES_ENCBLOCK
  678. AESOBJS += src/crypto/aes-encblock.c
  679. endif
  680. ifdef NEED_AES_OMAC1
  681. AESOBJS += src/crypto/aes-omac1.c
  682. endif
  683. ifdef NEED_AES_UNWRAP
  684. ifneq ($(CONFIG_TLS), openssl)
  685. NEED_AES_DEC=y
  686. AESOBJS += src/crypto/aes-unwrap.c
  687. endif
  688. endif
  689. ifdef NEED_AES_CBC
  690. NEED_AES_DEC=y
  691. ifneq ($(CONFIG_TLS), openssl)
  692. AESOBJS += src/crypto/aes-cbc.c
  693. endif
  694. endif
  695. ifdef NEED_AES_DEC
  696. ifdef CONFIG_INTERNAL_AES
  697. AESOBJS += src/crypto/aes-internal-dec.c
  698. endif
  699. endif
  700. ifdef NEED_AES
  701. OBJS += $(AESOBJS)
  702. endif
  703. SHA1OBJS =
  704. ifdef NEED_SHA1
  705. ifneq ($(CONFIG_TLS), openssl)
  706. SHA1OBJS += src/crypto/sha1.c
  707. endif
  708. SHA1OBJS += src/crypto/sha1-prf.c
  709. ifdef CONFIG_INTERNAL_SHA1
  710. SHA1OBJS += src/crypto/sha1-internal.c
  711. ifdef NEED_FIPS186_2_PRF
  712. SHA1OBJS += src/crypto/fips_prf_internal.c
  713. endif
  714. endif
  715. ifneq ($(CONFIG_TLS), openssl)
  716. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  717. endif
  718. ifdef NEED_T_PRF
  719. SHA1OBJS += src/crypto/sha1-tprf.c
  720. endif
  721. ifdef NEED_TLS_PRF
  722. SHA1OBJS += src/crypto/sha1-tlsprf.c
  723. endif
  724. endif
  725. ifdef NEED_SHA1
  726. OBJS += $(SHA1OBJS)
  727. endif
  728. ifneq ($(CONFIG_TLS), openssl)
  729. OBJS += src/crypto/md5.c
  730. endif
  731. ifdef NEED_MD5
  732. ifdef CONFIG_INTERNAL_MD5
  733. OBJS += src/crypto/md5-internal.c
  734. HOBJS += src/crypto/md5-internal.c
  735. endif
  736. endif
  737. ifdef NEED_MD4
  738. ifdef CONFIG_INTERNAL_MD4
  739. OBJS += src/crypto/md4-internal.c
  740. endif
  741. endif
  742. ifdef NEED_DES
  743. ifdef CONFIG_INTERNAL_DES
  744. OBJS += src/crypto/des-internal.c
  745. endif
  746. endif
  747. ifdef CONFIG_NO_RC4
  748. L_CFLAGS += -DCONFIG_NO_RC4
  749. endif
  750. ifdef NEED_RC4
  751. ifdef CONFIG_INTERNAL_RC4
  752. ifndef CONFIG_NO_RC4
  753. OBJS += src/crypto/rc4.c
  754. endif
  755. endif
  756. endif
  757. ifdef NEED_SHA256
  758. L_CFLAGS += -DCONFIG_SHA256
  759. ifneq ($(CONFIG_TLS), openssl)
  760. OBJS += src/crypto/sha256.c
  761. endif
  762. OBJS += src/crypto/sha256-prf.c
  763. ifdef CONFIG_INTERNAL_SHA256
  764. OBJS += src/crypto/sha256-internal.c
  765. endif
  766. ifdef NEED_TLS_PRF_SHA256
  767. OBJS += src/crypto/sha256-tlsprf.c
  768. endif
  769. ifdef NEED_HMAC_SHA256_KDF
  770. OBJS += src/crypto/sha256-kdf.c
  771. endif
  772. ifdef NEED_HMAC_SHA384_KDF
  773. OBJS += src/crypto/sha384-kdf.c
  774. endif
  775. ifdef NEED_HMAC_SHA512_KDF
  776. OBJS += src/crypto/sha512-kdf.c
  777. endif
  778. endif
  779. ifdef NEED_SHA384
  780. L_CFLAGS += -DCONFIG_SHA384
  781. ifneq ($(CONFIG_TLS), openssl)
  782. OBJS += src/crypto/sha384.c
  783. endif
  784. OBJS += src/crypto/sha384-prf.c
  785. endif
  786. ifdef NEED_SHA512
  787. L_CFLAGS += -DCONFIG_SHA512
  788. ifneq ($(CONFIG_TLS), openssl)
  789. ifneq ($(CONFIG_TLS), linux)
  790. OBJS += src/crypto/sha512.c
  791. endif
  792. endif
  793. OBJS += src/crypto/sha512-prf.c
  794. endif
  795. ifdef CONFIG_INTERNAL_SHA384
  796. L_CFLAGS += -DCONFIG_INTERNAL_SHA384
  797. OBJS += src/crypto/sha384-internal.c
  798. endif
  799. ifdef CONFIG_INTERNAL_SHA512
  800. L_CFLAGS += -DCONFIG_INTERNAL_SHA512
  801. OBJS += src/crypto/sha512-internal.c
  802. endif
  803. ifdef NEED_DH_GROUPS
  804. OBJS += src/crypto/dh_groups.c
  805. endif
  806. ifdef NEED_DH_GROUPS_ALL
  807. L_CFLAGS += -DALL_DH_GROUPS
  808. endif
  809. ifdef CONFIG_INTERNAL_DH_GROUP5
  810. ifdef NEED_DH_GROUPS
  811. OBJS += src/crypto/dh_group5.c
  812. endif
  813. endif
  814. ifdef NEED_ECC
  815. L_CFLAGS += -DCONFIG_ECC
  816. endif
  817. ifdef CONFIG_NO_RANDOM_POOL
  818. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  819. else
  820. OBJS += src/crypto/random.c
  821. HOBJS += src/crypto/random.c
  822. HOBJS += src/utils/eloop.c
  823. HOBJS += $(SHA1OBJS)
  824. ifneq ($(CONFIG_TLS), openssl)
  825. HOBJS += src/crypto/md5.c
  826. endif
  827. endif
  828. ifdef CONFIG_RADIUS_SERVER
  829. L_CFLAGS += -DRADIUS_SERVER
  830. OBJS += src/radius/radius_server.c
  831. endif
  832. ifdef CONFIG_IPV6
  833. L_CFLAGS += -DCONFIG_IPV6
  834. endif
  835. ifdef CONFIG_DRIVER_RADIUS_ACL
  836. L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  837. endif
  838. ifdef NEED_BASE64
  839. OBJS += src/utils/base64.c
  840. endif
  841. ifdef NEED_JSON
  842. OBJS += src/utils/json.c
  843. L_CFLAGS += -DCONFIG_JSON
  844. endif
  845. ifdef NEED_AP_MLME
  846. OBJS += src/ap/wmm.c
  847. OBJS += src/ap/ap_list.c
  848. OBJS += src/ap/ieee802_11.c
  849. OBJS += src/ap/hw_features.c
  850. OBJS += src/ap/dfs.c
  851. L_CFLAGS += -DNEED_AP_MLME
  852. endif
  853. ifdef CONFIG_IEEE80211N
  854. OBJS += src/ap/ieee802_11_ht.c
  855. endif
  856. ifdef CONFIG_IEEE80211AC
  857. OBJS += src/ap/ieee802_11_vht.c
  858. endif
  859. ifdef CONFIG_IEEE80211AX
  860. OBJS += src/ap/ieee802_11_he.c
  861. endif
  862. ifdef CONFIG_P2P_MANAGER
  863. L_CFLAGS += -DCONFIG_P2P_MANAGER
  864. OBJS += src/ap/p2p_hostapd.c
  865. endif
  866. ifdef CONFIG_HS20
  867. L_CFLAGS += -DCONFIG_HS20
  868. OBJS += src/ap/hs20.c
  869. CONFIG_INTERWORKING=y
  870. endif
  871. ifdef CONFIG_INTERWORKING
  872. L_CFLAGS += -DCONFIG_INTERWORKING
  873. NEED_GAS=y
  874. endif
  875. ifdef NEED_GAS
  876. OBJS += src/common/gas.c
  877. OBJS += src/ap/gas_serv.c
  878. endif
  879. ifdef CONFIG_PROXYARP
  880. L_CFLAGS += -DCONFIG_PROXYARP
  881. OBJS += src/ap/x_snoop.c
  882. OBJS += src/ap/dhcp_snoop.c
  883. ifdef CONFIG_IPV6
  884. OBJS += src/ap/ndisc_snoop.c
  885. endif
  886. endif
  887. OBJS += src/drivers/driver_common.c
  888. ifdef CONFIG_ACS
  889. L_CFLAGS += -DCONFIG_ACS
  890. OBJS += src/ap/acs.c
  891. LIBS += -lm
  892. endif
  893. ifdef CONFIG_NO_STDOUT_DEBUG
  894. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  895. endif
  896. ifdef CONFIG_DEBUG_SYSLOG
  897. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  898. endif
  899. ifdef CONFIG_DEBUG_LINUX_TRACING
  900. L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  901. endif
  902. ifdef CONFIG_DEBUG_FILE
  903. L_CFLAGS += -DCONFIG_DEBUG_FILE
  904. endif
  905. ifdef CONFIG_ANDROID_LOG
  906. L_CFLAGS += -DCONFIG_ANDROID_LOG
  907. endif
  908. OBJS_c = hostapd_cli.c
  909. OBJS_c += src/common/wpa_ctrl.c
  910. OBJS_c += src/utils/os_$(CONFIG_OS).c
  911. OBJS_c += src/common/cli.c
  912. OBJS_c += src/utils/eloop.c
  913. OBJS_c += src/utils/common.c
  914. ifdef CONFIG_WPA_TRACE
  915. OBJS_c += src/utils/trace.c
  916. endif
  917. OBJS_c += src/utils/wpa_debug.c
  918. ifdef CONFIG_WPA_CLI_EDIT
  919. OBJS_c += src/utils/edit.c
  920. else
  921. OBJS_c += src/utils/edit_simple.c
  922. endif
  923. ########################
  924. include $(CLEAR_VARS)
  925. LOCAL_MODULE := hostapd_cli
  926. LOCAL_MODULE_TAGS := debug
  927. LOCAL_SHARED_LIBRARIES := libc libcutils liblog
  928. LOCAL_CFLAGS := $(L_CFLAGS)
  929. LOCAL_SRC_FILES := $(OBJS_c)
  930. LOCAL_C_INCLUDES := $(INCLUDES)
  931. include $(BUILD_EXECUTABLE)
  932. ########################
  933. include $(CLEAR_VARS)
  934. LOCAL_MODULE := hostapd
  935. LOCAL_MODULE_TAGS := optional
  936. ifdef CONFIG_DRIVER_CUSTOM
  937. LOCAL_STATIC_LIBRARIES := libCustomWifi
  938. endif
  939. ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  940. LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
  941. endif
  942. LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
  943. ifdef CONFIG_DRIVER_NL80211
  944. ifneq ($(wildcard external/libnl),)
  945. LOCAL_SHARED_LIBRARIES += libnl
  946. else
  947. LOCAL_STATIC_LIBRARIES += libnl_2
  948. endif
  949. endif
  950. LOCAL_CFLAGS := $(L_CFLAGS)
  951. LOCAL_SRC_FILES := $(OBJS)
  952. LOCAL_C_INCLUDES := $(INCLUDES)
  953. LOCAL_INIT_RC := hostapd.android.rc
  954. include $(BUILD_EXECUTABLE)
  955. endif # ifeq ($(WPA_BUILD_HOSTAPD),true)