Android.mk 18 KB

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