Android.mk 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486
  1. #
  2. # Copyright (C) 2008 The Android Open Source Project
  3. #
  4. # This software may be distributed under the terms of the BSD license.
  5. # See README for more details.
  6. #
  7. LOCAL_PATH := $(call my-dir)
  8. PKG_CONFIG ?= pkg-config
  9. WPA_BUILD_SUPPLICANT := false
  10. ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),)
  11. WPA_BUILD_SUPPLICANT := true
  12. CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) := y
  13. endif
  14. ifeq ($(WPA_BUILD_SUPPLICANT),true)
  15. include $(LOCAL_PATH)/android.config
  16. # To ignore possible wrong network configurations
  17. L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
  18. L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
  19. # Set Android log name
  20. L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
  21. # Disable roaming in wpa_supplicant
  22. ifdef CONFIG_NO_ROAMING
  23. L_CFLAGS += -DCONFIG_NO_ROAMING
  24. endif
  25. # Use Android specific directory for control interface sockets
  26. L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
  27. L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/wpa_supplicant\"
  28. # To force sizeof(enum) = 4
  29. ifeq ($(TARGET_ARCH),arm)
  30. L_CFLAGS += -mabi=aapcs-linux
  31. endif
  32. # To allow non-ASCII characters in SSID
  33. L_CFLAGS += -DWPA_UNICODE_SSID
  34. # OpenSSL is configured without engines on Android
  35. L_CFLAGS += -DOPENSSL_NO_ENGINE
  36. INCLUDES = $(LOCAL_PATH)
  37. INCLUDES += $(LOCAL_PATH)/src
  38. INCLUDES += $(LOCAL_PATH)/src/common
  39. # INCLUDES += $(LOCAL_PATH)/src/crypto # To force proper includes
  40. INCLUDES += $(LOCAL_PATH)/src/drivers
  41. INCLUDES += $(LOCAL_PATH)/src/eap_common
  42. INCLUDES += $(LOCAL_PATH)/src/eapol_supp
  43. INCLUDES += $(LOCAL_PATH)/src/eap_peer
  44. INCLUDES += $(LOCAL_PATH)/src/eap_server
  45. INCLUDES += $(LOCAL_PATH)/src/hlr_auc_gw
  46. INCLUDES += $(LOCAL_PATH)/src/l2_packet
  47. INCLUDES += $(LOCAL_PATH)/src/radius
  48. INCLUDES += $(LOCAL_PATH)/src/rsn_supp
  49. INCLUDES += $(LOCAL_PATH)/src/tls
  50. INCLUDES += $(LOCAL_PATH)/src/utils
  51. INCLUDES += $(LOCAL_PATH)/src/wps
  52. INCLUDES += external/openssl/include
  53. INCLUDES += frameworks/base/cmds/keystore
  54. ifdef CONFIG_DRIVER_NL80211
  55. INCLUDES += external/libnl-headers
  56. endif
  57. OBJS = config.c
  58. OBJS += notify.c
  59. OBJS += bss.c
  60. OBJS += eap_register.c
  61. OBJS += src/utils/common.c
  62. OBJS += src/utils/wpa_debug.c
  63. OBJS += src/utils/wpabuf.c
  64. OBJS_p = wpa_passphrase.c
  65. OBJS_p += src/utils/common.c
  66. OBJS_p += src/utils/wpa_debug.c
  67. OBJS_p += src/utils/wpabuf.c
  68. OBJS_c = wpa_cli.c src/common/wpa_ctrl.c
  69. OBJS_c += src/utils/wpa_debug.c
  70. OBJS_c += src/utils/common.c
  71. OBJS_d =
  72. OBJS_priv =
  73. ifndef CONFIG_OS
  74. ifdef CONFIG_NATIVE_WINDOWS
  75. CONFIG_OS=win32
  76. else
  77. CONFIG_OS=unix
  78. endif
  79. endif
  80. ifeq ($(CONFIG_OS), internal)
  81. L_CFLAGS += -DOS_NO_C_LIB_DEFINES
  82. endif
  83. OBJS += src/utils/os_$(CONFIG_OS).c
  84. OBJS_p += src/utils/os_$(CONFIG_OS).c
  85. OBJS_c += src/utils/os_$(CONFIG_OS).c
  86. ifdef CONFIG_WPA_TRACE
  87. L_CFLAGS += -DWPA_TRACE
  88. OBJS += src/utils/trace.c
  89. OBJS_p += src/utils/trace.c
  90. OBJS_c += src/utils/trace.c
  91. LDFLAGS += -rdynamic
  92. L_CFLAGS += -funwind-tables
  93. ifdef CONFIG_WPA_TRACE_BFD
  94. L_CFLAGS += -DWPA_TRACE_BFD
  95. LIBS += -lbfd
  96. LIBS_p += -lbfd
  97. LIBS_c += -lbfd
  98. endif
  99. endif
  100. ifndef CONFIG_ELOOP
  101. CONFIG_ELOOP=eloop
  102. endif
  103. OBJS += src/utils/$(CONFIG_ELOOP).c
  104. OBJS_c += src/utils/$(CONFIG_ELOOP).c
  105. ifdef CONFIG_EAPOL_TEST
  106. L_CFLAGS += -Werror -DEAPOL_TEST
  107. endif
  108. ifndef CONFIG_BACKEND
  109. CONFIG_BACKEND=file
  110. endif
  111. ifeq ($(CONFIG_BACKEND), file)
  112. OBJS += config_file.c
  113. ifndef CONFIG_NO_CONFIG_BLOBS
  114. NEED_BASE64=y
  115. endif
  116. L_CFLAGS += -DCONFIG_BACKEND_FILE
  117. endif
  118. ifeq ($(CONFIG_BACKEND), winreg)
  119. OBJS += config_winreg.c
  120. endif
  121. ifeq ($(CONFIG_BACKEND), none)
  122. OBJS += config_none.c
  123. endif
  124. ifdef CONFIG_NO_CONFIG_WRITE
  125. L_CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  126. endif
  127. ifdef CONFIG_NO_CONFIG_BLOBS
  128. L_CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  129. endif
  130. ifdef CONFIG_NO_SCAN_PROCESSING
  131. L_CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  132. endif
  133. ifdef CONFIG_IEEE80211W
  134. L_CFLAGS += -DCONFIG_IEEE80211W
  135. NEED_SHA256=y
  136. NEED_AES_OMAC1=y
  137. endif
  138. ifdef CONFIG_IEEE80211R
  139. L_CFLAGS += -DCONFIG_IEEE80211R
  140. OBJS += src/rsn_supp/wpa_ft.c
  141. NEED_80211_COMMON=y
  142. NEED_SHA256=y
  143. NEED_AES_OMAC1=y
  144. endif
  145. ifdef CONFIG_TDLS
  146. L_CFLAGS += -DCONFIG_TDLS
  147. OBJS += src/rsn_supp/tdls.c
  148. NEED_SHA256=y
  149. NEED_AES_OMAC1=y
  150. endif
  151. ifdef CONFIG_TDLS_TESTING
  152. L_CFLAGS += -DCONFIG_TDLS_TESTING
  153. endif
  154. ifdef CONFIG_PEERKEY
  155. L_CFLAGS += -DCONFIG_PEERKEY
  156. endif
  157. ifndef CONFIG_NO_WPA
  158. OBJS += src/rsn_supp/wpa.c
  159. OBJS += src/rsn_supp/preauth.c
  160. OBJS += src/rsn_supp/pmksa_cache.c
  161. OBJS += src/rsn_supp/peerkey.c
  162. OBJS += src/rsn_supp/wpa_ie.c
  163. OBJS += src/common/wpa_common.c
  164. NEED_AES=y
  165. NEED_SHA1=y
  166. NEED_MD5=y
  167. NEED_RC4=y
  168. else
  169. L_CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
  170. endif
  171. ifdef CONFIG_IBSS_RSN
  172. NEED_RSN_AUTHENTICATOR=y
  173. L_CFLAGS += -DCONFIG_IBSS_RSN
  174. OBJS += ibss_rsn.c
  175. endif
  176. ifdef CONFIG_P2P
  177. OBJS += p2p_supplicant.c
  178. OBJS += src/p2p/p2p.c
  179. OBJS += src/p2p/p2p_utils.c
  180. OBJS += src/p2p/p2p_parse.c
  181. OBJS += src/p2p/p2p_build.c
  182. OBJS += src/p2p/p2p_go_neg.c
  183. OBJS += src/p2p/p2p_sd.c
  184. OBJS += src/p2p/p2p_pd.c
  185. OBJS += src/p2p/p2p_invitation.c
  186. OBJS += src/p2p/p2p_dev_disc.c
  187. OBJS += src/p2p/p2p_group.c
  188. OBJS += src/ap/p2p_hostapd.c
  189. L_CFLAGS += -DCONFIG_P2P
  190. NEED_GAS=y
  191. NEED_OFFCHANNEL=y
  192. NEED_80211_COMMON=y
  193. CONFIG_WPS=y
  194. CONFIG_AP=y
  195. ifdef CONFIG_P2P_STRICT
  196. L_CFLAGS += -DCONFIG_P2P_STRICT
  197. endif
  198. endif
  199. ifdef CONFIG_INTERWORKING
  200. OBJS += interworking.c
  201. L_CFLAGS += -DCONFIG_INTERWORKING
  202. NEED_GAS=y
  203. endif
  204. ifdef CONFIG_NO_WPA2
  205. L_CFLAGS += -DCONFIG_NO_WPA2
  206. endif
  207. include $(LOCAL_PATH)/src/drivers/drivers.mk
  208. ifdef CONFIG_AP
  209. OBJS_d += $(DRV_BOTH_OBJS)
  210. L_CFLAGS += $(DRV_BOTH_CFLAGS)
  211. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  212. LIBS += $(DRV_BOTH_LIBS)
  213. else
  214. NEED_AP_MLME=
  215. OBJS_d += $(DRV_WPA_OBJS)
  216. L_CFLAGS += $(DRV_WPA_CFLAGS)
  217. LDFLAGS += $(DRV_WPA_LDFLAGS)
  218. LIBS += $(DRV_WPA_LIBS)
  219. endif
  220. ifndef CONFIG_L2_PACKET
  221. CONFIG_L2_PACKET=linux
  222. endif
  223. OBJS_l2 += src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).c
  224. ifeq ($(CONFIG_L2_PACKET), pcap)
  225. ifdef CONFIG_WINPCAP
  226. L_CFLAGS += -DCONFIG_WINPCAP
  227. LIBS += -lwpcap -lpacket
  228. LIBS_w += -lwpcap
  229. else
  230. LIBS += -ldnet -lpcap
  231. endif
  232. endif
  233. ifeq ($(CONFIG_L2_PACKET), winpcap)
  234. LIBS += -lwpcap -lpacket
  235. LIBS_w += -lwpcap
  236. endif
  237. ifeq ($(CONFIG_L2_PACKET), freebsd)
  238. LIBS += -lpcap
  239. endif
  240. ifdef CONFIG_EAP_TLS
  241. # EAP-TLS
  242. ifeq ($(CONFIG_EAP_TLS), dyn)
  243. L_CFLAGS += -DEAP_TLS_DYNAMIC
  244. EAPDYN += src/eap_peer/eap_tls.so
  245. else
  246. L_CFLAGS += -DEAP_TLS
  247. OBJS += src/eap_peer/eap_tls.c
  248. OBJS_h += src/eap_server/eap_server_tls.c
  249. endif
  250. TLS_FUNCS=y
  251. CONFIG_IEEE8021X_EAPOL=y
  252. endif
  253. ifdef CONFIG_EAP_PEAP
  254. # EAP-PEAP
  255. ifeq ($(CONFIG_EAP_PEAP), dyn)
  256. L_CFLAGS += -DEAP_PEAP_DYNAMIC
  257. EAPDYN += src/eap_peer/eap_peap.so
  258. else
  259. L_CFLAGS += -DEAP_PEAP
  260. OBJS += src/eap_peer/eap_peap.c
  261. OBJS += src/eap_common/eap_peap_common.c
  262. OBJS_h += src/eap_server/eap_server_peap.c
  263. endif
  264. TLS_FUNCS=y
  265. CONFIG_IEEE8021X_EAPOL=y
  266. endif
  267. ifdef CONFIG_EAP_TTLS
  268. # EAP-TTLS
  269. ifeq ($(CONFIG_EAP_TTLS), dyn)
  270. L_CFLAGS += -DEAP_TTLS_DYNAMIC
  271. EAPDYN += src/eap_peer/eap_ttls.so
  272. else
  273. L_CFLAGS += -DEAP_TTLS
  274. OBJS += src/eap_peer/eap_ttls.c
  275. OBJS_h += src/eap_server/eap_server_ttls.c
  276. endif
  277. MS_FUNCS=y
  278. TLS_FUNCS=y
  279. CHAP=y
  280. CONFIG_IEEE8021X_EAPOL=y
  281. endif
  282. ifdef CONFIG_EAP_MD5
  283. # EAP-MD5
  284. ifeq ($(CONFIG_EAP_MD5), dyn)
  285. L_CFLAGS += -DEAP_MD5_DYNAMIC
  286. EAPDYN += src/eap_peer/eap_md5.so
  287. else
  288. L_CFLAGS += -DEAP_MD5
  289. OBJS += src/eap_peer/eap_md5.c
  290. OBJS_h += src/eap_server/eap_server_md5.c
  291. endif
  292. CHAP=y
  293. CONFIG_IEEE8021X_EAPOL=y
  294. endif
  295. # backwards compatibility for old spelling
  296. ifdef CONFIG_MSCHAPV2
  297. ifndef CONFIG_EAP_MSCHAPV2
  298. CONFIG_EAP_MSCHAPV2=y
  299. endif
  300. endif
  301. ifdef CONFIG_EAP_MSCHAPV2
  302. # EAP-MSCHAPv2
  303. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  304. L_CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  305. EAPDYN += src/eap_peer/eap_mschapv2.so
  306. EAPDYN += src/eap_peer/mschapv2.so
  307. else
  308. L_CFLAGS += -DEAP_MSCHAPv2
  309. OBJS += src/eap_peer/eap_mschapv2.c
  310. OBJS += src/eap_peer/mschapv2.c
  311. OBJS_h += src/eap_server/eap_server_mschapv2.c
  312. endif
  313. MS_FUNCS=y
  314. CONFIG_IEEE8021X_EAPOL=y
  315. endif
  316. ifdef CONFIG_EAP_GTC
  317. # EAP-GTC
  318. ifeq ($(CONFIG_EAP_GTC), dyn)
  319. L_CFLAGS += -DEAP_GTC_DYNAMIC
  320. EAPDYN += src/eap_peer/eap_gtc.so
  321. else
  322. L_CFLAGS += -DEAP_GTC
  323. OBJS += src/eap_peer/eap_gtc.c
  324. OBJS_h += src/eap_server/eap_server_gtc.c
  325. endif
  326. CONFIG_IEEE8021X_EAPOL=y
  327. endif
  328. ifdef CONFIG_EAP_OTP
  329. # EAP-OTP
  330. ifeq ($(CONFIG_EAP_OTP), dyn)
  331. L_CFLAGS += -DEAP_OTP_DYNAMIC
  332. EAPDYN += src/eap_peer/eap_otp.so
  333. else
  334. L_CFLAGS += -DEAP_OTP
  335. OBJS += src/eap_peer/eap_otp.c
  336. endif
  337. CONFIG_IEEE8021X_EAPOL=y
  338. endif
  339. ifdef CONFIG_EAP_SIM
  340. # EAP-SIM
  341. ifeq ($(CONFIG_EAP_SIM), dyn)
  342. L_CFLAGS += -DEAP_SIM_DYNAMIC
  343. EAPDYN += src/eap_peer/eap_sim.so
  344. else
  345. L_CFLAGS += -DEAP_SIM
  346. OBJS += src/eap_peer/eap_sim.c
  347. OBJS_h += src/eap_server/eap_server_sim.c
  348. endif
  349. CONFIG_IEEE8021X_EAPOL=y
  350. CONFIG_EAP_SIM_COMMON=y
  351. NEED_AES_CBC=y
  352. endif
  353. ifdef CONFIG_EAP_LEAP
  354. # EAP-LEAP
  355. ifeq ($(CONFIG_EAP_LEAP), dyn)
  356. L_CFLAGS += -DEAP_LEAP_DYNAMIC
  357. EAPDYN += src/eap_peer/eap_leap.so
  358. else
  359. L_CFLAGS += -DEAP_LEAP
  360. OBJS += src/eap_peer/eap_leap.c
  361. endif
  362. MS_FUNCS=y
  363. CONFIG_IEEE8021X_EAPOL=y
  364. endif
  365. ifdef CONFIG_EAP_PSK
  366. # EAP-PSK
  367. ifeq ($(CONFIG_EAP_PSK), dyn)
  368. L_CFLAGS += -DEAP_PSK_DYNAMIC
  369. EAPDYN += src/eap_peer/eap_psk.so
  370. else
  371. L_CFLAGS += -DEAP_PSK
  372. OBJS += src/eap_peer/eap_psk.c src/eap_common/eap_psk_common.c
  373. OBJS_h += src/eap_server/eap_server_psk.c
  374. endif
  375. CONFIG_IEEE8021X_EAPOL=y
  376. NEED_AES=y
  377. NEED_AES_OMAC1=y
  378. NEED_AES_ENCBLOCK=y
  379. NEED_AES_EAX=y
  380. endif
  381. ifdef CONFIG_EAP_AKA
  382. # EAP-AKA
  383. ifeq ($(CONFIG_EAP_AKA), dyn)
  384. L_CFLAGS += -DEAP_AKA_DYNAMIC
  385. EAPDYN += src/eap_peer/eap_aka.so
  386. else
  387. L_CFLAGS += -DEAP_AKA
  388. OBJS += src/eap_peer/eap_aka.c
  389. OBJS_h += src/eap_server/eap_server_aka.c
  390. endif
  391. CONFIG_IEEE8021X_EAPOL=y
  392. CONFIG_EAP_SIM_COMMON=y
  393. NEED_AES_CBC=y
  394. endif
  395. ifdef CONFIG_EAP_AKA_PRIME
  396. # EAP-AKA'
  397. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  398. L_CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  399. else
  400. L_CFLAGS += -DEAP_AKA_PRIME
  401. endif
  402. NEED_SHA256=y
  403. endif
  404. ifdef CONFIG_EAP_SIM_COMMON
  405. OBJS += src/eap_common/eap_sim_common.c
  406. OBJS_h += src/eap_server/eap_sim_db.c
  407. NEED_AES=y
  408. NEED_FIPS186_2_PRF=y
  409. endif
  410. ifdef CONFIG_EAP_FAST
  411. # EAP-FAST
  412. ifeq ($(CONFIG_EAP_FAST), dyn)
  413. L_CFLAGS += -DEAP_FAST_DYNAMIC
  414. EAPDYN += src/eap_peer/eap_fast.so
  415. EAPDYN += src/eap_common/eap_fast_common.c
  416. else
  417. L_CFLAGS += -DEAP_FAST
  418. OBJS += src/eap_peer/eap_fast.c src/eap_peer/eap_fast_pac.c
  419. OBJS += src/eap_common/eap_fast_common.c
  420. OBJS_h += src/eap_server/eap_server_fast.c
  421. endif
  422. TLS_FUNCS=y
  423. CONFIG_IEEE8021X_EAPOL=y
  424. NEED_T_PRF=y
  425. endif
  426. ifdef CONFIG_EAP_PAX
  427. # EAP-PAX
  428. ifeq ($(CONFIG_EAP_PAX), dyn)
  429. L_CFLAGS += -DEAP_PAX_DYNAMIC
  430. EAPDYN += src/eap_peer/eap_pax.so
  431. else
  432. L_CFLAGS += -DEAP_PAX
  433. OBJS += src/eap_peer/eap_pax.c src/eap_common/eap_pax_common.c
  434. OBJS_h += src/eap_server/eap_server_pax.c
  435. endif
  436. CONFIG_IEEE8021X_EAPOL=y
  437. endif
  438. ifdef CONFIG_EAP_SAKE
  439. # EAP-SAKE
  440. ifeq ($(CONFIG_EAP_SAKE), dyn)
  441. L_CFLAGS += -DEAP_SAKE_DYNAMIC
  442. EAPDYN += src/eap_peer/eap_sake.so
  443. else
  444. L_CFLAGS += -DEAP_SAKE
  445. OBJS += src/eap_peer/eap_sake.c src/eap_common/eap_sake_common.c
  446. OBJS_h += src/eap_server/eap_server_sake.c
  447. endif
  448. CONFIG_IEEE8021X_EAPOL=y
  449. endif
  450. ifdef CONFIG_EAP_GPSK
  451. # EAP-GPSK
  452. ifeq ($(CONFIG_EAP_GPSK), dyn)
  453. L_CFLAGS += -DEAP_GPSK_DYNAMIC
  454. EAPDYN += src/eap_peer/eap_gpsk.so
  455. else
  456. L_CFLAGS += -DEAP_GPSK
  457. OBJS += src/eap_peer/eap_gpsk.c src/eap_common/eap_gpsk_common.c
  458. OBJS_h += src/eap_server/eap_server_gpsk.c
  459. endif
  460. CONFIG_IEEE8021X_EAPOL=y
  461. ifdef CONFIG_EAP_GPSK_SHA256
  462. L_CFLAGS += -DEAP_GPSK_SHA256
  463. endif
  464. NEED_SHA256=y
  465. NEED_AES_OMAC1=y
  466. endif
  467. ifdef CONFIG_EAP_PWD
  468. L_CFLAGS += -DEAP_PWD
  469. OBJS += src/eap_peer/eap_pwd.c src/eap_common/eap_pwd_common.c
  470. OBJS_h += src/eap_server/eap_pwd.c
  471. CONFIG_IEEE8021X_EAPOL=y
  472. NEED_SHA256=y
  473. endif
  474. ifdef CONFIG_WPS
  475. ifdef CONFIG_WPS2
  476. L_CFLAGS += -DCONFIG_WPS2
  477. endif
  478. # EAP-WSC
  479. L_CFLAGS += -DCONFIG_WPS -DEAP_WSC
  480. OBJS += wps_supplicant.c
  481. OBJS += src/utils/uuid.c
  482. OBJS += src/eap_peer/eap_wsc.c src/eap_common/eap_wsc_common.c
  483. OBJS += src/wps/wps.c
  484. OBJS += src/wps/wps_common.c
  485. OBJS += src/wps/wps_attr_parse.c
  486. OBJS += src/wps/wps_attr_build.c
  487. OBJS += src/wps/wps_attr_process.c
  488. OBJS += src/wps/wps_dev_attr.c
  489. OBJS += src/wps/wps_enrollee.c
  490. OBJS += src/wps/wps_registrar.c
  491. OBJS_h += src/eap_server/eap_server_wsc.c
  492. CONFIG_IEEE8021X_EAPOL=y
  493. NEED_DH_GROUPS=y
  494. NEED_SHA256=y
  495. NEED_BASE64=y
  496. NEED_80211_COMMON=y
  497. NEED_AES_CBC=y
  498. NEED_MODEXP=y
  499. ifdef CONFIG_WPS_UFD
  500. L_CFLAGS += -DCONFIG_WPS_UFD
  501. OBJS += src/wps/wps_ufd.c
  502. NEED_WPS_OOB=y
  503. endif
  504. ifdef CONFIG_WPS_NFC
  505. L_CFLAGS += -DCONFIG_WPS_NFC
  506. OBJS += src/wps/ndef.c
  507. OBJS += src/wps/wps_nfc.c
  508. NEED_WPS_OOB=y
  509. ifdef CONFIG_WPS_NFC_PN531
  510. PN531_PATH ?= /usr/local/src/nfc
  511. L_CFLAGS += -DCONFIG_WPS_NFC_PN531
  512. L_CFLAGS += -I${PN531_PATH}/inc
  513. OBJS += src/wps/wps_nfc_pn531.c
  514. LIBS += ${PN531_PATH}/lib/wpsnfc.dll
  515. LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
  516. endif
  517. endif
  518. ifdef NEED_WPS_OOB
  519. L_CFLAGS += -DCONFIG_WPS_OOB
  520. endif
  521. ifdef CONFIG_WPS_ER
  522. CONFIG_WPS_UPNP=y
  523. L_CFLAGS += -DCONFIG_WPS_ER
  524. OBJS += src/wps/wps_er.c
  525. OBJS += src/wps/wps_er_ssdp.c
  526. endif
  527. ifdef CONFIG_WPS_UPNP
  528. L_CFLAGS += -DCONFIG_WPS_UPNP
  529. OBJS += src/wps/wps_upnp.c
  530. OBJS += src/wps/wps_upnp_ssdp.c
  531. OBJS += src/wps/wps_upnp_web.c
  532. OBJS += src/wps/wps_upnp_event.c
  533. OBJS += src/wps/wps_upnp_ap.c
  534. OBJS += src/wps/upnp_xml.c
  535. OBJS += src/wps/httpread.c
  536. OBJS += src/wps/http_client.c
  537. OBJS += src/wps/http_server.c
  538. endif
  539. ifdef CONFIG_WPS_STRICT
  540. L_CFLAGS += -DCONFIG_WPS_STRICT
  541. OBJS += src/wps/wps_validate.c
  542. endif
  543. ifdef CONFIG_WPS_TESTING
  544. L_CFLAGS += -DCONFIG_WPS_TESTING
  545. endif
  546. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  547. L_CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  548. endif
  549. endif
  550. ifdef CONFIG_EAP_IKEV2
  551. # EAP-IKEv2
  552. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  553. L_CFLAGS += -DEAP_IKEV2_DYNAMIC
  554. EAPDYN += src/eap_peer/eap_ikev2.so src/eap_peer/ikev2.c
  555. EAPDYN += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  556. else
  557. L_CFLAGS += -DEAP_IKEV2
  558. OBJS += src/eap_peer/eap_ikev2.c src/eap_peer/ikev2.c
  559. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  560. OBJS_h += src/eap_server/eap_server_ikev2.c
  561. OBJS_h += src/eap_server/ikev2.c
  562. endif
  563. CONFIG_IEEE8021X_EAPOL=y
  564. NEED_DH_GROUPS=y
  565. NEED_DH_GROUPS_ALL=y
  566. NEED_MODEXP=y
  567. NEED_CIPHER=y
  568. endif
  569. ifdef CONFIG_EAP_VENDOR_TEST
  570. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  571. L_CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  572. EAPDYN += src/eap_peer/eap_vendor_test.so
  573. else
  574. L_CFLAGS += -DEAP_VENDOR_TEST
  575. OBJS += src/eap_peer/eap_vendor_test.c
  576. OBJS_h += src/eap_server/eap_server_vendor_test.c
  577. endif
  578. CONFIG_IEEE8021X_EAPOL=y
  579. endif
  580. ifdef CONFIG_EAP_TNC
  581. # EAP-TNC
  582. L_CFLAGS += -DEAP_TNC
  583. OBJS += src/eap_peer/eap_tnc.c
  584. OBJS += src/eap_peer/tncc.c
  585. OBJS_h += src/eap_server/eap_server_tnc.c
  586. OBJS_h += src/eap_server/tncs.c
  587. NEED_BASE64=y
  588. ifndef CONFIG_NATIVE_WINDOWS
  589. ifndef CONFIG_DRIVER_BSD
  590. LIBS += -ldl
  591. endif
  592. endif
  593. endif
  594. ifdef CONFIG_IEEE8021X_EAPOL
  595. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  596. L_CFLAGS += -DIEEE8021X_EAPOL
  597. OBJS += src/eapol_supp/eapol_supp_sm.c
  598. OBJS += src/eap_peer/eap.c src/eap_peer/eap_methods.c
  599. NEED_EAP_COMMON=y
  600. ifdef CONFIG_DYNAMIC_EAP_METHODS
  601. L_CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  602. LIBS += -ldl -rdynamic
  603. endif
  604. endif
  605. ifdef CONFIG_AP
  606. NEED_80211_COMMON=y
  607. NEED_EAP_COMMON=y
  608. NEED_RSN_AUTHENTICATOR=y
  609. L_CFLAGS += -DCONFIG_AP
  610. OBJS += ap.c
  611. L_CFLAGS += -DCONFIG_NO_RADIUS
  612. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  613. L_CFLAGS += -DCONFIG_NO_VLAN
  614. OBJS += src/ap/hostapd.c
  615. OBJS += src/ap/wpa_auth_glue.c
  616. OBJS += src/ap/utils.c
  617. OBJS += src/ap/authsrv.c
  618. OBJS += src/ap/ap_config.c
  619. OBJS += src/utils/ip_addr.c
  620. OBJS += src/ap/sta_info.c
  621. OBJS += src/ap/tkip_countermeasures.c
  622. OBJS += src/ap/ap_mlme.c
  623. OBJS += src/ap/ieee802_1x.c
  624. OBJS += src/eapol_auth/eapol_auth_sm.c
  625. OBJS += src/ap/ieee802_11_auth.c
  626. OBJS += src/ap/ieee802_11_shared.c
  627. OBJS += src/ap/drv_callbacks.c
  628. OBJS += src/ap/ap_drv_ops.c
  629. OBJS += src/ap/beacon.c
  630. ifdef CONFIG_IEEE80211N
  631. OBJS += src/ap/ieee802_11_ht.c
  632. endif
  633. ifdef CONFIG_CTRL_IFACE
  634. OBJS += src/ap/ctrl_iface_ap.c
  635. endif
  636. L_CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  637. OBJS += src/eap_server/eap_server.c
  638. OBJS += src/eap_server/eap_server_identity.c
  639. OBJS += src/eap_server/eap_server_methods.c
  640. ifdef CONFIG_IEEE80211N
  641. L_CFLAGS += -DCONFIG_IEEE80211N
  642. endif
  643. ifdef NEED_AP_MLME
  644. OBJS += src/ap/wmm.c
  645. OBJS += src/ap/ap_list.c
  646. OBJS += src/ap/ieee802_11.c
  647. OBJS += src/ap/hw_features.c
  648. L_CFLAGS += -DNEED_AP_MLME
  649. endif
  650. ifdef CONFIG_WPS
  651. L_CFLAGS += -DEAP_SERVER_WSC
  652. OBJS += src/ap/wps_hostapd.c
  653. OBJS += src/eap_server/eap_server_wsc.c
  654. endif
  655. endif
  656. ifdef NEED_RSN_AUTHENTICATOR
  657. L_CFLAGS += -DCONFIG_NO_RADIUS
  658. NEED_AES_WRAP=y
  659. OBJS += src/ap/wpa_auth.c
  660. OBJS += src/ap/wpa_auth_ie.c
  661. OBJS += src/ap/pmksa_cache_auth.c
  662. ifdef CONFIG_IEEE80211R
  663. OBJS += src/ap/wpa_auth_ft.c
  664. endif
  665. ifdef CONFIG_PEERKEY
  666. OBJS += src/ap/peerkey_auth.c
  667. endif
  668. endif
  669. ifdef CONFIG_EAP_SERVER
  670. L_CFLAGS += -DEAP_SERVER
  671. OBJS_h += src/eap_server/eap_server.c
  672. OBJS_h += src/eap_server/eap_server_identity.c
  673. OBJS_h += src/eap_server/eap_server_methods.c
  674. endif
  675. ifdef CONFIG_RADIUS_CLIENT
  676. OBJS_h += src/utils/ip_addr.c
  677. OBJS_h += src/radius/radius.c
  678. OBJS_h += src/radius/radius_client.c
  679. endif
  680. ifdef CONFIG_AUTHENTICATOR
  681. OBJS_h += src/eapol_auth/eapol_auth_sm.c
  682. OBJS_h += src/ap/ieee802_1x.c
  683. endif
  684. ifdef CONFIG_WPA_AUTHENTICATOR
  685. OBJS_h += src/ap/wpa_auth.c
  686. OBJS_h += src/ap/wpa_auth_ie.c
  687. OBJS_h += src/ap/pmksa_cache_auth.c
  688. ifdef CONFIG_IEEE80211R
  689. OBJS_h += src/ap/wpa_auth_ft.c
  690. endif
  691. ifdef CONFIG_PEERKEY
  692. OBJS_h += src/ap/peerkey_auth.c
  693. endif
  694. endif
  695. ifdef CONFIG_PCSC
  696. # PC/SC interface for smartcards (USIM, GSM SIM)
  697. L_CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  698. OBJS += src/utils/pcsc_funcs.c
  699. # -lpthread may not be needed depending on how pcsc-lite was configured
  700. ifdef CONFIG_NATIVE_WINDOWS
  701. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  702. #dynamic symbol loading that is now used in pcsc_funcs.c
  703. #LIBS += -lwinscard
  704. else
  705. LIBS += -lpcsclite -lpthread
  706. endif
  707. endif
  708. ifdef CONFIG_SIM_SIMULATOR
  709. L_CFLAGS += -DCONFIG_SIM_SIMULATOR
  710. NEED_MILENAGE=y
  711. endif
  712. ifdef CONFIG_USIM_SIMULATOR
  713. L_CFLAGS += -DCONFIG_USIM_SIMULATOR
  714. NEED_MILENAGE=y
  715. endif
  716. ifdef NEED_MILENAGE
  717. OBJS += src/crypto/milenage.c
  718. NEED_AES_ENCBLOCK=y
  719. endif
  720. ifdef CONFIG_PKCS12
  721. L_CFLAGS += -DPKCS12_FUNCS
  722. endif
  723. ifdef CONFIG_SMARTCARD
  724. L_CFLAGS += -DCONFIG_SMARTCARD
  725. endif
  726. ifdef MS_FUNCS
  727. OBJS += src/crypto/ms_funcs.c
  728. NEED_DES=y
  729. NEED_MD4=y
  730. endif
  731. ifdef CHAP
  732. OBJS += src/eap_common/chap.c
  733. endif
  734. ifdef TLS_FUNCS
  735. NEED_DES=y
  736. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  737. OBJS += src/eap_peer/eap_tls_common.c
  738. OBJS_h += src/eap_server/eap_server_tls_common.c
  739. NEED_TLS_PRF=y
  740. endif
  741. ifndef CONFIG_TLS
  742. CONFIG_TLS=openssl
  743. endif
  744. ifdef CONFIG_TLSV11
  745. L_CFLAGS += -DCONFIG_TLSV11
  746. endif
  747. ifeq ($(CONFIG_TLS), openssl)
  748. ifdef TLS_FUNCS
  749. L_CFLAGS += -DEAP_TLS_OPENSSL
  750. OBJS += src/crypto/tls_openssl.c
  751. LIBS += -lssl
  752. endif
  753. OBJS += src/crypto/crypto_openssl.c
  754. OBJS_p += src/crypto/crypto_openssl.c
  755. ifdef NEED_FIPS186_2_PRF
  756. OBJS += src/crypto/fips_prf_openssl.c
  757. endif
  758. LIBS += -lcrypto
  759. LIBS_p += -lcrypto
  760. endif
  761. ifeq ($(CONFIG_TLS), gnutls)
  762. ifdef TLS_FUNCS
  763. OBJS += src/crypto/tls_gnutls.c
  764. LIBS += -lgnutls -lgpg-error
  765. endif
  766. OBJS += src/crypto/crypto_gnutls.c
  767. OBJS_p += src/crypto/crypto_gnutls.c
  768. ifdef NEED_FIPS186_2_PRF
  769. OBJS += src/crypto/fips_prf_gnutls.c
  770. endif
  771. LIBS += -lgcrypt
  772. LIBS_p += -lgcrypt
  773. CONFIG_INTERNAL_SHA256=y
  774. CONFIG_INTERNAL_RC4=y
  775. CONFIG_INTERNAL_DH_GROUP5=y
  776. endif
  777. ifeq ($(CONFIG_TLS), schannel)
  778. ifdef TLS_FUNCS
  779. OBJS += src/crypto/tls_schannel.c
  780. endif
  781. OBJS += src/crypto/crypto_cryptoapi.c
  782. OBJS_p += src/crypto/crypto_cryptoapi.c
  783. ifdef NEED_FIPS186_2_PRF
  784. OBJS += src/crypto/fips_prf_cryptoapi.c
  785. endif
  786. CONFIG_INTERNAL_SHA256=y
  787. CONFIG_INTERNAL_RC4=y
  788. CONFIG_INTERNAL_DH_GROUP5=y
  789. endif
  790. ifeq ($(CONFIG_TLS), nss)
  791. ifdef TLS_FUNCS
  792. OBJS += src/crypto/tls_nss.c
  793. LIBS += -lssl3
  794. endif
  795. OBJS += src/crypto/crypto_nss.c
  796. OBJS_p += src/crypto/crypto_nss.c
  797. ifdef NEED_FIPS186_2_PRF
  798. OBJS += src/crypto/fips_prf_nss.c
  799. endif
  800. LIBS += -lnss3
  801. LIBS_p += -lnss3
  802. CONFIG_INTERNAL_MD4=y
  803. CONFIG_INTERNAL_DH_GROUP5=y
  804. endif
  805. ifeq ($(CONFIG_TLS), internal)
  806. ifndef CONFIG_CRYPTO
  807. CONFIG_CRYPTO=internal
  808. endif
  809. ifdef TLS_FUNCS
  810. OBJS += src/crypto/crypto_internal-rsa.c
  811. OBJS += src/crypto/tls_internal.c
  812. OBJS += src/tls/tlsv1_common.c
  813. OBJS += src/tls/tlsv1_record.c
  814. OBJS += src/tls/tlsv1_cred.c
  815. OBJS += src/tls/tlsv1_client.c
  816. OBJS += src/tls/tlsv1_client_write.c
  817. OBJS += src/tls/tlsv1_client_read.c
  818. OBJS += src/tls/asn1.c
  819. OBJS += src/tls/rsa.c
  820. OBJS += src/tls/x509v3.c
  821. OBJS += src/tls/pkcs1.c
  822. OBJS += src/tls/pkcs5.c
  823. OBJS += src/tls/pkcs8.c
  824. NEED_SHA256=y
  825. NEED_BASE64=y
  826. NEED_TLS_PRF=y
  827. NEED_MODEXP=y
  828. NEED_CIPHER=y
  829. L_CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  830. endif
  831. ifdef NEED_CIPHER
  832. NEED_DES=y
  833. OBJS += src/crypto/crypto_internal-cipher.c
  834. endif
  835. ifdef NEED_MODEXP
  836. OBJS += src/crypto/crypto_internal-modexp.c
  837. OBJS += src/tls/bignum.c
  838. endif
  839. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  840. OBJS += src/crypto/crypto_libtomcrypt.c
  841. OBJS_p += src/crypto/crypto_libtomcrypt.c
  842. LIBS += -ltomcrypt -ltfm
  843. LIBS_p += -ltomcrypt -ltfm
  844. CONFIG_INTERNAL_SHA256=y
  845. CONFIG_INTERNAL_RC4=y
  846. CONFIG_INTERNAL_DH_GROUP5=y
  847. endif
  848. ifeq ($(CONFIG_CRYPTO), internal)
  849. OBJS += src/crypto/crypto_internal.c
  850. OBJS_p += src/crypto/crypto_internal.c
  851. NEED_AES_ENC=y
  852. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  853. ifdef CONFIG_INTERNAL_LIBTOMMATH
  854. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  855. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  856. L_CFLAGS += -DLTM_FAST
  857. endif
  858. else
  859. LIBS += -ltommath
  860. LIBS_p += -ltommath
  861. endif
  862. CONFIG_INTERNAL_AES=y
  863. CONFIG_INTERNAL_DES=y
  864. CONFIG_INTERNAL_SHA1=y
  865. CONFIG_INTERNAL_MD4=y
  866. CONFIG_INTERNAL_MD5=y
  867. CONFIG_INTERNAL_SHA256=y
  868. CONFIG_INTERNAL_RC4=y
  869. CONFIG_INTERNAL_DH_GROUP5=y
  870. endif
  871. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  872. OBJS += src/crypto/crypto_cryptoapi.c
  873. OBJS_p += src/crypto/crypto_cryptoapi.c
  874. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  875. CONFIG_INTERNAL_SHA256=y
  876. CONFIG_INTERNAL_RC4=y
  877. endif
  878. endif
  879. ifeq ($(CONFIG_TLS), none)
  880. ifdef TLS_FUNCS
  881. OBJS += src/crypto/tls_none.c
  882. L_CFLAGS += -DEAP_TLS_NONE
  883. CONFIG_INTERNAL_AES=y
  884. CONFIG_INTERNAL_SHA1=y
  885. CONFIG_INTERNAL_MD5=y
  886. endif
  887. OBJS += src/crypto/crypto_none.c
  888. OBJS_p += src/crypto/crypto_none.c
  889. CONFIG_INTERNAL_SHA256=y
  890. CONFIG_INTERNAL_RC4=y
  891. endif
  892. ifdef TLS_FUNCS
  893. ifdef CONFIG_SMARTCARD
  894. ifndef CONFIG_NATIVE_WINDOWS
  895. ifneq ($(CONFIG_L2_PACKET), freebsd)
  896. LIBS += -ldl
  897. endif
  898. endif
  899. endif
  900. endif
  901. ifndef TLS_FUNCS
  902. OBJS += src/crypto/tls_none.c
  903. ifeq ($(CONFIG_TLS), internal)
  904. CONFIG_INTERNAL_AES=y
  905. CONFIG_INTERNAL_SHA1=y
  906. CONFIG_INTERNAL_MD5=y
  907. CONFIG_INTERNAL_RC4=y
  908. endif
  909. endif
  910. AESOBJS = # none so far (see below)
  911. ifdef CONFIG_INTERNAL_AES
  912. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-dec.c
  913. endif
  914. AESOBJS += src/crypto/aes-unwrap.c
  915. ifdef NEED_AES_EAX
  916. AESOBJS += src/crypto/aes-eax.c
  917. NEED_AES_CTR=y
  918. endif
  919. ifdef NEED_AES_CTR
  920. AESOBJS += src/crypto/aes-ctr.c
  921. endif
  922. ifdef NEED_AES_ENCBLOCK
  923. AESOBJS += src/crypto/aes-encblock.c
  924. endif
  925. ifdef NEED_AES_OMAC1
  926. NEED_AES_ENC=y
  927. AESOBJS += src/crypto/aes-omac1.c
  928. endif
  929. ifdef NEED_AES_WRAP
  930. NEED_AES_ENC=y
  931. AESOBJS += src/crypto/aes-wrap.c
  932. endif
  933. ifdef NEED_AES_CBC
  934. NEED_AES_ENC=y
  935. AESOBJS += src/crypto/aes-cbc.c
  936. endif
  937. ifdef NEED_AES_ENC
  938. ifdef CONFIG_INTERNAL_AES
  939. AESOBJS += src/crypto/aes-internal-enc.c
  940. endif
  941. endif
  942. ifdef NEED_AES
  943. OBJS += $(AESOBJS)
  944. endif
  945. SHA1OBJS =
  946. ifdef NEED_SHA1
  947. SHA1OBJS += src/crypto/sha1.c
  948. ifdef CONFIG_INTERNAL_SHA1
  949. SHA1OBJS += src/crypto/sha1-internal.c
  950. ifdef NEED_FIPS186_2_PRF
  951. SHA1OBJS += src/crypto/fips_prf_internal.c
  952. endif
  953. endif
  954. ifdef CONFIG_NO_WPA_PASSPHRASE
  955. L_CFLAGS += -DCONFIG_NO_PBKDF2
  956. else
  957. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  958. endif
  959. ifdef NEED_T_PRF
  960. SHA1OBJS += src/crypto/sha1-tprf.c
  961. endif
  962. ifdef NEED_TLS_PRF
  963. SHA1OBJS += src/crypto/sha1-tlsprf.c
  964. endif
  965. endif
  966. MD5OBJS = src/crypto/md5.c
  967. ifdef NEED_MD5
  968. ifdef CONFIG_INTERNAL_MD5
  969. MD5OBJS += src/crypto/md5-internal.c
  970. endif
  971. ifdef CONFIG_FIPS
  972. MD5OBJS += src/crypto/md5-non-fips.c
  973. endif
  974. OBJS += $(MD5OBJS)
  975. OBJS_p += $(MD5OBJS)
  976. endif
  977. ifdef NEED_MD4
  978. ifdef CONFIG_INTERNAL_MD4
  979. OBJS += src/crypto/md4-internal.c
  980. endif
  981. endif
  982. DESOBJS = # none needed when not internal
  983. ifdef NEED_DES
  984. ifdef CONFIG_INTERNAL_DES
  985. DESOBJS += src/crypto/des-internal.c
  986. endif
  987. endif
  988. ifdef NEED_RC4
  989. ifdef CONFIG_INTERNAL_RC4
  990. OBJS += src/crypto/rc4.c
  991. endif
  992. endif
  993. SHA256OBJS = # none by default
  994. ifdef NEED_SHA256
  995. L_CFLAGS += -DCONFIG_SHA256
  996. SHA256OBJS += src/crypto/sha256.c
  997. ifdef CONFIG_INTERNAL_SHA256
  998. SHA256OBJS += src/crypto/sha256-internal.c
  999. endif
  1000. OBJS += $(SHA256OBJS)
  1001. endif
  1002. ifdef NEED_DH_GROUPS
  1003. OBJS += src/crypto/dh_groups.c
  1004. endif
  1005. ifdef NEED_DH_GROUPS_ALL
  1006. L_CFLAGS += -DALL_DH_GROUPS
  1007. endif
  1008. ifdef CONFIG_INTERNAL_DH_GROUP5
  1009. ifdef NEED_DH_GROUPS
  1010. OBJS += src/crypto/dh_group5.c
  1011. endif
  1012. endif
  1013. ifdef CONFIG_NO_RANDOM_POOL
  1014. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1015. else
  1016. OBJS += src/crypto/random.c
  1017. endif
  1018. ifdef CONFIG_CTRL_IFACE
  1019. ifeq ($(CONFIG_CTRL_IFACE), y)
  1020. ifdef CONFIG_NATIVE_WINDOWS
  1021. CONFIG_CTRL_IFACE=named_pipe
  1022. else
  1023. CONFIG_CTRL_IFACE=unix
  1024. endif
  1025. endif
  1026. L_CFLAGS += -DCONFIG_CTRL_IFACE
  1027. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1028. L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1029. endif
  1030. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1031. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1032. endif
  1033. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1034. L_CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1035. endif
  1036. OBJS += ctrl_iface.c ctrl_iface_$(CONFIG_CTRL_IFACE).c
  1037. endif
  1038. ifdef CONFIG_CTRL_IFACE_DBUS
  1039. DBUS=y
  1040. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1041. DBUS_OBJS += dbus/dbus_old.c dbus/dbus_old_handlers.c
  1042. ifdef CONFIG_WPS
  1043. DBUS_OBJS += dbus/dbus_old_handlers_wps.c
  1044. endif
  1045. DBUS_OBJS += dbus/dbus_dict_helpers.c
  1046. ifndef DBUS_LIBS
  1047. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1048. endif
  1049. ifndef DBUS_INCLUDE
  1050. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1051. endif
  1052. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1053. endif
  1054. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1055. DBUS=y
  1056. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1057. DBUS_OBJS ?= dbus/dbus_dict_helpers.c
  1058. DBUS_OBJS += dbus/dbus_new_helpers.c
  1059. DBUS_OBJS += dbus/dbus_new.c dbus/dbus_new_handlers.c
  1060. ifdef CONFIG_WPS
  1061. DBUS_OBJS += dbus/dbus_new_handlers_wps.c
  1062. endif
  1063. ifdef CONFIG_P2P
  1064. DBUS_OBJS += dbus/dbus_new_handlers_p2p.c
  1065. endif
  1066. ifndef DBUS_LIBS
  1067. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1068. endif
  1069. ifndef DBUS_INCLUDE
  1070. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1071. endif
  1072. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1073. DBUS_OBJS += dbus/dbus_new_introspect.c
  1074. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1075. endif
  1076. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1077. endif
  1078. ifdef DBUS
  1079. DBUS_CFLAGS += -DCONFIG_DBUS
  1080. DBUS_OBJS += dbus/dbus_common.c
  1081. endif
  1082. OBJS += $(DBUS_OBJS)
  1083. L_CFLAGS += $(DBUS_CFLAGS)
  1084. LIBS += $(DBUS_LIBS)
  1085. ifdef CONFIG_READLINE
  1086. OBJS_c += src/utils/edit_readline.c
  1087. LIBS_c += -lncurses -lreadline
  1088. else
  1089. ifdef CONFIG_WPA_CLI_EDIT
  1090. OBJS_c += src/utils/edit.c
  1091. else
  1092. OBJS_c += src/utils/edit_simple.c
  1093. endif
  1094. endif
  1095. ifdef CONFIG_NATIVE_WINDOWS
  1096. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1097. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1098. LIBS_c += -lws2_32
  1099. LIBS_p += -lws2_32 -lgdi32
  1100. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1101. LIBS_p += -lcrypt32
  1102. endif
  1103. endif
  1104. ifdef CONFIG_NO_STDOUT_DEBUG
  1105. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1106. ifndef CONFIG_CTRL_IFACE
  1107. L_CFLAGS += -DCONFIG_NO_WPA_MSG
  1108. endif
  1109. endif
  1110. ifdef CONFIG_ANDROID_LOG
  1111. L_CFLAGS += -DCONFIG_ANDROID_LOG
  1112. endif
  1113. ifdef CONFIG_IPV6
  1114. # for eapol_test only
  1115. L_CFLAGS += -DCONFIG_IPV6
  1116. endif
  1117. ifdef NEED_BASE64
  1118. OBJS += src/utils/base64.c
  1119. endif
  1120. ifdef NEED_SME
  1121. NEED_80211_COMMON=y
  1122. OBJS += sme.c
  1123. L_CFLAGS += -DCONFIG_SME
  1124. endif
  1125. ifdef NEED_80211_COMMON
  1126. OBJS += src/common/ieee802_11_common.c
  1127. endif
  1128. ifdef NEED_EAP_COMMON
  1129. OBJS += src/eap_common/eap_common.c
  1130. endif
  1131. ifndef CONFIG_MAIN
  1132. CONFIG_MAIN=main
  1133. endif
  1134. ifdef CONFIG_DEBUG_SYSLOG
  1135. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1136. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1137. L_CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1138. endif
  1139. endif
  1140. ifdef CONFIG_DEBUG_FILE
  1141. L_CFLAGS += -DCONFIG_DEBUG_FILE
  1142. endif
  1143. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1144. L_CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1145. endif
  1146. ifdef CONFIG_FIPS
  1147. L_CFLAGS += -DCONFIG_FIPS
  1148. endif
  1149. OBJS += $(SHA1OBJS) $(DESOBJS)
  1150. OBJS_p += $(SHA1OBJS)
  1151. ifdef CONFIG_BGSCAN_SIMPLE
  1152. L_CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1153. OBJS += bgscan_simple.c
  1154. NEED_BGSCAN=y
  1155. endif
  1156. ifdef CONFIG_BGSCAN_LEARN
  1157. L_CFLAGS += -DCONFIG_BGSCAN_LEARN
  1158. OBJS += bgscan_learn.c
  1159. NEED_BGSCAN=y
  1160. endif
  1161. ifdef NEED_BGSCAN
  1162. L_CFLAGS += -DCONFIG_BGSCAN
  1163. OBJS += bgscan.c
  1164. endif
  1165. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1166. L_CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1167. OBJS += autoscan_exponential.c
  1168. NEED_AUTOSCAN=y
  1169. endif
  1170. ifdef CONFIG_AUTOSCAN_PERIODIC
  1171. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1172. OBJS += autoscan_periodic.c
  1173. NEED_AUTOSCAN=y
  1174. endif
  1175. ifdef NEED_AUTOSCAN
  1176. L_CFLAGS += -DCONFIG_AUTOSCAN
  1177. OBJS += autoscan.c
  1178. endif
  1179. ifdef CONFIG_EXT_PASSWORD_TEST
  1180. OBJS += ../src/utils/ext_password_test.c
  1181. L_CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1182. NEED_EXT_PASSWORD=y
  1183. endif
  1184. ifdef NEED_EXT_PASSWORD
  1185. OBJS += ../src/utils/ext_password.c
  1186. L_CFLAGS += -DCONFIG_EXT_PASSWORD
  1187. endif
  1188. ifdef NEED_GAS
  1189. OBJS += ../src/common/gas.c
  1190. OBJS += gas_query.c
  1191. L_CFLAGS += -DCONFIG_GAS
  1192. NEED_OFFCHANNEL=y
  1193. endif
  1194. ifdef NEED_OFFCHANNEL
  1195. OBJS += offchannel.c
  1196. L_CFLAGS += -DCONFIG_OFFCHANNEL
  1197. endif
  1198. OBJS += src/drivers/driver_common.c
  1199. OBJS_wpa_rm := ctrl_iface.c ctrl_iface_unix.c
  1200. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.c
  1201. ifdef CONFIG_AUTHENTICATOR
  1202. OBJS_wpa += tests/link_test.c
  1203. endif
  1204. OBJS_wpa += $(OBJS_l2)
  1205. OBJS += wpa_supplicant.c events.c blacklist.c wpas_glue.c scan.c
  1206. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.c
  1207. OBJS_t += src/radius/radius_client.c
  1208. OBJS_t += src/radius/radius.c
  1209. ifndef CONFIG_AP
  1210. OBJS_t += src/utils/ip_addr.c
  1211. endif
  1212. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.c
  1213. OBJS += $(CONFIG_MAIN).c
  1214. ifdef CONFIG_PRIVSEP
  1215. OBJS_priv += $(OBJS_d) src/drivers/drivers.c
  1216. OBJS_priv += $(OBJS_l2)
  1217. OBJS_priv += src/utils/os_$(CONFIG_OS).c
  1218. OBJS_priv += src/utils/$(CONFIG_ELOOP).c
  1219. OBJS_priv += src/utils/common.c
  1220. OBJS_priv += src/utils/wpa_debug.c
  1221. OBJS_priv += src/utils/wpabuf.c
  1222. OBJS_priv += wpa_priv.c
  1223. ifdef CONFIG_DRIVER_TEST
  1224. OBJS_priv += $(SHA1OBJS)
  1225. OBJS_priv += $(MD5OBJS)
  1226. ifeq ($(CONFIG_TLS), openssl)
  1227. OBJS_priv += src/crypto/crypto_openssl.c
  1228. endif
  1229. ifeq ($(CONFIG_TLS), gnutls)
  1230. OBJS_priv += src/crypto/crypto_gnutls.c
  1231. endif
  1232. ifeq ($(CONFIG_TLS), nss)
  1233. OBJS_priv += src/crypto/crypto_nss.c
  1234. endif
  1235. ifeq ($(CONFIG_TLS), internal)
  1236. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  1237. OBJS_priv += src/crypto/crypto_libtomcrypt.c
  1238. else
  1239. OBJS_priv += src/crypto/crypto_internal.c
  1240. endif
  1241. endif
  1242. endif # CONFIG_DRIVER_TEST
  1243. OBJS += src/l2_packet/l2_packet_privsep.c
  1244. OBJS += src/drivers/driver_privsep.c
  1245. EXTRA_progs += wpa_priv
  1246. else
  1247. OBJS += $(OBJS_d) src/drivers/drivers.c
  1248. OBJS += $(OBJS_l2)
  1249. endif
  1250. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1251. L_CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1252. OBJS += src/drivers/ndis_events.c
  1253. EXTRALIBS += -loleaut32 -lole32 -luuid
  1254. ifdef PLATFORMSDKLIB
  1255. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1256. else
  1257. EXTRALIBS += WbemUuid.Lib
  1258. endif
  1259. endif
  1260. ifndef LDO
  1261. LDO=$(CC)
  1262. endif
  1263. ########################
  1264. include $(CLEAR_VARS)
  1265. LOCAL_MODULE := wpa_cli
  1266. LOCAL_MODULE_TAGS := debug
  1267. LOCAL_SHARED_LIBRARIES := libc libcutils
  1268. LOCAL_CFLAGS := $(L_CFLAGS)
  1269. LOCAL_SRC_FILES := $(OBJS_c)
  1270. LOCAL_C_INCLUDES := $(INCLUDES)
  1271. include $(BUILD_EXECUTABLE)
  1272. ########################
  1273. include $(CLEAR_VARS)
  1274. LOCAL_MODULE := wpa_supplicant
  1275. ifdef CONFIG_DRIVER_CUSTOM
  1276. LOCAL_STATIC_LIBRARIES := libCustomWifi
  1277. endif
  1278. ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
  1279. LOCAL_STATIC_LIBRARIES += $(BOARD_WPA_SUPPLICANT_PRIVATE_LIB)
  1280. endif
  1281. LOCAL_SHARED_LIBRARIES := libc libcutils
  1282. ifeq ($(CONFIG_TLS), openssl)
  1283. LOCAL_SHARED_LIBRARIES += libcrypto libssl
  1284. endif
  1285. ifdef CONFIG_DRIVER_NL80211
  1286. LOCAL_STATIC_LIBRARIES += libnl_2
  1287. endif
  1288. LOCAL_CFLAGS := $(L_CFLAGS)
  1289. LOCAL_SRC_FILES := $(OBJS)
  1290. LOCAL_C_INCLUDES := $(INCLUDES)
  1291. include $(BUILD_EXECUTABLE)
  1292. ########################
  1293. #
  1294. #include $(CLEAR_VARS)
  1295. #LOCAL_MODULE := eapol_test
  1296. #ifdef CONFIG_DRIVER_CUSTOM
  1297. #LOCAL_STATIC_LIBRARIES := libCustomWifi
  1298. #endif
  1299. #LOCAL_SHARED_LIBRARIES := libc libcrypto libssl
  1300. #LOCAL_CFLAGS := $(L_CFLAGS)
  1301. #LOCAL_SRC_FILES := $(OBJS_t)
  1302. #LOCAL_C_INCLUDES := $(INCLUDES)
  1303. #include $(BUILD_EXECUTABLE)
  1304. #
  1305. ########################
  1306. #
  1307. #local_target_dir := $(TARGET_OUT)/etc/wifi
  1308. #
  1309. #include $(CLEAR_VARS)
  1310. #LOCAL_MODULE := wpa_supplicant.conf
  1311. #LOCAL_MODULE_TAGS := user
  1312. #LOCAL_MODULE_CLASS := ETC
  1313. #LOCAL_MODULE_PATH := $(local_target_dir)
  1314. #LOCAL_SRC_FILES := $(LOCAL_MODULE)
  1315. #include $(BUILD_PREBUILT)
  1316. #
  1317. ########################
  1318. endif # ifeq ($(WPA_BUILD_SUPPLICANT),true)
  1319. include $(CLEAR_VARS)
  1320. LOCAL_MODULE = libwpa_client
  1321. LOCAL_CFLAGS = $(L_CFLAGS)
  1322. LOCAL_SRC_FILES = src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
  1323. LOCAL_C_INCLUDES = $(INCLUDES)
  1324. LOCAL_SHARED_LIBRARIES := libcutils
  1325. LOCAL_COPY_HEADERS_TO := libwpa_client
  1326. LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
  1327. include $(BUILD_SHARED_LIBRARY)