Android.mk 20 KB

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