Android.mk 20 KB

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