Android.mk 21 KB

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