Android.mk 21 KB

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