Android.mk 19 KB

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