Android.mk 20 KB

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