Android.mk 20 KB

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