Android.mk 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518
  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_TDLS
  151. L_CFLAGS += -DCONFIG_TDLS
  152. OBJS += src/rsn_supp/tdls.c
  153. NEED_SHA256=y
  154. NEED_AES_OMAC1=y
  155. endif
  156. ifdef CONFIG_TDLS_TESTING
  157. L_CFLAGS += -DCONFIG_TDLS_TESTING
  158. endif
  159. ifdef CONFIG_PEERKEY
  160. L_CFLAGS += -DCONFIG_PEERKEY
  161. endif
  162. ifndef CONFIG_NO_WPA
  163. OBJS += src/rsn_supp/wpa.c
  164. OBJS += src/rsn_supp/preauth.c
  165. OBJS += src/rsn_supp/pmksa_cache.c
  166. OBJS += src/rsn_supp/peerkey.c
  167. OBJS += src/rsn_supp/wpa_ie.c
  168. OBJS += src/common/wpa_common.c
  169. NEED_AES=y
  170. NEED_SHA1=y
  171. NEED_MD5=y
  172. NEED_RC4=y
  173. else
  174. L_CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
  175. endif
  176. ifdef CONFIG_IBSS_RSN
  177. NEED_RSN_AUTHENTICATOR=y
  178. L_CFLAGS += -DCONFIG_IBSS_RSN
  179. OBJS += ibss_rsn.c
  180. endif
  181. ifdef CONFIG_P2P
  182. OBJS += p2p_supplicant.c
  183. OBJS += src/p2p/p2p.c
  184. OBJS += src/p2p/p2p_utils.c
  185. OBJS += src/p2p/p2p_parse.c
  186. OBJS += src/p2p/p2p_build.c
  187. OBJS += src/p2p/p2p_go_neg.c
  188. OBJS += src/p2p/p2p_sd.c
  189. OBJS += src/p2p/p2p_pd.c
  190. OBJS += src/p2p/p2p_invitation.c
  191. OBJS += src/p2p/p2p_dev_disc.c
  192. OBJS += src/p2p/p2p_group.c
  193. OBJS += src/ap/p2p_hostapd.c
  194. L_CFLAGS += -DCONFIG_P2P
  195. NEED_GAS=y
  196. NEED_OFFCHANNEL=y
  197. NEED_80211_COMMON=y
  198. CONFIG_WPS=y
  199. CONFIG_AP=y
  200. ifdef CONFIG_P2P_STRICT
  201. L_CFLAGS += -DCONFIG_P2P_STRICT
  202. endif
  203. endif
  204. ifdef CONFIG_HS20
  205. OBJS += hs20_supplicant.c
  206. L_CFLAGS += -DCONFIG_HS20
  207. CONFIG_INTERWORKING=y
  208. endif
  209. ifdef CONFIG_INTERWORKING
  210. OBJS += interworking.c
  211. L_CFLAGS += -DCONFIG_INTERWORKING
  212. NEED_GAS=y
  213. endif
  214. ifdef CONFIG_NO_WPA2
  215. L_CFLAGS += -DCONFIG_NO_WPA2
  216. endif
  217. include $(LOCAL_PATH)/src/drivers/drivers.mk
  218. ifdef CONFIG_AP
  219. OBJS_d += $(DRV_BOTH_OBJS)
  220. L_CFLAGS += $(DRV_BOTH_CFLAGS)
  221. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  222. LIBS += $(DRV_BOTH_LIBS)
  223. else
  224. NEED_AP_MLME=
  225. OBJS_d += $(DRV_WPA_OBJS)
  226. L_CFLAGS += $(DRV_WPA_CFLAGS)
  227. LDFLAGS += $(DRV_WPA_LDFLAGS)
  228. LIBS += $(DRV_WPA_LIBS)
  229. endif
  230. ifndef CONFIG_L2_PACKET
  231. CONFIG_L2_PACKET=linux
  232. endif
  233. OBJS_l2 += src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).c
  234. ifeq ($(CONFIG_L2_PACKET), pcap)
  235. ifdef CONFIG_WINPCAP
  236. L_CFLAGS += -DCONFIG_WINPCAP
  237. LIBS += -lwpcap -lpacket
  238. LIBS_w += -lwpcap
  239. else
  240. LIBS += -ldnet -lpcap
  241. endif
  242. endif
  243. ifeq ($(CONFIG_L2_PACKET), winpcap)
  244. LIBS += -lwpcap -lpacket
  245. LIBS_w += -lwpcap
  246. endif
  247. ifeq ($(CONFIG_L2_PACKET), freebsd)
  248. LIBS += -lpcap
  249. endif
  250. ifdef CONFIG_EAP_TLS
  251. # EAP-TLS
  252. ifeq ($(CONFIG_EAP_TLS), dyn)
  253. L_CFLAGS += -DEAP_TLS_DYNAMIC
  254. EAPDYN += src/eap_peer/eap_tls.so
  255. else
  256. L_CFLAGS += -DEAP_TLS
  257. OBJS += src/eap_peer/eap_tls.c
  258. OBJS_h += src/eap_server/eap_server_tls.c
  259. endif
  260. TLS_FUNCS=y
  261. CONFIG_IEEE8021X_EAPOL=y
  262. endif
  263. ifdef CONFIG_EAP_PEAP
  264. # EAP-PEAP
  265. ifeq ($(CONFIG_EAP_PEAP), dyn)
  266. L_CFLAGS += -DEAP_PEAP_DYNAMIC
  267. EAPDYN += src/eap_peer/eap_peap.so
  268. else
  269. L_CFLAGS += -DEAP_PEAP
  270. OBJS += src/eap_peer/eap_peap.c
  271. OBJS += src/eap_common/eap_peap_common.c
  272. OBJS_h += src/eap_server/eap_server_peap.c
  273. endif
  274. TLS_FUNCS=y
  275. CONFIG_IEEE8021X_EAPOL=y
  276. endif
  277. ifdef CONFIG_EAP_TTLS
  278. # EAP-TTLS
  279. ifeq ($(CONFIG_EAP_TTLS), dyn)
  280. L_CFLAGS += -DEAP_TTLS_DYNAMIC
  281. EAPDYN += src/eap_peer/eap_ttls.so
  282. else
  283. L_CFLAGS += -DEAP_TTLS
  284. OBJS += src/eap_peer/eap_ttls.c
  285. OBJS_h += src/eap_server/eap_server_ttls.c
  286. endif
  287. MS_FUNCS=y
  288. TLS_FUNCS=y
  289. CHAP=y
  290. CONFIG_IEEE8021X_EAPOL=y
  291. endif
  292. ifdef CONFIG_EAP_MD5
  293. # EAP-MD5
  294. ifeq ($(CONFIG_EAP_MD5), dyn)
  295. L_CFLAGS += -DEAP_MD5_DYNAMIC
  296. EAPDYN += src/eap_peer/eap_md5.so
  297. else
  298. L_CFLAGS += -DEAP_MD5
  299. OBJS += src/eap_peer/eap_md5.c
  300. OBJS_h += src/eap_server/eap_server_md5.c
  301. endif
  302. CHAP=y
  303. CONFIG_IEEE8021X_EAPOL=y
  304. endif
  305. # backwards compatibility for old spelling
  306. ifdef CONFIG_MSCHAPV2
  307. ifndef CONFIG_EAP_MSCHAPV2
  308. CONFIG_EAP_MSCHAPV2=y
  309. endif
  310. endif
  311. ifdef CONFIG_EAP_MSCHAPV2
  312. # EAP-MSCHAPv2
  313. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  314. L_CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  315. EAPDYN += src/eap_peer/eap_mschapv2.so
  316. EAPDYN += src/eap_peer/mschapv2.so
  317. else
  318. L_CFLAGS += -DEAP_MSCHAPv2
  319. OBJS += src/eap_peer/eap_mschapv2.c
  320. OBJS += src/eap_peer/mschapv2.c
  321. OBJS_h += src/eap_server/eap_server_mschapv2.c
  322. endif
  323. MS_FUNCS=y
  324. CONFIG_IEEE8021X_EAPOL=y
  325. endif
  326. ifdef CONFIG_EAP_GTC
  327. # EAP-GTC
  328. ifeq ($(CONFIG_EAP_GTC), dyn)
  329. L_CFLAGS += -DEAP_GTC_DYNAMIC
  330. EAPDYN += src/eap_peer/eap_gtc.so
  331. else
  332. L_CFLAGS += -DEAP_GTC
  333. OBJS += src/eap_peer/eap_gtc.c
  334. OBJS_h += src/eap_server/eap_server_gtc.c
  335. endif
  336. CONFIG_IEEE8021X_EAPOL=y
  337. endif
  338. ifdef CONFIG_EAP_OTP
  339. # EAP-OTP
  340. ifeq ($(CONFIG_EAP_OTP), dyn)
  341. L_CFLAGS += -DEAP_OTP_DYNAMIC
  342. EAPDYN += src/eap_peer/eap_otp.so
  343. else
  344. L_CFLAGS += -DEAP_OTP
  345. OBJS += src/eap_peer/eap_otp.c
  346. endif
  347. CONFIG_IEEE8021X_EAPOL=y
  348. endif
  349. ifdef CONFIG_EAP_SIM
  350. # EAP-SIM
  351. ifeq ($(CONFIG_EAP_SIM), dyn)
  352. L_CFLAGS += -DEAP_SIM_DYNAMIC
  353. EAPDYN += src/eap_peer/eap_sim.so
  354. else
  355. L_CFLAGS += -DEAP_SIM
  356. OBJS += src/eap_peer/eap_sim.c
  357. OBJS_h += src/eap_server/eap_server_sim.c
  358. endif
  359. CONFIG_IEEE8021X_EAPOL=y
  360. CONFIG_EAP_SIM_COMMON=y
  361. NEED_AES_CBC=y
  362. endif
  363. ifdef CONFIG_EAP_LEAP
  364. # EAP-LEAP
  365. ifeq ($(CONFIG_EAP_LEAP), dyn)
  366. L_CFLAGS += -DEAP_LEAP_DYNAMIC
  367. EAPDYN += src/eap_peer/eap_leap.so
  368. else
  369. L_CFLAGS += -DEAP_LEAP
  370. OBJS += src/eap_peer/eap_leap.c
  371. endif
  372. MS_FUNCS=y
  373. CONFIG_IEEE8021X_EAPOL=y
  374. endif
  375. ifdef CONFIG_EAP_PSK
  376. # EAP-PSK
  377. ifeq ($(CONFIG_EAP_PSK), dyn)
  378. L_CFLAGS += -DEAP_PSK_DYNAMIC
  379. EAPDYN += src/eap_peer/eap_psk.so
  380. else
  381. L_CFLAGS += -DEAP_PSK
  382. OBJS += src/eap_peer/eap_psk.c src/eap_common/eap_psk_common.c
  383. OBJS_h += src/eap_server/eap_server_psk.c
  384. endif
  385. CONFIG_IEEE8021X_EAPOL=y
  386. NEED_AES=y
  387. NEED_AES_OMAC1=y
  388. NEED_AES_ENCBLOCK=y
  389. NEED_AES_EAX=y
  390. endif
  391. ifdef CONFIG_EAP_AKA
  392. # EAP-AKA
  393. ifeq ($(CONFIG_EAP_AKA), dyn)
  394. L_CFLAGS += -DEAP_AKA_DYNAMIC
  395. EAPDYN += src/eap_peer/eap_aka.so
  396. else
  397. L_CFLAGS += -DEAP_AKA
  398. OBJS += src/eap_peer/eap_aka.c
  399. OBJS_h += src/eap_server/eap_server_aka.c
  400. endif
  401. CONFIG_IEEE8021X_EAPOL=y
  402. CONFIG_EAP_SIM_COMMON=y
  403. NEED_AES_CBC=y
  404. endif
  405. ifdef CONFIG_EAP_AKA_PRIME
  406. # EAP-AKA'
  407. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  408. L_CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  409. else
  410. L_CFLAGS += -DEAP_AKA_PRIME
  411. endif
  412. NEED_SHA256=y
  413. endif
  414. ifdef CONFIG_EAP_SIM_COMMON
  415. OBJS += src/eap_common/eap_sim_common.c
  416. OBJS_h += src/eap_server/eap_sim_db.c
  417. NEED_AES=y
  418. NEED_FIPS186_2_PRF=y
  419. endif
  420. ifdef CONFIG_EAP_FAST
  421. # EAP-FAST
  422. ifeq ($(CONFIG_EAP_FAST), dyn)
  423. L_CFLAGS += -DEAP_FAST_DYNAMIC
  424. EAPDYN += src/eap_peer/eap_fast.so
  425. EAPDYN += src/eap_common/eap_fast_common.c
  426. else
  427. L_CFLAGS += -DEAP_FAST
  428. OBJS += src/eap_peer/eap_fast.c src/eap_peer/eap_fast_pac.c
  429. OBJS += src/eap_common/eap_fast_common.c
  430. OBJS_h += src/eap_server/eap_server_fast.c
  431. endif
  432. TLS_FUNCS=y
  433. CONFIG_IEEE8021X_EAPOL=y
  434. NEED_T_PRF=y
  435. endif
  436. ifdef CONFIG_EAP_PAX
  437. # EAP-PAX
  438. ifeq ($(CONFIG_EAP_PAX), dyn)
  439. L_CFLAGS += -DEAP_PAX_DYNAMIC
  440. EAPDYN += src/eap_peer/eap_pax.so
  441. else
  442. L_CFLAGS += -DEAP_PAX
  443. OBJS += src/eap_peer/eap_pax.c src/eap_common/eap_pax_common.c
  444. OBJS_h += src/eap_server/eap_server_pax.c
  445. endif
  446. CONFIG_IEEE8021X_EAPOL=y
  447. endif
  448. ifdef CONFIG_EAP_SAKE
  449. # EAP-SAKE
  450. ifeq ($(CONFIG_EAP_SAKE), dyn)
  451. L_CFLAGS += -DEAP_SAKE_DYNAMIC
  452. EAPDYN += src/eap_peer/eap_sake.so
  453. else
  454. L_CFLAGS += -DEAP_SAKE
  455. OBJS += src/eap_peer/eap_sake.c src/eap_common/eap_sake_common.c
  456. OBJS_h += src/eap_server/eap_server_sake.c
  457. endif
  458. CONFIG_IEEE8021X_EAPOL=y
  459. endif
  460. ifdef CONFIG_EAP_GPSK
  461. # EAP-GPSK
  462. ifeq ($(CONFIG_EAP_GPSK), dyn)
  463. L_CFLAGS += -DEAP_GPSK_DYNAMIC
  464. EAPDYN += src/eap_peer/eap_gpsk.so
  465. else
  466. L_CFLAGS += -DEAP_GPSK
  467. OBJS += src/eap_peer/eap_gpsk.c src/eap_common/eap_gpsk_common.c
  468. OBJS_h += src/eap_server/eap_server_gpsk.c
  469. endif
  470. CONFIG_IEEE8021X_EAPOL=y
  471. ifdef CONFIG_EAP_GPSK_SHA256
  472. L_CFLAGS += -DEAP_GPSK_SHA256
  473. endif
  474. NEED_SHA256=y
  475. NEED_AES_OMAC1=y
  476. endif
  477. ifdef CONFIG_EAP_PWD
  478. L_CFLAGS += -DEAP_PWD
  479. OBJS += src/eap_peer/eap_pwd.c src/eap_common/eap_pwd_common.c
  480. OBJS_h += src/eap_server/eap_pwd.c
  481. CONFIG_IEEE8021X_EAPOL=y
  482. NEED_SHA256=y
  483. endif
  484. ifdef CONFIG_WPS
  485. ifdef CONFIG_WPS2
  486. L_CFLAGS += -DCONFIG_WPS2
  487. endif
  488. # EAP-WSC
  489. L_CFLAGS += -DCONFIG_WPS -DEAP_WSC
  490. OBJS += wps_supplicant.c
  491. OBJS += src/utils/uuid.c
  492. OBJS += src/eap_peer/eap_wsc.c src/eap_common/eap_wsc_common.c
  493. OBJS += src/wps/wps.c
  494. OBJS += src/wps/wps_common.c
  495. OBJS += src/wps/wps_attr_parse.c
  496. OBJS += src/wps/wps_attr_build.c
  497. OBJS += src/wps/wps_attr_process.c
  498. OBJS += src/wps/wps_dev_attr.c
  499. OBJS += src/wps/wps_enrollee.c
  500. OBJS += src/wps/wps_registrar.c
  501. OBJS_h += src/eap_server/eap_server_wsc.c
  502. CONFIG_IEEE8021X_EAPOL=y
  503. NEED_DH_GROUPS=y
  504. NEED_SHA256=y
  505. NEED_BASE64=y
  506. NEED_80211_COMMON=y
  507. NEED_AES_CBC=y
  508. NEED_MODEXP=y
  509. ifdef CONFIG_WPS_UFD
  510. L_CFLAGS += -DCONFIG_WPS_UFD
  511. OBJS += src/wps/wps_ufd.c
  512. NEED_WPS_OOB=y
  513. endif
  514. ifdef CONFIG_WPS_NFC
  515. L_CFLAGS += -DCONFIG_WPS_NFC
  516. OBJS += src/wps/ndef.c
  517. OBJS += src/wps/wps_nfc.c
  518. NEED_WPS_OOB=y
  519. ifdef CONFIG_WPS_NFC_PN531
  520. PN531_PATH ?= /usr/local/src/nfc
  521. L_CFLAGS += -DCONFIG_WPS_NFC_PN531
  522. L_CFLAGS += -I${PN531_PATH}/inc
  523. OBJS += src/wps/wps_nfc_pn531.c
  524. LIBS += ${PN531_PATH}/lib/wpsnfc.dll
  525. LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
  526. endif
  527. endif
  528. ifdef NEED_WPS_OOB
  529. L_CFLAGS += -DCONFIG_WPS_OOB
  530. endif
  531. ifdef CONFIG_WPS_ER
  532. CONFIG_WPS_UPNP=y
  533. L_CFLAGS += -DCONFIG_WPS_ER
  534. OBJS += src/wps/wps_er.c
  535. OBJS += src/wps/wps_er_ssdp.c
  536. endif
  537. ifdef CONFIG_WPS_UPNP
  538. L_CFLAGS += -DCONFIG_WPS_UPNP
  539. OBJS += src/wps/wps_upnp.c
  540. OBJS += src/wps/wps_upnp_ssdp.c
  541. OBJS += src/wps/wps_upnp_web.c
  542. OBJS += src/wps/wps_upnp_event.c
  543. OBJS += src/wps/wps_upnp_ap.c
  544. OBJS += src/wps/upnp_xml.c
  545. OBJS += src/wps/httpread.c
  546. OBJS += src/wps/http_client.c
  547. OBJS += src/wps/http_server.c
  548. endif
  549. ifdef CONFIG_WPS_STRICT
  550. L_CFLAGS += -DCONFIG_WPS_STRICT
  551. OBJS += src/wps/wps_validate.c
  552. endif
  553. ifdef CONFIG_WPS_TESTING
  554. L_CFLAGS += -DCONFIG_WPS_TESTING
  555. endif
  556. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  557. L_CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  558. endif
  559. endif
  560. ifdef CONFIG_EAP_IKEV2
  561. # EAP-IKEv2
  562. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  563. L_CFLAGS += -DEAP_IKEV2_DYNAMIC
  564. EAPDYN += src/eap_peer/eap_ikev2.so src/eap_peer/ikev2.c
  565. EAPDYN += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  566. else
  567. L_CFLAGS += -DEAP_IKEV2
  568. OBJS += src/eap_peer/eap_ikev2.c src/eap_peer/ikev2.c
  569. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  570. OBJS_h += src/eap_server/eap_server_ikev2.c
  571. OBJS_h += src/eap_server/ikev2.c
  572. endif
  573. CONFIG_IEEE8021X_EAPOL=y
  574. NEED_DH_GROUPS=y
  575. NEED_DH_GROUPS_ALL=y
  576. NEED_MODEXP=y
  577. NEED_CIPHER=y
  578. endif
  579. ifdef CONFIG_EAP_VENDOR_TEST
  580. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  581. L_CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  582. EAPDYN += src/eap_peer/eap_vendor_test.so
  583. else
  584. L_CFLAGS += -DEAP_VENDOR_TEST
  585. OBJS += src/eap_peer/eap_vendor_test.c
  586. OBJS_h += src/eap_server/eap_server_vendor_test.c
  587. endif
  588. CONFIG_IEEE8021X_EAPOL=y
  589. endif
  590. ifdef CONFIG_EAP_TNC
  591. # EAP-TNC
  592. L_CFLAGS += -DEAP_TNC
  593. OBJS += src/eap_peer/eap_tnc.c
  594. OBJS += src/eap_peer/tncc.c
  595. OBJS_h += src/eap_server/eap_server_tnc.c
  596. OBJS_h += src/eap_server/tncs.c
  597. NEED_BASE64=y
  598. ifndef CONFIG_NATIVE_WINDOWS
  599. ifndef CONFIG_DRIVER_BSD
  600. LIBS += -ldl
  601. endif
  602. endif
  603. endif
  604. ifdef CONFIG_IEEE8021X_EAPOL
  605. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  606. L_CFLAGS += -DIEEE8021X_EAPOL
  607. OBJS += src/eapol_supp/eapol_supp_sm.c
  608. OBJS += src/eap_peer/eap.c src/eap_peer/eap_methods.c
  609. NEED_EAP_COMMON=y
  610. ifdef CONFIG_DYNAMIC_EAP_METHODS
  611. L_CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  612. LIBS += -ldl -rdynamic
  613. endif
  614. endif
  615. ifdef CONFIG_AP
  616. NEED_80211_COMMON=y
  617. NEED_EAP_COMMON=y
  618. NEED_RSN_AUTHENTICATOR=y
  619. L_CFLAGS += -DCONFIG_AP
  620. OBJS += ap.c
  621. L_CFLAGS += -DCONFIG_NO_RADIUS
  622. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  623. L_CFLAGS += -DCONFIG_NO_VLAN
  624. OBJS += src/ap/hostapd.c
  625. OBJS += src/ap/wpa_auth_glue.c
  626. OBJS += src/ap/utils.c
  627. OBJS += src/ap/authsrv.c
  628. OBJS += src/ap/ap_config.c
  629. OBJS += src/utils/ip_addr.c
  630. OBJS += src/ap/sta_info.c
  631. OBJS += src/ap/tkip_countermeasures.c
  632. OBJS += src/ap/ap_mlme.c
  633. OBJS += src/ap/ieee802_1x.c
  634. OBJS += src/eapol_auth/eapol_auth_sm.c
  635. OBJS += src/ap/ieee802_11_auth.c
  636. OBJS += src/ap/ieee802_11_shared.c
  637. OBJS += src/ap/drv_callbacks.c
  638. OBJS += src/ap/ap_drv_ops.c
  639. OBJS += src/ap/beacon.c
  640. ifdef CONFIG_IEEE80211N
  641. OBJS += src/ap/ieee802_11_ht.c
  642. endif
  643. ifdef CONFIG_CTRL_IFACE
  644. OBJS += src/ap/ctrl_iface_ap.c
  645. endif
  646. L_CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  647. OBJS += src/eap_server/eap_server.c
  648. OBJS += src/eap_server/eap_server_identity.c
  649. OBJS += src/eap_server/eap_server_methods.c
  650. ifdef CONFIG_IEEE80211N
  651. L_CFLAGS += -DCONFIG_IEEE80211N
  652. endif
  653. ifdef NEED_AP_MLME
  654. OBJS += src/ap/wmm.c
  655. OBJS += src/ap/ap_list.c
  656. OBJS += src/ap/ieee802_11.c
  657. OBJS += src/ap/hw_features.c
  658. L_CFLAGS += -DNEED_AP_MLME
  659. endif
  660. ifdef CONFIG_WPS
  661. L_CFLAGS += -DEAP_SERVER_WSC
  662. OBJS += src/ap/wps_hostapd.c
  663. OBJS += src/eap_server/eap_server_wsc.c
  664. endif
  665. ifdef CONFIG_INTERWORKING
  666. OBJS += src/ap/gas_serv.c
  667. endif
  668. ifdef CONFIG_HS20
  669. OBJS += src/ap/hs20.c
  670. endif
  671. endif
  672. ifdef NEED_RSN_AUTHENTICATOR
  673. L_CFLAGS += -DCONFIG_NO_RADIUS
  674. NEED_AES_WRAP=y
  675. OBJS += src/ap/wpa_auth.c
  676. OBJS += src/ap/wpa_auth_ie.c
  677. OBJS += src/ap/pmksa_cache_auth.c
  678. ifdef CONFIG_IEEE80211R
  679. OBJS += src/ap/wpa_auth_ft.c
  680. endif
  681. ifdef CONFIG_PEERKEY
  682. OBJS += src/ap/peerkey_auth.c
  683. endif
  684. endif
  685. ifdef CONFIG_EAP_SERVER
  686. L_CFLAGS += -DEAP_SERVER
  687. OBJS_h += src/eap_server/eap_server.c
  688. OBJS_h += src/eap_server/eap_server_identity.c
  689. OBJS_h += src/eap_server/eap_server_methods.c
  690. endif
  691. ifdef CONFIG_RADIUS_CLIENT
  692. OBJS_h += src/utils/ip_addr.c
  693. OBJS_h += src/radius/radius.c
  694. OBJS_h += src/radius/radius_client.c
  695. endif
  696. ifdef CONFIG_AUTHENTICATOR
  697. OBJS_h += src/eapol_auth/eapol_auth_sm.c
  698. OBJS_h += src/ap/ieee802_1x.c
  699. endif
  700. ifdef CONFIG_WPA_AUTHENTICATOR
  701. OBJS_h += src/ap/wpa_auth.c
  702. OBJS_h += src/ap/wpa_auth_ie.c
  703. OBJS_h += src/ap/pmksa_cache_auth.c
  704. ifdef CONFIG_IEEE80211R
  705. OBJS_h += src/ap/wpa_auth_ft.c
  706. endif
  707. ifdef CONFIG_PEERKEY
  708. OBJS_h += src/ap/peerkey_auth.c
  709. endif
  710. endif
  711. ifdef CONFIG_PCSC
  712. # PC/SC interface for smartcards (USIM, GSM SIM)
  713. L_CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  714. OBJS += src/utils/pcsc_funcs.c
  715. # -lpthread may not be needed depending on how pcsc-lite was configured
  716. ifdef CONFIG_NATIVE_WINDOWS
  717. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  718. #dynamic symbol loading that is now used in pcsc_funcs.c
  719. #LIBS += -lwinscard
  720. else
  721. LIBS += -lpcsclite -lpthread
  722. endif
  723. endif
  724. ifdef CONFIG_SIM_SIMULATOR
  725. L_CFLAGS += -DCONFIG_SIM_SIMULATOR
  726. NEED_MILENAGE=y
  727. endif
  728. ifdef CONFIG_USIM_SIMULATOR
  729. L_CFLAGS += -DCONFIG_USIM_SIMULATOR
  730. NEED_MILENAGE=y
  731. endif
  732. ifdef NEED_MILENAGE
  733. OBJS += src/crypto/milenage.c
  734. NEED_AES_ENCBLOCK=y
  735. endif
  736. ifdef CONFIG_PKCS12
  737. L_CFLAGS += -DPKCS12_FUNCS
  738. endif
  739. ifdef CONFIG_SMARTCARD
  740. L_CFLAGS += -DCONFIG_SMARTCARD
  741. endif
  742. ifdef MS_FUNCS
  743. OBJS += src/crypto/ms_funcs.c
  744. NEED_DES=y
  745. NEED_MD4=y
  746. endif
  747. ifdef CHAP
  748. OBJS += src/eap_common/chap.c
  749. endif
  750. ifdef TLS_FUNCS
  751. NEED_DES=y
  752. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  753. OBJS += src/eap_peer/eap_tls_common.c
  754. OBJS_h += src/eap_server/eap_server_tls_common.c
  755. NEED_TLS_PRF=y
  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 CONFIG_NO_RANDOM_POOL
  1039. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1040. else
  1041. OBJS += src/crypto/random.c
  1042. endif
  1043. ifdef CONFIG_CTRL_IFACE
  1044. ifeq ($(CONFIG_CTRL_IFACE), y)
  1045. ifdef CONFIG_NATIVE_WINDOWS
  1046. CONFIG_CTRL_IFACE=named_pipe
  1047. else
  1048. CONFIG_CTRL_IFACE=unix
  1049. endif
  1050. endif
  1051. L_CFLAGS += -DCONFIG_CTRL_IFACE
  1052. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1053. L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1054. endif
  1055. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1056. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1057. endif
  1058. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1059. L_CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1060. endif
  1061. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1062. CONFIG_CTRL_IFACE=udp
  1063. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1064. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1065. endif
  1066. OBJS += ctrl_iface.c ctrl_iface_$(CONFIG_CTRL_IFACE).c
  1067. endif
  1068. ifdef CONFIG_CTRL_IFACE_DBUS
  1069. DBUS=y
  1070. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1071. DBUS_OBJS += dbus/dbus_old.c dbus/dbus_old_handlers.c
  1072. ifdef CONFIG_WPS
  1073. DBUS_OBJS += dbus/dbus_old_handlers_wps.c
  1074. endif
  1075. DBUS_OBJS += dbus/dbus_dict_helpers.c
  1076. ifndef DBUS_LIBS
  1077. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1078. endif
  1079. ifndef DBUS_INCLUDE
  1080. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1081. endif
  1082. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1083. endif
  1084. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1085. DBUS=y
  1086. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1087. DBUS_OBJS ?= dbus/dbus_dict_helpers.c
  1088. DBUS_OBJS += dbus/dbus_new_helpers.c
  1089. DBUS_OBJS += dbus/dbus_new.c dbus/dbus_new_handlers.c
  1090. ifdef CONFIG_WPS
  1091. DBUS_OBJS += dbus/dbus_new_handlers_wps.c
  1092. endif
  1093. ifdef CONFIG_P2P
  1094. DBUS_OBJS += dbus/dbus_new_handlers_p2p.c
  1095. endif
  1096. ifndef DBUS_LIBS
  1097. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1098. endif
  1099. ifndef DBUS_INCLUDE
  1100. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1101. endif
  1102. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1103. DBUS_OBJS += dbus/dbus_new_introspect.c
  1104. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1105. endif
  1106. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1107. endif
  1108. ifdef DBUS
  1109. DBUS_CFLAGS += -DCONFIG_DBUS
  1110. DBUS_OBJS += dbus/dbus_common.c
  1111. endif
  1112. OBJS += $(DBUS_OBJS)
  1113. L_CFLAGS += $(DBUS_CFLAGS)
  1114. LIBS += $(DBUS_LIBS)
  1115. ifdef CONFIG_READLINE
  1116. OBJS_c += src/utils/edit_readline.c
  1117. LIBS_c += -lncurses -lreadline
  1118. else
  1119. ifdef CONFIG_WPA_CLI_EDIT
  1120. OBJS_c += src/utils/edit.c
  1121. else
  1122. OBJS_c += src/utils/edit_simple.c
  1123. endif
  1124. endif
  1125. ifdef CONFIG_NATIVE_WINDOWS
  1126. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1127. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1128. LIBS_c += -lws2_32
  1129. LIBS_p += -lws2_32 -lgdi32
  1130. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1131. LIBS_p += -lcrypt32
  1132. endif
  1133. endif
  1134. ifdef CONFIG_NO_STDOUT_DEBUG
  1135. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1136. ifndef CONFIG_CTRL_IFACE
  1137. L_CFLAGS += -DCONFIG_NO_WPA_MSG
  1138. endif
  1139. endif
  1140. ifdef CONFIG_ANDROID_LOG
  1141. L_CFLAGS += -DCONFIG_ANDROID_LOG
  1142. endif
  1143. ifdef CONFIG_IPV6
  1144. # for eapol_test only
  1145. L_CFLAGS += -DCONFIG_IPV6
  1146. endif
  1147. ifdef NEED_BASE64
  1148. OBJS += src/utils/base64.c
  1149. endif
  1150. ifdef NEED_SME
  1151. NEED_80211_COMMON=y
  1152. OBJS += sme.c
  1153. L_CFLAGS += -DCONFIG_SME
  1154. endif
  1155. ifdef NEED_80211_COMMON
  1156. OBJS += src/common/ieee802_11_common.c
  1157. endif
  1158. ifdef NEED_EAP_COMMON
  1159. OBJS += src/eap_common/eap_common.c
  1160. endif
  1161. ifndef CONFIG_MAIN
  1162. CONFIG_MAIN=main
  1163. endif
  1164. ifdef CONFIG_DEBUG_SYSLOG
  1165. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1166. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1167. L_CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1168. endif
  1169. endif
  1170. ifdef CONFIG_DEBUG_FILE
  1171. L_CFLAGS += -DCONFIG_DEBUG_FILE
  1172. endif
  1173. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1174. L_CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1175. endif
  1176. ifdef CONFIG_FIPS
  1177. L_CFLAGS += -DCONFIG_FIPS
  1178. endif
  1179. OBJS += $(SHA1OBJS) $(DESOBJS)
  1180. OBJS_p += $(SHA1OBJS)
  1181. ifdef CONFIG_BGSCAN_SIMPLE
  1182. L_CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1183. OBJS += bgscan_simple.c
  1184. NEED_BGSCAN=y
  1185. endif
  1186. ifdef CONFIG_BGSCAN_LEARN
  1187. L_CFLAGS += -DCONFIG_BGSCAN_LEARN
  1188. OBJS += bgscan_learn.c
  1189. NEED_BGSCAN=y
  1190. endif
  1191. ifdef NEED_BGSCAN
  1192. L_CFLAGS += -DCONFIG_BGSCAN
  1193. OBJS += bgscan.c
  1194. endif
  1195. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1196. L_CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1197. OBJS += autoscan_exponential.c
  1198. NEED_AUTOSCAN=y
  1199. endif
  1200. ifdef CONFIG_AUTOSCAN_PERIODIC
  1201. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1202. OBJS += autoscan_periodic.c
  1203. NEED_AUTOSCAN=y
  1204. endif
  1205. ifdef NEED_AUTOSCAN
  1206. L_CFLAGS += -DCONFIG_AUTOSCAN
  1207. OBJS += autoscan.c
  1208. endif
  1209. ifdef CONFIG_EXT_PASSWORD_TEST
  1210. OBJS += ../src/utils/ext_password_test.c
  1211. L_CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1212. NEED_EXT_PASSWORD=y
  1213. endif
  1214. ifdef NEED_EXT_PASSWORD
  1215. OBJS += ../src/utils/ext_password.c
  1216. L_CFLAGS += -DCONFIG_EXT_PASSWORD
  1217. endif
  1218. ifdef NEED_GAS
  1219. OBJS += ../src/common/gas.c
  1220. OBJS += gas_query.c
  1221. L_CFLAGS += -DCONFIG_GAS
  1222. NEED_OFFCHANNEL=y
  1223. endif
  1224. ifdef NEED_OFFCHANNEL
  1225. OBJS += offchannel.c
  1226. L_CFLAGS += -DCONFIG_OFFCHANNEL
  1227. endif
  1228. OBJS += src/drivers/driver_common.c
  1229. OBJS_wpa_rm := ctrl_iface.c ctrl_iface_unix.c
  1230. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.c
  1231. ifdef CONFIG_AUTHENTICATOR
  1232. OBJS_wpa += tests/link_test.c
  1233. endif
  1234. OBJS_wpa += $(OBJS_l2)
  1235. OBJS += wpa_supplicant.c events.c blacklist.c wpas_glue.c scan.c
  1236. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.c
  1237. OBJS_t += src/radius/radius_client.c
  1238. OBJS_t += src/radius/radius.c
  1239. ifndef CONFIG_AP
  1240. OBJS_t += src/utils/ip_addr.c
  1241. endif
  1242. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.c
  1243. OBJS += $(CONFIG_MAIN).c
  1244. ifdef CONFIG_PRIVSEP
  1245. OBJS_priv += $(OBJS_d) src/drivers/drivers.c
  1246. OBJS_priv += $(OBJS_l2)
  1247. OBJS_priv += src/utils/os_$(CONFIG_OS).c
  1248. OBJS_priv += src/utils/$(CONFIG_ELOOP).c
  1249. OBJS_priv += src/utils/common.c
  1250. OBJS_priv += src/utils/wpa_debug.c
  1251. OBJS_priv += src/utils/wpabuf.c
  1252. OBJS_priv += wpa_priv.c
  1253. ifdef CONFIG_DRIVER_TEST
  1254. OBJS_priv += $(SHA1OBJS)
  1255. OBJS_priv += $(MD5OBJS)
  1256. ifeq ($(CONFIG_TLS), openssl)
  1257. OBJS_priv += src/crypto/crypto_openssl.c
  1258. endif
  1259. ifeq ($(CONFIG_TLS), gnutls)
  1260. OBJS_priv += src/crypto/crypto_gnutls.c
  1261. endif
  1262. ifeq ($(CONFIG_TLS), nss)
  1263. OBJS_priv += src/crypto/crypto_nss.c
  1264. endif
  1265. ifeq ($(CONFIG_TLS), internal)
  1266. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  1267. OBJS_priv += src/crypto/crypto_libtomcrypt.c
  1268. else
  1269. OBJS_priv += src/crypto/crypto_internal.c
  1270. endif
  1271. endif
  1272. endif # CONFIG_DRIVER_TEST
  1273. OBJS += src/l2_packet/l2_packet_privsep.c
  1274. OBJS += src/drivers/driver_privsep.c
  1275. EXTRA_progs += wpa_priv
  1276. else
  1277. OBJS += $(OBJS_d) src/drivers/drivers.c
  1278. OBJS += $(OBJS_l2)
  1279. endif
  1280. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1281. L_CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1282. OBJS += src/drivers/ndis_events.c
  1283. EXTRALIBS += -loleaut32 -lole32 -luuid
  1284. ifdef PLATFORMSDKLIB
  1285. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1286. else
  1287. EXTRALIBS += WbemUuid.Lib
  1288. endif
  1289. endif
  1290. ifndef LDO
  1291. LDO=$(CC)
  1292. endif
  1293. ########################
  1294. include $(CLEAR_VARS)
  1295. LOCAL_MODULE := wpa_cli
  1296. LOCAL_MODULE_TAGS := debug
  1297. LOCAL_SHARED_LIBRARIES := libc libcutils
  1298. LOCAL_CFLAGS := $(L_CFLAGS)
  1299. LOCAL_SRC_FILES := $(OBJS_c)
  1300. LOCAL_C_INCLUDES := $(INCLUDES)
  1301. include $(BUILD_EXECUTABLE)
  1302. ########################
  1303. include $(CLEAR_VARS)
  1304. LOCAL_MODULE := wpa_supplicant
  1305. ifdef CONFIG_DRIVER_CUSTOM
  1306. LOCAL_STATIC_LIBRARIES := libCustomWifi
  1307. endif
  1308. ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
  1309. LOCAL_STATIC_LIBRARIES += $(BOARD_WPA_SUPPLICANT_PRIVATE_LIB)
  1310. endif
  1311. LOCAL_SHARED_LIBRARIES := libc libcutils
  1312. ifeq ($(CONFIG_TLS), openssl)
  1313. LOCAL_SHARED_LIBRARIES += libcrypto libssl
  1314. endif
  1315. ifdef CONFIG_DRIVER_NL80211
  1316. LOCAL_STATIC_LIBRARIES += libnl_2
  1317. endif
  1318. LOCAL_CFLAGS := $(L_CFLAGS)
  1319. LOCAL_SRC_FILES := $(OBJS)
  1320. LOCAL_C_INCLUDES := $(INCLUDES)
  1321. include $(BUILD_EXECUTABLE)
  1322. ########################
  1323. #
  1324. #include $(CLEAR_VARS)
  1325. #LOCAL_MODULE := eapol_test
  1326. #ifdef CONFIG_DRIVER_CUSTOM
  1327. #LOCAL_STATIC_LIBRARIES := libCustomWifi
  1328. #endif
  1329. #LOCAL_SHARED_LIBRARIES := libc libcrypto libssl
  1330. #LOCAL_CFLAGS := $(L_CFLAGS)
  1331. #LOCAL_SRC_FILES := $(OBJS_t)
  1332. #LOCAL_C_INCLUDES := $(INCLUDES)
  1333. #include $(BUILD_EXECUTABLE)
  1334. #
  1335. ########################
  1336. #
  1337. #local_target_dir := $(TARGET_OUT)/etc/wifi
  1338. #
  1339. #include $(CLEAR_VARS)
  1340. #LOCAL_MODULE := wpa_supplicant.conf
  1341. #LOCAL_MODULE_TAGS := user
  1342. #LOCAL_MODULE_CLASS := ETC
  1343. #LOCAL_MODULE_PATH := $(local_target_dir)
  1344. #LOCAL_SRC_FILES := $(LOCAL_MODULE)
  1345. #include $(BUILD_PREBUILT)
  1346. #
  1347. ########################
  1348. endif # ifeq ($(WPA_BUILD_SUPPLICANT),true)
  1349. include $(CLEAR_VARS)
  1350. LOCAL_MODULE = libwpa_client
  1351. LOCAL_CFLAGS = $(L_CFLAGS)
  1352. LOCAL_SRC_FILES = src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
  1353. LOCAL_C_INCLUDES = $(INCLUDES)
  1354. LOCAL_SHARED_LIBRARIES := libcutils
  1355. LOCAL_COPY_HEADERS_TO := libwpa_client
  1356. LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
  1357. include $(BUILD_SHARED_LIBRARY)