Android.mk 19 KB

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