Android.mk 18 KB

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