Android.mk 17 KB

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