Android.mk 19 KB

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