Android.mk 17 KB

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