Android.mk 20 KB

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