Android.mk 20 KB

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