Android.mk 21 KB

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