Android.mk 31 KB

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