Android.mk 32 KB

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