Android.mk 19 KB

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