Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Android.mk 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. LOCAL_PATH := $(call my-dir)
  2. WPA_BUILD_HOSTAPD := false
  3. ifneq ($(TARGET_SIMULATOR),true)
  4. ifneq ($(BOARD_HOSTAPD_DRIVER),)
  5. WPA_BUILD_HOSTAPD := true
  6. #CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y
  7. CONFIG_DRIVER_RTW := y
  8. endif
  9. endif
  10. include $(LOCAL_PATH)/.config
  11. # To ignore possible wrong network configurations
  12. L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
  13. # To force sizeof(enum) = 4
  14. ifeq ($(TARGET_ARCH),arm)
  15. L_CFLAGS += -mabi=aapcs-linux
  16. endif
  17. # To allow non-ASCII characters in SSID
  18. L_CFLAGS += -DWPA_UNICODE_SSID
  19. # OpenSSL is configured without engines on Android
  20. L_CFLAGS += -DOPENSSL_NO_ENGINE
  21. INCLUDES = $(LOCAL_PATH)
  22. INCLUDES += $(LOCAL_PATH)/src
  23. INCLUDES += $(LOCAL_PATH)/src/utils
  24. INCLUDES += external/openssl/include
  25. INCLUDES += frameworks/base/cmds/keystore
  26. ifdef CONFIG_DRIVER_NL80211
  27. INCLUDES += external/libnl_2/include
  28. endif
  29. ifndef CONFIG_OS
  30. ifdef CONFIG_NATIVE_WINDOWS
  31. CONFIG_OS=win32
  32. else
  33. CONFIG_OS=unix
  34. endif
  35. endif
  36. ifeq ($(CONFIG_OS), internal)
  37. L_CFLAGS += -DOS_NO_C_LIB_DEFINES
  38. endif
  39. ifdef CONFIG_NATIVE_WINDOWS
  40. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  41. LIBS += -lws2_32
  42. endif
  43. OBJS = main.c
  44. OBJS += config_file.c
  45. OBJS += src/ap/hostapd.c
  46. OBJS += src/ap/wpa_auth_glue.c
  47. OBJS += src/ap/drv_callbacks.c
  48. OBJS += src/ap/ap_drv_ops.c
  49. OBJS += src/ap/utils.c
  50. OBJS += src/ap/authsrv.c
  51. OBJS += src/ap/ieee802_1x.c
  52. OBJS += src/ap/ap_config.c
  53. OBJS += src/ap/ieee802_11_auth.c
  54. OBJS += src/ap/sta_info.c
  55. OBJS += src/ap/wpa_auth.c
  56. OBJS += src/ap/tkip_countermeasures.c
  57. OBJS += src/ap/ap_mlme.c
  58. OBJS += src/ap/wpa_auth_ie.c
  59. OBJS += src/ap/preauth_auth.c
  60. OBJS += src/ap/pmksa_cache_auth.c
  61. OBJS_d =
  62. OBJS_p =
  63. LIBS =
  64. LIBS_c =
  65. HOBJS =
  66. LIBS_h =
  67. NEED_RC4=y
  68. NEED_AES=y
  69. NEED_MD5=y
  70. NEED_SHA1=y
  71. OBJS += src/drivers/drivers.c
  72. L_CFLAGS += -DHOSTAPD
  73. ifdef CONFIG_WPA_TRACE
  74. L_CFLAGS += -DWPA_TRACE
  75. OBJS += src/utils/trace.c
  76. HOBJS += src/utils/trace.c
  77. LDFLAGS += -rdynamic
  78. L_CFLAGS += -funwind-tables
  79. ifdef CONFIG_WPA_TRACE_BFD
  80. L_CFLAGS += -DWPA_TRACE_BFD
  81. LIBS += -lbfd
  82. LIBS_c += -lbfd
  83. LIBS_h += -lbfd
  84. endif
  85. endif
  86. OBJS += src/utils/eloop.c
  87. OBJS += src/utils/common.c
  88. OBJS += src/utils/wpa_debug.c
  89. OBJS += src/utils/wpabuf.c
  90. OBJS += src/utils/os_$(CONFIG_OS).c
  91. OBJS += src/utils/ip_addr.c
  92. OBJS += src/common/ieee802_11_common.c
  93. OBJS += src/common/wpa_common.c
  94. OBJS += src/eapol_auth/eapol_auth_sm.c
  95. ifndef CONFIG_NO_DUMP_STATE
  96. # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
  97. # a file (undefine it, if you want to save in binary size)
  98. L_CFLAGS += -DHOSTAPD_DUMP_STATE
  99. OBJS += dump_state.c
  100. OBJS += src/eapol_auth/eapol_auth_dump.c
  101. endif
  102. ifdef CONFIG_NO_RADIUS
  103. L_CFLAGS += -DCONFIG_NO_RADIUS
  104. CONFIG_NO_ACCOUNTING=y
  105. else
  106. OBJS += src/radius/radius.c
  107. OBJS += src/radius/radius_client.c
  108. endif
  109. ifdef CONFIG_NO_ACCOUNTING
  110. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  111. else
  112. OBJS += src/ap/accounting.c
  113. endif
  114. ifdef CONFIG_NO_VLAN
  115. L_CFLAGS += -DCONFIG_NO_VLAN
  116. else
  117. OBJS += src/ap/vlan_init.c
  118. endif
  119. ifdef CONFIG_NO_CTRL_IFACE
  120. L_CFLAGS += -DCONFIG_NO_CTRL_IFACE
  121. else
  122. OBJS += ctrl_iface.c
  123. OBJS += src/ap/ctrl_iface_ap.c
  124. endif
  125. OBJS += src/crypto/md5.c
  126. L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
  127. ifdef CONFIG_IAPP
  128. L_CFLAGS += -DCONFIG_IAPP
  129. OBJS += src/ap/iapp.c
  130. endif
  131. ifdef CONFIG_RSN_PREAUTH
  132. L_CFLAGS += -DCONFIG_RSN_PREAUTH
  133. CONFIG_L2_PACKET=y
  134. endif
  135. ifdef CONFIG_PEERKEY
  136. L_CFLAGS += -DCONFIG_PEERKEY
  137. OBJS += src/ap/peerkey_auth.c
  138. endif
  139. ifdef CONFIG_IEEE80211W
  140. L_CFLAGS += -DCONFIG_IEEE80211W
  141. NEED_SHA256=y
  142. NEED_AES_OMAC1=y
  143. endif
  144. ifdef CONFIG_IEEE80211R
  145. L_CFLAGS += -DCONFIG_IEEE80211R
  146. OBJS += src/ap/wpa_auth_ft.c
  147. NEED_SHA256=y
  148. NEED_AES_OMAC1=y
  149. NEED_AES_UNWRAP=y
  150. endif
  151. ifdef CONFIG_IEEE80211N
  152. L_CFLAGS += -DCONFIG_IEEE80211N
  153. endif
  154. include $(LOCAL_PATH)/src/drivers/drivers.mk
  155. OBJS += $(DRV_AP_OBJS)
  156. L_CFLAGS += $(DRV_AP_CFLAGS)
  157. LDFLAGS += $(DRV_AP_LDFLAGS)
  158. LIBS += $(DRV_AP_LIBS)
  159. ifdef CONFIG_L2_PACKET
  160. ifdef CONFIG_DNET_PCAP
  161. ifdef CONFIG_L2_FREEBSD
  162. LIBS += -lpcap
  163. OBJS += src/l2_packet/l2_packet_freebsd.c
  164. else
  165. LIBS += -ldnet -lpcap
  166. OBJS += src/l2_packet/l2_packet_pcap.c
  167. endif
  168. else
  169. OBJS += src/l2_packet/l2_packet_linux.c
  170. endif
  171. else
  172. OBJS += src/l2_packet/l2_packet_none.c
  173. endif
  174. ifdef CONFIG_EAP_MD5
  175. L_CFLAGS += -DEAP_SERVER_MD5
  176. OBJS += src/eap_server/eap_server_md5.c
  177. CHAP=y
  178. endif
  179. ifdef CONFIG_EAP_TLS
  180. L_CFLAGS += -DEAP_SERVER_TLS
  181. OBJS += src/eap_server/eap_server_tls.c
  182. TLS_FUNCS=y
  183. endif
  184. ifdef CONFIG_EAP_PEAP
  185. L_CFLAGS += -DEAP_SERVER_PEAP
  186. OBJS += src/eap_server/eap_server_peap.c
  187. OBJS += src/eap_common/eap_peap_common.c
  188. TLS_FUNCS=y
  189. CONFIG_EAP_MSCHAPV2=y
  190. endif
  191. ifdef CONFIG_EAP_TTLS
  192. L_CFLAGS += -DEAP_SERVER_TTLS
  193. OBJS += src/eap_server/eap_server_ttls.c
  194. TLS_FUNCS=y
  195. CHAP=y
  196. endif
  197. ifdef CONFIG_EAP_MSCHAPV2
  198. L_CFLAGS += -DEAP_SERVER_MSCHAPV2
  199. OBJS += src/eap_server/eap_server_mschapv2.c
  200. MS_FUNCS=y
  201. endif
  202. ifdef CONFIG_EAP_GTC
  203. L_CFLAGS += -DEAP_SERVER_GTC
  204. OBJS += src/eap_server/eap_server_gtc.c
  205. endif
  206. ifdef CONFIG_EAP_SIM
  207. L_CFLAGS += -DEAP_SERVER_SIM
  208. OBJS += src/eap_server/eap_server_sim.c
  209. CONFIG_EAP_SIM_COMMON=y
  210. NEED_AES_CBC=y
  211. endif
  212. ifdef CONFIG_EAP_AKA
  213. L_CFLAGS += -DEAP_SERVER_AKA
  214. OBJS += src/eap_server/eap_server_aka.c
  215. CONFIG_EAP_SIM_COMMON=y
  216. NEED_SHA256=y
  217. NEED_AES_CBC=y
  218. endif
  219. ifdef CONFIG_EAP_AKA_PRIME
  220. L_CFLAGS += -DEAP_SERVER_AKA_PRIME
  221. endif
  222. ifdef CONFIG_EAP_SIM_COMMON
  223. OBJS += src/eap_common/eap_sim_common.c
  224. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  225. # replaced with another file implementating the interface specified in
  226. # eap_sim_db.h.
  227. OBJS += src/eap_server/eap_sim_db.c
  228. NEED_FIPS186_2_PRF=y
  229. endif
  230. ifdef CONFIG_EAP_PAX
  231. L_CFLAGS += -DEAP_SERVER_PAX
  232. OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
  233. endif
  234. ifdef CONFIG_EAP_PSK
  235. L_CFLAGS += -DEAP_SERVER_PSK
  236. OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
  237. NEED_AES_OMAC1=y
  238. NEED_AES_ENCBLOCK=y
  239. NEED_AES_EAX=y
  240. endif
  241. ifdef CONFIG_EAP_SAKE
  242. L_CFLAGS += -DEAP_SERVER_SAKE
  243. OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
  244. endif
  245. ifdef CONFIG_EAP_GPSK
  246. L_CFLAGS += -DEAP_SERVER_GPSK
  247. OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
  248. ifdef CONFIG_EAP_GPSK_SHA256
  249. L_CFLAGS += -DEAP_SERVER_GPSK_SHA256
  250. endif
  251. NEED_SHA256=y
  252. NEED_AES_OMAC1=y
  253. endif
  254. ifdef CONFIG_EAP_PWD
  255. L_CFLAGS += -DEAP_SERVER_PWD
  256. OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
  257. NEED_SHA256=y
  258. endif
  259. ifdef CONFIG_EAP_VENDOR_TEST
  260. L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
  261. OBJS += src/eap_server/eap_server_vendor_test.c
  262. endif
  263. ifdef CONFIG_EAP_FAST
  264. L_CFLAGS += -DEAP_SERVER_FAST
  265. OBJS += src/eap_server/eap_server_fast.c
  266. OBJS += src/eap_common/eap_fast_common.c
  267. TLS_FUNCS=y
  268. NEED_T_PRF=y
  269. NEED_AES_UNWRAP=y
  270. endif
  271. ifdef CONFIG_WPS
  272. ifdef CONFIG_WPS2
  273. L_CFLAGS += -DCONFIG_WPS2
  274. endif
  275. L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  276. OBJS += src/utils/uuid.c
  277. OBJS += src/ap/wps_hostapd.c
  278. OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
  279. OBJS += src/wps/wps.c
  280. OBJS += src/wps/wps_common.c
  281. OBJS += src/wps/wps_attr_parse.c
  282. OBJS += src/wps/wps_attr_build.c
  283. OBJS += src/wps/wps_attr_process.c
  284. OBJS += src/wps/wps_dev_attr.c
  285. OBJS += src/wps/wps_enrollee.c
  286. OBJS += src/wps/wps_registrar.c
  287. NEED_DH_GROUPS=y
  288. NEED_SHA256=y
  289. NEED_BASE64=y
  290. NEED_AES_CBC=y
  291. NEED_MODEXP=y
  292. CONFIG_EAP=y
  293. ifdef CONFIG_WPS_UFD
  294. L_CFLAGS += -DCONFIG_WPS_UFD
  295. OBJS += src/wps/wps_ufd.c
  296. NEED_WPS_OOB=y
  297. endif
  298. ifdef CONFIG_WPS_NFC
  299. L_CFLAGS += -DCONFIG_WPS_NFC
  300. OBJS += src/wps/ndef.c
  301. OBJS += src/wps/wps_nfc.c
  302. NEED_WPS_OOB=y
  303. ifdef CONFIG_WPS_NFC_PN531
  304. PN531_PATH ?= /usr/local/src/nfc
  305. L_CFLAGS += -DCONFIG_WPS_NFC_PN531
  306. L_CFLAGS += -I${PN531_PATH}/inc
  307. OBJS += src/wps/wps_nfc_pn531.c
  308. LIBS += ${PN531_PATH}/lib/wpsnfc.dll
  309. LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
  310. endif
  311. endif
  312. ifdef NEED_WPS_OOB
  313. L_CFLAGS += -DCONFIG_WPS_OOB
  314. endif
  315. ifdef CONFIG_WPS_UPNP
  316. L_CFLAGS += -DCONFIG_WPS_UPNP
  317. OBJS += src/wps/wps_upnp.c
  318. OBJS += src/wps/wps_upnp_ssdp.c
  319. OBJS += src/wps/wps_upnp_web.c
  320. OBJS += src/wps/wps_upnp_event.c
  321. OBJS += src/wps/wps_upnp_ap.c
  322. OBJS += src/wps/upnp_xml.c
  323. OBJS += src/wps/httpread.c
  324. OBJS += src/wps/http_client.c
  325. OBJS += src/wps/http_server.c
  326. endif
  327. ifdef CONFIG_WPS_STRICT
  328. L_CFLAGS += -DCONFIG_WPS_STRICT
  329. OBJS += src/wps/wps_validate.c
  330. endif
  331. ifdef CONFIG_WPS_TESTING
  332. L_CFLAGS += -DCONFIG_WPS_TESTING
  333. endif
  334. endif
  335. ifdef CONFIG_EAP_IKEV2
  336. L_CFLAGS += -DEAP_SERVER_IKEV2
  337. OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
  338. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  339. NEED_DH_GROUPS=y
  340. NEED_DH_GROUPS_ALL=y
  341. NEED_MODEXP=y
  342. NEED_CIPHER=y
  343. endif
  344. ifdef CONFIG_EAP_TNC
  345. L_CFLAGS += -DEAP_SERVER_TNC
  346. OBJS += src/eap_server/eap_server_tnc.c
  347. OBJS += src/eap_server/tncs.c
  348. NEED_BASE64=y
  349. ifndef CONFIG_DRIVER_BSD
  350. LIBS += -ldl
  351. endif
  352. endif
  353. # Basic EAP functionality is needed for EAPOL
  354. OBJS += eap_register.c
  355. OBJS += src/eap_server/eap_server.c
  356. OBJS += src/eap_common/eap_common.c
  357. OBJS += src/eap_server/eap_server_methods.c
  358. OBJS += src/eap_server/eap_server_identity.c
  359. L_CFLAGS += -DEAP_SERVER_IDENTITY
  360. ifdef CONFIG_EAP
  361. L_CFLAGS += -DEAP_SERVER
  362. endif
  363. ifdef CONFIG_PKCS12
  364. L_CFLAGS += -DPKCS12_FUNCS
  365. endif
  366. ifdef MS_FUNCS
  367. OBJS += src/crypto/ms_funcs.c
  368. NEED_DES=y
  369. NEED_MD4=y
  370. endif
  371. ifdef CHAP
  372. OBJS += src/eap_common/chap.c
  373. endif
  374. ifdef TLS_FUNCS
  375. NEED_DES=y
  376. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  377. L_CFLAGS += -DEAP_TLS_FUNCS
  378. OBJS += src/eap_server/eap_server_tls_common.c
  379. NEED_TLS_PRF=y
  380. endif
  381. ifndef CONFIG_TLS
  382. CONFIG_TLS=openssl
  383. endif
  384. ifeq ($(CONFIG_TLS), openssl)
  385. ifdef TLS_FUNCS
  386. OBJS += src/crypto/tls_openssl.c
  387. LIBS += -lssl
  388. endif
  389. OBJS += src/crypto/crypto_openssl.c
  390. HOBJS += src/crypto/crypto_openssl.c
  391. ifdef NEED_FIPS186_2_PRF
  392. OBJS += src/crypto/fips_prf_openssl.c
  393. endif
  394. LIBS += -lcrypto
  395. LIBS_h += -lcrypto
  396. endif
  397. ifeq ($(CONFIG_TLS), gnutls)
  398. ifdef TLS_FUNCS
  399. OBJS += src/crypto/tls_gnutls.c
  400. LIBS += -lgnutls -lgpg-error
  401. ifdef CONFIG_GNUTLS_EXTRA
  402. L_CFLAGS += -DCONFIG_GNUTLS_EXTRA
  403. LIBS += -lgnutls-extra
  404. endif
  405. endif
  406. OBJS += src/crypto/crypto_gnutls.c
  407. HOBJS += src/crypto/crypto_gnutls.c
  408. ifdef NEED_FIPS186_2_PRF
  409. OBJS += src/crypto/fips_prf_gnutls.c
  410. endif
  411. LIBS += -lgcrypt
  412. LIBS_h += -lgcrypt
  413. CONFIG_INTERNAL_SHA256=y
  414. CONFIG_INTERNAL_RC4=y
  415. CONFIG_INTERNAL_DH_GROUP5=y
  416. endif
  417. ifeq ($(CONFIG_TLS), schannel)
  418. ifdef TLS_FUNCS
  419. OBJS += src/crypto/tls_schannel.c
  420. endif
  421. OBJS += src/crypto/crypto_cryptoapi.c
  422. OBJS_p += src/crypto/crypto_cryptoapi.c
  423. CONFIG_INTERNAL_SHA256=y
  424. CONFIG_INTERNAL_RC4=y
  425. CONFIG_INTERNAL_DH_GROUP5=y
  426. endif
  427. ifeq ($(CONFIG_TLS), nss)
  428. ifdef TLS_FUNCS
  429. OBJS += src/crypto/tls_nss.c
  430. LIBS += -lssl3
  431. endif
  432. OBJS += src/crypto/crypto_nss.c
  433. ifdef NEED_FIPS186_2_PRF
  434. OBJS += src/crypto/fips_prf_nss.c
  435. endif
  436. LIBS += -lnss3
  437. LIBS_h += -lnss3
  438. CONFIG_INTERNAL_MD4=y
  439. CONFIG_INTERNAL_DH_GROUP5=y
  440. endif
  441. ifeq ($(CONFIG_TLS), internal)
  442. ifndef CONFIG_CRYPTO
  443. CONFIG_CRYPTO=internal
  444. endif
  445. ifdef TLS_FUNCS
  446. OBJS += src/crypto/crypto_internal-rsa.c
  447. OBJS += src/crypto/tls_internal.c
  448. OBJS += src/tls/tlsv1_common.c
  449. OBJS += src/tls/tlsv1_record.c
  450. OBJS += src/tls/tlsv1_cred.c
  451. OBJS += src/tls/tlsv1_server.c
  452. OBJS += src/tls/tlsv1_server_write.c
  453. OBJS += src/tls/tlsv1_server_read.c
  454. OBJS += src/tls/asn1.c
  455. OBJS += src/tls/rsa.c
  456. OBJS += src/tls/x509v3.c
  457. OBJS += src/tls/pkcs1.c
  458. OBJS += src/tls/pkcs5.c
  459. OBJS += src/tls/pkcs8.c
  460. NEED_SHA256=y
  461. NEED_BASE64=y
  462. NEED_TLS_PRF=y
  463. NEED_MODEXP=y
  464. NEED_CIPHER=y
  465. L_CFLAGS += -DCONFIG_TLS_INTERNAL
  466. L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  467. endif
  468. ifdef NEED_CIPHER
  469. NEED_DES=y
  470. OBJS += src/crypto/crypto_internal-cipher.c
  471. endif
  472. ifdef NEED_MODEXP
  473. OBJS += src/crypto/crypto_internal-modexp.c
  474. OBJS += src/tls/bignum.c
  475. endif
  476. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  477. OBJS += src/crypto/crypto_libtomcrypt.c
  478. LIBS += -ltomcrypt -ltfm
  479. LIBS_h += -ltomcrypt -ltfm
  480. CONFIG_INTERNAL_SHA256=y
  481. CONFIG_INTERNAL_RC4=y
  482. CONFIG_INTERNAL_DH_GROUP5=y
  483. endif
  484. ifeq ($(CONFIG_CRYPTO), internal)
  485. OBJS += src/crypto/crypto_internal.c
  486. NEED_AES_DEC=y
  487. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  488. ifdef CONFIG_INTERNAL_LIBTOMMATH
  489. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  490. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  491. L_CFLAGS += -DLTM_FAST
  492. endif
  493. else
  494. LIBS += -ltommath
  495. LIBS_h += -ltommath
  496. endif
  497. CONFIG_INTERNAL_AES=y
  498. CONFIG_INTERNAL_DES=y
  499. CONFIG_INTERNAL_SHA1=y
  500. CONFIG_INTERNAL_MD4=y
  501. CONFIG_INTERNAL_MD5=y
  502. CONFIG_INTERNAL_SHA256=y
  503. CONFIG_INTERNAL_RC4=y
  504. CONFIG_INTERNAL_DH_GROUP5=y
  505. endif
  506. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  507. OBJS += src/crypto/crypto_cryptoapi.c
  508. OBJS_p += src/crypto/crypto_cryptoapi.c
  509. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  510. CONFIG_INTERNAL_SHA256=y
  511. CONFIG_INTERNAL_RC4=y
  512. endif
  513. endif
  514. ifeq ($(CONFIG_TLS), none)
  515. ifdef TLS_FUNCS
  516. OBJS += src/crypto/tls_none.c
  517. L_CFLAGS += -DEAP_TLS_NONE
  518. CONFIG_INTERNAL_AES=y
  519. CONFIG_INTERNAL_SHA1=y
  520. CONFIG_INTERNAL_MD5=y
  521. endif
  522. OBJS += src/crypto/crypto_none.c
  523. OBJS_p += src/crypto/crypto_none.c
  524. CONFIG_INTERNAL_SHA256=y
  525. CONFIG_INTERNAL_RC4=y
  526. endif
  527. ifndef TLS_FUNCS
  528. OBJS += src/crypto/tls_none.c
  529. ifeq ($(CONFIG_TLS), internal)
  530. CONFIG_INTERNAL_AES=y
  531. CONFIG_INTERNAL_SHA1=y
  532. CONFIG_INTERNAL_MD5=y
  533. CONFIG_INTERNAL_RC4=y
  534. endif
  535. endif
  536. AESOBJS = # none so far
  537. ifdef CONFIG_INTERNAL_AES
  538. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
  539. endif
  540. AESOBJS += src/crypto/aes-wrap.c
  541. ifdef NEED_AES_EAX
  542. AESOBJS += src/crypto/aes-eax.c
  543. NEED_AES_CTR=y
  544. endif
  545. ifdef NEED_AES_CTR
  546. AESOBJS += src/crypto/aes-ctr.c
  547. endif
  548. ifdef NEED_AES_ENCBLOCK
  549. AESOBJS += src/crypto/aes-encblock.c
  550. endif
  551. ifdef NEED_AES_OMAC1
  552. AESOBJS += src/crypto/aes-omac1.c
  553. endif
  554. ifdef NEED_AES_UNWRAP
  555. NEED_AES_DEC=y
  556. AESOBJS += src/crypto/aes-unwrap.c
  557. endif
  558. ifdef NEED_AES_CBC
  559. NEED_AES_DEC=y
  560. AESOBJS += src/crypto/aes-cbc.c
  561. endif
  562. ifdef NEED_AES_DEC
  563. ifdef CONFIG_INTERNAL_AES
  564. AESOBJS += src/crypto/aes-internal-dec.c
  565. endif
  566. endif
  567. ifdef NEED_AES
  568. OBJS += $(AESOBJS)
  569. endif
  570. SHA1OBJS =
  571. ifdef NEED_SHA1
  572. SHA1OBJS += src/crypto/sha1.c
  573. ifdef CONFIG_INTERNAL_SHA1
  574. SHA1OBJS += src/crypto/sha1-internal.c
  575. ifdef NEED_FIPS186_2_PRF
  576. SHA1OBJS += src/crypto/fips_prf_internal.c
  577. endif
  578. endif
  579. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  580. ifdef NEED_T_PRF
  581. SHA1OBJS += src/crypto/sha1-tprf.c
  582. endif
  583. ifdef NEED_TLS_PRF
  584. SHA1OBJS += src/crypto/sha1-tlsprf.c
  585. endif
  586. endif
  587. ifdef NEED_SHA1
  588. OBJS += $(SHA1OBJS)
  589. endif
  590. ifdef NEED_MD5
  591. ifdef CONFIG_INTERNAL_MD5
  592. OBJS += src/crypto/md5-internal.c
  593. HOBJS += src/crypto/md5-internal.c
  594. endif
  595. endif
  596. ifdef NEED_MD4
  597. ifdef CONFIG_INTERNAL_MD4
  598. OBJS += src/crypto/md4-internal.c
  599. endif
  600. endif
  601. ifdef NEED_DES
  602. ifdef CONFIG_INTERNAL_DES
  603. OBJS += src/crypto/des-internal.c
  604. endif
  605. endif
  606. ifdef NEED_RC4
  607. ifdef CONFIG_INTERNAL_RC4
  608. OBJS += src/crypto/rc4.c
  609. endif
  610. endif
  611. ifdef NEED_SHA256
  612. OBJS += src/crypto/sha256.c
  613. ifdef CONFIG_INTERNAL_SHA256
  614. OBJS += src/crypto/sha256-internal.c
  615. endif
  616. endif
  617. ifdef NEED_DH_GROUPS
  618. OBJS += src/crypto/dh_groups.c
  619. endif
  620. ifdef NEED_DH_GROUPS_ALL
  621. L_CFLAGS += -DALL_DH_GROUPS
  622. endif
  623. ifdef CONFIG_INTERNAL_DH_GROUP5
  624. ifdef NEED_DH_GROUPS
  625. OBJS += src/crypto/dh_group5.c
  626. endif
  627. endif
  628. ifdef CONFIG_NO_RANDOM_POOL
  629. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  630. else
  631. OBJS += src/crypto/random.c
  632. HOBJS += src/crypto/random.c
  633. HOBJS += $(SHA1OBJS)
  634. HOBJS += src/crypto/md5.c
  635. endif
  636. ifdef CONFIG_RADIUS_SERVER
  637. L_CFLAGS += -DRADIUS_SERVER
  638. OBJS += src/radius/radius_server.c
  639. endif
  640. ifdef CONFIG_IPV6
  641. L_CFLAGS += -DCONFIG_IPV6
  642. endif
  643. ifdef CONFIG_DRIVER_RADIUS_ACL
  644. L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  645. endif
  646. ifdef CONFIG_FULL_DYNAMIC_VLAN
  647. # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
  648. # and vlan interfaces for the vlan feature.
  649. L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
  650. endif
  651. ifdef NEED_BASE64
  652. OBJS += src/utils/base64.c
  653. endif
  654. ifdef NEED_AP_MLME
  655. OBJS += src/ap/beacon.c
  656. OBJS += src/ap/wmm.c
  657. OBJS += src/ap/ap_list.c
  658. OBJS += src/ap/ieee802_11.c
  659. OBJS += src/ap/hw_features.c
  660. L_CFLAGS += -DNEED_AP_MLME
  661. endif
  662. ifdef CONFIG_IEEE80211N
  663. OBJS += src/ap/ieee802_11_ht.c
  664. endif
  665. ifdef CONFIG_P2P_MANAGER
  666. L_CFLAGS += -DCONFIG_P2P_MANAGER
  667. OBJS += src/ap/p2p_hostapd.c
  668. endif
  669. ifdef CONFIG_NO_STDOUT_DEBUG
  670. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  671. endif
  672. ifdef CONFIG_DEBUG_FILE
  673. L_CFLAGS += -DCONFIG_DEBUG_FILE
  674. endif
  675. ifdef CONFIG_ANDROID_LOG
  676. L_CFLAGS += -DCONFIG_ANDROID_LOG
  677. endif
  678. OBJS_c = hostapd_cli.c src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
  679. ifdef CONFIG_WPA_TRACE
  680. OBJS_c += src/utils/trace.c
  681. OBJS_c += src/utils/wpa_debug.c
  682. endif
  683. ifeq ($(WPA_BUILD_HOSTAPD),true)
  684. ########################
  685. include $(CLEAR_VARS)
  686. LOCAL_MODULE := hostapd_cli
  687. LOCAL_MODULE_TAGS := debug
  688. LOCAL_SHARED_LIBRARIES := libc libcutils
  689. LOCAL_CFLAGS := $(L_CFLAGS)
  690. LOCAL_SRC_FILES := $(OBJS_c)
  691. LOCAL_C_INCLUDES := $(INCLUDES)
  692. include $(BUILD_EXECUTABLE)
  693. ########################
  694. include $(CLEAR_VARS)
  695. LOCAL_MODULE := hostapd
  696. LOCAL_MODULE_TAGS := optional
  697. ifdef CONFIG_DRIVER_CUSTOM
  698. LOCAL_STATIC_LIBRARIES := libCustomWifi
  699. endif
  700. ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  701. LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
  702. endif
  703. LOCAL_SHARED_LIBRARIES := libc libcutils libcrypto libssl
  704. ifdef CONFIG_DRIVER_NL80211
  705. LOCAL_STATIC_LIBRARIES += libnl_2
  706. endif
  707. LOCAL_CFLAGS := $(L_CFLAGS)
  708. LOCAL_SRC_FILES := $(OBJS)
  709. LOCAL_C_INCLUDES := $(INCLUDES)
  710. include $(BUILD_EXECUTABLE)
  711. endif # ifeq ($(WPA_BUILD_HOSTAPD),true)