Android.mk 17 KB

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