Android.mk 19 KB

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