Android.mk 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512
  1. #
  2. # Copyright (C) 2008 The Android Open Source Project
  3. #
  4. # This software may be distributed under the terms of the BSD license.
  5. # See README for more details.
  6. #
  7. LOCAL_PATH := $(call my-dir)
  8. PKG_CONFIG ?= pkg-config
  9. WPA_BUILD_SUPPLICANT := false
  10. ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),)
  11. WPA_BUILD_SUPPLICANT := true
  12. CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) := y
  13. endif
  14. ifeq ($(WPA_BUILD_SUPPLICANT),true)
  15. include $(LOCAL_PATH)/android.config
  16. # To ignore possible wrong network configurations
  17. L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
  18. L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
  19. # Set Android log name
  20. L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
  21. # Disable roaming in wpa_supplicant
  22. ifdef CONFIG_NO_ROAMING
  23. L_CFLAGS += -DCONFIG_NO_ROAMING
  24. endif
  25. # Use Android specific directory for control interface sockets
  26. L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
  27. L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/wpa_supplicant\"
  28. # To force sizeof(enum) = 4
  29. ifeq ($(TARGET_ARCH),arm)
  30. L_CFLAGS += -mabi=aapcs-linux
  31. endif
  32. # To allow non-ASCII characters in SSID
  33. L_CFLAGS += -DWPA_UNICODE_SSID
  34. # OpenSSL is configured without engines on Android
  35. L_CFLAGS += -DOPENSSL_NO_ENGINE
  36. INCLUDES = $(LOCAL_PATH)
  37. INCLUDES += $(LOCAL_PATH)/src
  38. INCLUDES += $(LOCAL_PATH)/src/common
  39. # INCLUDES += $(LOCAL_PATH)/src/crypto # To force proper includes
  40. INCLUDES += $(LOCAL_PATH)/src/drivers
  41. INCLUDES += $(LOCAL_PATH)/src/eap_common
  42. INCLUDES += $(LOCAL_PATH)/src/eapol_supp
  43. INCLUDES += $(LOCAL_PATH)/src/eap_peer
  44. INCLUDES += $(LOCAL_PATH)/src/eap_server
  45. INCLUDES += $(LOCAL_PATH)/src/hlr_auc_gw
  46. INCLUDES += $(LOCAL_PATH)/src/l2_packet
  47. INCLUDES += $(LOCAL_PATH)/src/radius
  48. INCLUDES += $(LOCAL_PATH)/src/rsn_supp
  49. INCLUDES += $(LOCAL_PATH)/src/tls
  50. INCLUDES += $(LOCAL_PATH)/src/utils
  51. INCLUDES += $(LOCAL_PATH)/src/wps
  52. INCLUDES += external/openssl/include
  53. INCLUDES += frameworks/base/cmds/keystore
  54. INCLUDES += system/security/keystore
  55. ifdef CONFIG_DRIVER_NL80211
  56. INCLUDES += external/libnl-headers
  57. endif
  58. ifdef CONFIG_FIPS
  59. CONFIG_NO_RANDOM_POOL=
  60. CONFIG_OPENSSL_CMAC=y
  61. endif
  62. OBJS = config.c
  63. OBJS += notify.c
  64. OBJS += bss.c
  65. OBJS += eap_register.c
  66. OBJS += src/utils/common.c
  67. OBJS += src/utils/wpa_debug.c
  68. OBJS += src/utils/wpabuf.c
  69. OBJS_p = wpa_passphrase.c
  70. OBJS_p += src/utils/common.c
  71. OBJS_p += src/utils/wpa_debug.c
  72. OBJS_p += src/utils/wpabuf.c
  73. OBJS_c = wpa_cli.c src/common/wpa_ctrl.c
  74. OBJS_c += src/utils/wpa_debug.c
  75. OBJS_c += src/utils/common.c
  76. OBJS_d =
  77. OBJS_priv =
  78. ifndef CONFIG_OS
  79. ifdef CONFIG_NATIVE_WINDOWS
  80. CONFIG_OS=win32
  81. else
  82. CONFIG_OS=unix
  83. endif
  84. endif
  85. ifeq ($(CONFIG_OS), internal)
  86. L_CFLAGS += -DOS_NO_C_LIB_DEFINES
  87. endif
  88. OBJS += src/utils/os_$(CONFIG_OS).c
  89. OBJS_p += src/utils/os_$(CONFIG_OS).c
  90. OBJS_c += src/utils/os_$(CONFIG_OS).c
  91. ifdef CONFIG_WPA_TRACE
  92. L_CFLAGS += -DWPA_TRACE
  93. OBJS += src/utils/trace.c
  94. OBJS_p += src/utils/trace.c
  95. OBJS_c += src/utils/trace.c
  96. LDFLAGS += -rdynamic
  97. L_CFLAGS += -funwind-tables
  98. ifdef CONFIG_WPA_TRACE_BFD
  99. L_CFLAGS += -DWPA_TRACE_BFD
  100. LIBS += -lbfd
  101. LIBS_p += -lbfd
  102. LIBS_c += -lbfd
  103. endif
  104. endif
  105. ifndef CONFIG_ELOOP
  106. CONFIG_ELOOP=eloop
  107. endif
  108. OBJS += src/utils/$(CONFIG_ELOOP).c
  109. OBJS_c += src/utils/$(CONFIG_ELOOP).c
  110. ifdef CONFIG_EAPOL_TEST
  111. L_CFLAGS += -Werror -DEAPOL_TEST
  112. endif
  113. ifndef CONFIG_BACKEND
  114. CONFIG_BACKEND=file
  115. endif
  116. ifeq ($(CONFIG_BACKEND), file)
  117. OBJS += config_file.c
  118. ifndef CONFIG_NO_CONFIG_BLOBS
  119. NEED_BASE64=y
  120. endif
  121. L_CFLAGS += -DCONFIG_BACKEND_FILE
  122. endif
  123. ifeq ($(CONFIG_BACKEND), winreg)
  124. OBJS += config_winreg.c
  125. endif
  126. ifeq ($(CONFIG_BACKEND), none)
  127. OBJS += config_none.c
  128. endif
  129. ifdef CONFIG_NO_CONFIG_WRITE
  130. L_CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  131. endif
  132. ifdef CONFIG_NO_CONFIG_BLOBS
  133. L_CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  134. endif
  135. ifdef CONFIG_NO_SCAN_PROCESSING
  136. L_CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  137. endif
  138. ifdef CONFIG_IEEE80211W
  139. L_CFLAGS += -DCONFIG_IEEE80211W
  140. NEED_SHA256=y
  141. NEED_AES_OMAC1=y
  142. endif
  143. ifdef CONFIG_IEEE80211R
  144. L_CFLAGS += -DCONFIG_IEEE80211R
  145. OBJS += src/rsn_supp/wpa_ft.c
  146. NEED_80211_COMMON=y
  147. NEED_SHA256=y
  148. NEED_AES_OMAC1=y
  149. endif
  150. ifdef CONFIG_SAE
  151. L_CFLAGS += -DCONFIG_SAE
  152. endif
  153. ifdef CONFIG_TDLS
  154. L_CFLAGS += -DCONFIG_TDLS
  155. OBJS += src/rsn_supp/tdls.c
  156. NEED_SHA256=y
  157. NEED_AES_OMAC1=y
  158. endif
  159. ifdef CONFIG_TDLS_TESTING
  160. L_CFLAGS += -DCONFIG_TDLS_TESTING
  161. endif
  162. ifdef CONFIG_PEERKEY
  163. L_CFLAGS += -DCONFIG_PEERKEY
  164. endif
  165. ifndef CONFIG_NO_WPA
  166. OBJS += src/rsn_supp/wpa.c
  167. OBJS += src/rsn_supp/preauth.c
  168. OBJS += src/rsn_supp/pmksa_cache.c
  169. OBJS += src/rsn_supp/peerkey.c
  170. OBJS += src/rsn_supp/wpa_ie.c
  171. OBJS += src/common/wpa_common.c
  172. NEED_AES=y
  173. NEED_SHA1=y
  174. NEED_MD5=y
  175. NEED_RC4=y
  176. else
  177. L_CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
  178. endif
  179. ifdef CONFIG_IBSS_RSN
  180. NEED_RSN_AUTHENTICATOR=y
  181. L_CFLAGS += -DCONFIG_IBSS_RSN
  182. OBJS += ibss_rsn.c
  183. endif
  184. ifdef CONFIG_P2P
  185. OBJS += p2p_supplicant.c
  186. OBJS += src/p2p/p2p.c
  187. OBJS += src/p2p/p2p_utils.c
  188. OBJS += src/p2p/p2p_parse.c
  189. OBJS += src/p2p/p2p_build.c
  190. OBJS += src/p2p/p2p_go_neg.c
  191. OBJS += src/p2p/p2p_sd.c
  192. OBJS += src/p2p/p2p_pd.c
  193. OBJS += src/p2p/p2p_invitation.c
  194. OBJS += src/p2p/p2p_dev_disc.c
  195. OBJS += src/p2p/p2p_group.c
  196. OBJS += src/ap/p2p_hostapd.c
  197. L_CFLAGS += -DCONFIG_P2P
  198. NEED_GAS=y
  199. NEED_OFFCHANNEL=y
  200. NEED_80211_COMMON=y
  201. CONFIG_WPS=y
  202. CONFIG_AP=y
  203. ifdef CONFIG_P2P_STRICT
  204. L_CFLAGS += -DCONFIG_P2P_STRICT
  205. endif
  206. endif
  207. ifdef CONFIG_WIFI_DISPLAY
  208. L_CFLAGS += -DCONFIG_WIFI_DISPLAY
  209. OBJS += wifi_display.c
  210. endif
  211. ifdef CONFIG_HS20
  212. OBJS += hs20_supplicant.c
  213. L_CFLAGS += -DCONFIG_HS20
  214. CONFIG_INTERWORKING=y
  215. endif
  216. ifdef CONFIG_INTERWORKING
  217. OBJS += interworking.c
  218. L_CFLAGS += -DCONFIG_INTERWORKING
  219. NEED_GAS=y
  220. endif
  221. ifdef CONFIG_NO_WPA2
  222. L_CFLAGS += -DCONFIG_NO_WPA2
  223. endif
  224. include $(LOCAL_PATH)/src/drivers/drivers.mk
  225. ifdef CONFIG_AP
  226. OBJS_d += $(DRV_BOTH_OBJS)
  227. L_CFLAGS += $(DRV_BOTH_CFLAGS)
  228. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  229. LIBS += $(DRV_BOTH_LIBS)
  230. else
  231. NEED_AP_MLME=
  232. OBJS_d += $(DRV_WPA_OBJS)
  233. L_CFLAGS += $(DRV_WPA_CFLAGS)
  234. LDFLAGS += $(DRV_WPA_LDFLAGS)
  235. LIBS += $(DRV_WPA_LIBS)
  236. endif
  237. ifndef CONFIG_L2_PACKET
  238. CONFIG_L2_PACKET=linux
  239. endif
  240. OBJS_l2 += src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).c
  241. ifeq ($(CONFIG_L2_PACKET), pcap)
  242. ifdef CONFIG_WINPCAP
  243. L_CFLAGS += -DCONFIG_WINPCAP
  244. LIBS += -lwpcap -lpacket
  245. LIBS_w += -lwpcap
  246. else
  247. LIBS += -ldnet -lpcap
  248. endif
  249. endif
  250. ifeq ($(CONFIG_L2_PACKET), winpcap)
  251. LIBS += -lwpcap -lpacket
  252. LIBS_w += -lwpcap
  253. endif
  254. ifeq ($(CONFIG_L2_PACKET), freebsd)
  255. LIBS += -lpcap
  256. endif
  257. ifdef CONFIG_EAP_TLS
  258. # EAP-TLS
  259. ifeq ($(CONFIG_EAP_TLS), dyn)
  260. L_CFLAGS += -DEAP_TLS_DYNAMIC
  261. EAPDYN += src/eap_peer/eap_tls.so
  262. else
  263. L_CFLAGS += -DEAP_TLS
  264. OBJS += src/eap_peer/eap_tls.c
  265. OBJS_h += src/eap_server/eap_server_tls.c
  266. endif
  267. TLS_FUNCS=y
  268. CONFIG_IEEE8021X_EAPOL=y
  269. endif
  270. ifdef CONFIG_EAP_PEAP
  271. # EAP-PEAP
  272. ifeq ($(CONFIG_EAP_PEAP), dyn)
  273. L_CFLAGS += -DEAP_PEAP_DYNAMIC
  274. EAPDYN += src/eap_peer/eap_peap.so
  275. else
  276. L_CFLAGS += -DEAP_PEAP
  277. OBJS += src/eap_peer/eap_peap.c
  278. OBJS += src/eap_common/eap_peap_common.c
  279. OBJS_h += src/eap_server/eap_server_peap.c
  280. endif
  281. TLS_FUNCS=y
  282. CONFIG_IEEE8021X_EAPOL=y
  283. endif
  284. ifdef CONFIG_EAP_TTLS
  285. # EAP-TTLS
  286. ifeq ($(CONFIG_EAP_TTLS), dyn)
  287. L_CFLAGS += -DEAP_TTLS_DYNAMIC
  288. EAPDYN += src/eap_peer/eap_ttls.so
  289. else
  290. L_CFLAGS += -DEAP_TTLS
  291. OBJS += src/eap_peer/eap_ttls.c
  292. OBJS_h += src/eap_server/eap_server_ttls.c
  293. endif
  294. MS_FUNCS=y
  295. TLS_FUNCS=y
  296. CHAP=y
  297. CONFIG_IEEE8021X_EAPOL=y
  298. endif
  299. ifdef CONFIG_EAP_MD5
  300. # EAP-MD5
  301. ifeq ($(CONFIG_EAP_MD5), dyn)
  302. L_CFLAGS += -DEAP_MD5_DYNAMIC
  303. EAPDYN += src/eap_peer/eap_md5.so
  304. else
  305. L_CFLAGS += -DEAP_MD5
  306. OBJS += src/eap_peer/eap_md5.c
  307. OBJS_h += src/eap_server/eap_server_md5.c
  308. endif
  309. CHAP=y
  310. CONFIG_IEEE8021X_EAPOL=y
  311. endif
  312. # backwards compatibility for old spelling
  313. ifdef CONFIG_MSCHAPV2
  314. ifndef CONFIG_EAP_MSCHAPV2
  315. CONFIG_EAP_MSCHAPV2=y
  316. endif
  317. endif
  318. ifdef CONFIG_EAP_MSCHAPV2
  319. # EAP-MSCHAPv2
  320. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  321. L_CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  322. EAPDYN += src/eap_peer/eap_mschapv2.so
  323. EAPDYN += src/eap_peer/mschapv2.so
  324. else
  325. L_CFLAGS += -DEAP_MSCHAPv2
  326. OBJS += src/eap_peer/eap_mschapv2.c
  327. OBJS += src/eap_peer/mschapv2.c
  328. OBJS_h += src/eap_server/eap_server_mschapv2.c
  329. endif
  330. MS_FUNCS=y
  331. CONFIG_IEEE8021X_EAPOL=y
  332. endif
  333. ifdef CONFIG_EAP_GTC
  334. # EAP-GTC
  335. ifeq ($(CONFIG_EAP_GTC), dyn)
  336. L_CFLAGS += -DEAP_GTC_DYNAMIC
  337. EAPDYN += src/eap_peer/eap_gtc.so
  338. else
  339. L_CFLAGS += -DEAP_GTC
  340. OBJS += src/eap_peer/eap_gtc.c
  341. OBJS_h += src/eap_server/eap_server_gtc.c
  342. endif
  343. CONFIG_IEEE8021X_EAPOL=y
  344. endif
  345. ifdef CONFIG_EAP_OTP
  346. # EAP-OTP
  347. ifeq ($(CONFIG_EAP_OTP), dyn)
  348. L_CFLAGS += -DEAP_OTP_DYNAMIC
  349. EAPDYN += src/eap_peer/eap_otp.so
  350. else
  351. L_CFLAGS += -DEAP_OTP
  352. OBJS += src/eap_peer/eap_otp.c
  353. endif
  354. CONFIG_IEEE8021X_EAPOL=y
  355. endif
  356. ifdef CONFIG_EAP_SIM
  357. # EAP-SIM
  358. ifeq ($(CONFIG_EAP_SIM), dyn)
  359. L_CFLAGS += -DEAP_SIM_DYNAMIC
  360. EAPDYN += src/eap_peer/eap_sim.so
  361. else
  362. L_CFLAGS += -DEAP_SIM
  363. OBJS += src/eap_peer/eap_sim.c
  364. OBJS_h += src/eap_server/eap_server_sim.c
  365. endif
  366. CONFIG_IEEE8021X_EAPOL=y
  367. CONFIG_EAP_SIM_COMMON=y
  368. NEED_AES_CBC=y
  369. endif
  370. ifdef CONFIG_EAP_LEAP
  371. # EAP-LEAP
  372. ifeq ($(CONFIG_EAP_LEAP), dyn)
  373. L_CFLAGS += -DEAP_LEAP_DYNAMIC
  374. EAPDYN += src/eap_peer/eap_leap.so
  375. else
  376. L_CFLAGS += -DEAP_LEAP
  377. OBJS += src/eap_peer/eap_leap.c
  378. endif
  379. MS_FUNCS=y
  380. CONFIG_IEEE8021X_EAPOL=y
  381. endif
  382. ifdef CONFIG_EAP_PSK
  383. # EAP-PSK
  384. ifeq ($(CONFIG_EAP_PSK), dyn)
  385. L_CFLAGS += -DEAP_PSK_DYNAMIC
  386. EAPDYN += src/eap_peer/eap_psk.so
  387. else
  388. L_CFLAGS += -DEAP_PSK
  389. OBJS += src/eap_peer/eap_psk.c src/eap_common/eap_psk_common.c
  390. OBJS_h += src/eap_server/eap_server_psk.c
  391. endif
  392. CONFIG_IEEE8021X_EAPOL=y
  393. NEED_AES=y
  394. NEED_AES_OMAC1=y
  395. NEED_AES_ENCBLOCK=y
  396. NEED_AES_EAX=y
  397. endif
  398. ifdef CONFIG_EAP_AKA
  399. # EAP-AKA
  400. ifeq ($(CONFIG_EAP_AKA), dyn)
  401. L_CFLAGS += -DEAP_AKA_DYNAMIC
  402. EAPDYN += src/eap_peer/eap_aka.so
  403. else
  404. L_CFLAGS += -DEAP_AKA
  405. OBJS += src/eap_peer/eap_aka.c
  406. OBJS_h += src/eap_server/eap_server_aka.c
  407. endif
  408. CONFIG_IEEE8021X_EAPOL=y
  409. CONFIG_EAP_SIM_COMMON=y
  410. NEED_AES_CBC=y
  411. endif
  412. ifdef CONFIG_EAP_AKA_PRIME
  413. # EAP-AKA'
  414. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  415. L_CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  416. else
  417. L_CFLAGS += -DEAP_AKA_PRIME
  418. endif
  419. NEED_SHA256=y
  420. endif
  421. ifdef CONFIG_EAP_SIM_COMMON
  422. OBJS += src/eap_common/eap_sim_common.c
  423. OBJS_h += src/eap_server/eap_sim_db.c
  424. NEED_AES=y
  425. NEED_FIPS186_2_PRF=y
  426. endif
  427. ifdef CONFIG_EAP_FAST
  428. # EAP-FAST
  429. ifeq ($(CONFIG_EAP_FAST), dyn)
  430. L_CFLAGS += -DEAP_FAST_DYNAMIC
  431. EAPDYN += src/eap_peer/eap_fast.so
  432. EAPDYN += src/eap_common/eap_fast_common.c
  433. else
  434. L_CFLAGS += -DEAP_FAST
  435. OBJS += src/eap_peer/eap_fast.c src/eap_peer/eap_fast_pac.c
  436. OBJS += src/eap_common/eap_fast_common.c
  437. OBJS_h += src/eap_server/eap_server_fast.c
  438. endif
  439. TLS_FUNCS=y
  440. CONFIG_IEEE8021X_EAPOL=y
  441. NEED_T_PRF=y
  442. endif
  443. ifdef CONFIG_EAP_PAX
  444. # EAP-PAX
  445. ifeq ($(CONFIG_EAP_PAX), dyn)
  446. L_CFLAGS += -DEAP_PAX_DYNAMIC
  447. EAPDYN += src/eap_peer/eap_pax.so
  448. else
  449. L_CFLAGS += -DEAP_PAX
  450. OBJS += src/eap_peer/eap_pax.c src/eap_common/eap_pax_common.c
  451. OBJS_h += src/eap_server/eap_server_pax.c
  452. endif
  453. CONFIG_IEEE8021X_EAPOL=y
  454. endif
  455. ifdef CONFIG_EAP_SAKE
  456. # EAP-SAKE
  457. ifeq ($(CONFIG_EAP_SAKE), dyn)
  458. L_CFLAGS += -DEAP_SAKE_DYNAMIC
  459. EAPDYN += src/eap_peer/eap_sake.so
  460. else
  461. L_CFLAGS += -DEAP_SAKE
  462. OBJS += src/eap_peer/eap_sake.c src/eap_common/eap_sake_common.c
  463. OBJS_h += src/eap_server/eap_server_sake.c
  464. endif
  465. CONFIG_IEEE8021X_EAPOL=y
  466. endif
  467. ifdef CONFIG_EAP_GPSK
  468. # EAP-GPSK
  469. ifeq ($(CONFIG_EAP_GPSK), dyn)
  470. L_CFLAGS += -DEAP_GPSK_DYNAMIC
  471. EAPDYN += src/eap_peer/eap_gpsk.so
  472. else
  473. L_CFLAGS += -DEAP_GPSK
  474. OBJS += src/eap_peer/eap_gpsk.c src/eap_common/eap_gpsk_common.c
  475. OBJS_h += src/eap_server/eap_server_gpsk.c
  476. endif
  477. CONFIG_IEEE8021X_EAPOL=y
  478. ifdef CONFIG_EAP_GPSK_SHA256
  479. L_CFLAGS += -DEAP_GPSK_SHA256
  480. endif
  481. NEED_SHA256=y
  482. NEED_AES_OMAC1=y
  483. endif
  484. ifdef CONFIG_EAP_PWD
  485. L_CFLAGS += -DEAP_PWD
  486. OBJS += src/eap_peer/eap_pwd.c src/eap_common/eap_pwd_common.c
  487. OBJS_h += src/eap_server/eap_pwd.c
  488. CONFIG_IEEE8021X_EAPOL=y
  489. NEED_SHA256=y
  490. endif
  491. ifdef CONFIG_WPS
  492. ifdef CONFIG_WPS2
  493. L_CFLAGS += -DCONFIG_WPS2
  494. endif
  495. # EAP-WSC
  496. L_CFLAGS += -DCONFIG_WPS -DEAP_WSC
  497. OBJS += wps_supplicant.c
  498. OBJS += src/utils/uuid.c
  499. OBJS += src/eap_peer/eap_wsc.c src/eap_common/eap_wsc_common.c
  500. OBJS += src/wps/wps.c
  501. OBJS += src/wps/wps_common.c
  502. OBJS += src/wps/wps_attr_parse.c
  503. OBJS += src/wps/wps_attr_build.c
  504. OBJS += src/wps/wps_attr_process.c
  505. OBJS += src/wps/wps_dev_attr.c
  506. OBJS += src/wps/wps_enrollee.c
  507. OBJS += src/wps/wps_registrar.c
  508. OBJS_h += src/eap_server/eap_server_wsc.c
  509. CONFIG_IEEE8021X_EAPOL=y
  510. NEED_DH_GROUPS=y
  511. NEED_SHA256=y
  512. NEED_BASE64=y
  513. NEED_80211_COMMON=y
  514. NEED_AES_CBC=y
  515. NEED_MODEXP=y
  516. ifdef CONFIG_WPS_NFC
  517. L_CFLAGS += -DCONFIG_WPS_NFC
  518. OBJS += src/wps/ndef.c
  519. NEED_WPS_OOB=y
  520. endif
  521. ifdef NEED_WPS_OOB
  522. L_CFLAGS += -DCONFIG_WPS_OOB
  523. endif
  524. ifdef CONFIG_WPS_ER
  525. CONFIG_WPS_UPNP=y
  526. L_CFLAGS += -DCONFIG_WPS_ER
  527. OBJS += src/wps/wps_er.c
  528. OBJS += src/wps/wps_er_ssdp.c
  529. endif
  530. ifdef CONFIG_WPS_UPNP
  531. L_CFLAGS += -DCONFIG_WPS_UPNP
  532. OBJS += src/wps/wps_upnp.c
  533. OBJS += src/wps/wps_upnp_ssdp.c
  534. OBJS += src/wps/wps_upnp_web.c
  535. OBJS += src/wps/wps_upnp_event.c
  536. OBJS += src/wps/wps_upnp_ap.c
  537. OBJS += src/wps/upnp_xml.c
  538. OBJS += src/wps/httpread.c
  539. OBJS += src/wps/http_client.c
  540. OBJS += src/wps/http_server.c
  541. endif
  542. ifdef CONFIG_WPS_STRICT
  543. L_CFLAGS += -DCONFIG_WPS_STRICT
  544. OBJS += src/wps/wps_validate.c
  545. endif
  546. ifdef CONFIG_WPS_TESTING
  547. L_CFLAGS += -DCONFIG_WPS_TESTING
  548. endif
  549. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  550. L_CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  551. endif
  552. endif
  553. ifdef CONFIG_EAP_IKEV2
  554. # EAP-IKEv2
  555. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  556. L_CFLAGS += -DEAP_IKEV2_DYNAMIC
  557. EAPDYN += src/eap_peer/eap_ikev2.so src/eap_peer/ikev2.c
  558. EAPDYN += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  559. else
  560. L_CFLAGS += -DEAP_IKEV2
  561. OBJS += src/eap_peer/eap_ikev2.c src/eap_peer/ikev2.c
  562. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  563. OBJS_h += src/eap_server/eap_server_ikev2.c
  564. OBJS_h += src/eap_server/ikev2.c
  565. endif
  566. CONFIG_IEEE8021X_EAPOL=y
  567. NEED_DH_GROUPS=y
  568. NEED_DH_GROUPS_ALL=y
  569. NEED_MODEXP=y
  570. NEED_CIPHER=y
  571. endif
  572. ifdef CONFIG_EAP_VENDOR_TEST
  573. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  574. L_CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  575. EAPDYN += src/eap_peer/eap_vendor_test.so
  576. else
  577. L_CFLAGS += -DEAP_VENDOR_TEST
  578. OBJS += src/eap_peer/eap_vendor_test.c
  579. OBJS_h += src/eap_server/eap_server_vendor_test.c
  580. endif
  581. CONFIG_IEEE8021X_EAPOL=y
  582. endif
  583. ifdef CONFIG_EAP_TNC
  584. # EAP-TNC
  585. L_CFLAGS += -DEAP_TNC
  586. OBJS += src/eap_peer/eap_tnc.c
  587. OBJS += src/eap_peer/tncc.c
  588. OBJS_h += src/eap_server/eap_server_tnc.c
  589. OBJS_h += src/eap_server/tncs.c
  590. NEED_BASE64=y
  591. ifndef CONFIG_NATIVE_WINDOWS
  592. ifndef CONFIG_DRIVER_BSD
  593. LIBS += -ldl
  594. endif
  595. endif
  596. endif
  597. ifdef CONFIG_IEEE8021X_EAPOL
  598. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  599. L_CFLAGS += -DIEEE8021X_EAPOL
  600. OBJS += src/eapol_supp/eapol_supp_sm.c
  601. OBJS += src/eap_peer/eap.c src/eap_peer/eap_methods.c
  602. NEED_EAP_COMMON=y
  603. ifdef CONFIG_DYNAMIC_EAP_METHODS
  604. L_CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  605. LIBS += -ldl -rdynamic
  606. endif
  607. endif
  608. ifdef CONFIG_AP
  609. NEED_80211_COMMON=y
  610. NEED_EAP_COMMON=y
  611. NEED_RSN_AUTHENTICATOR=y
  612. L_CFLAGS += -DCONFIG_AP
  613. OBJS += ap.c
  614. L_CFLAGS += -DCONFIG_NO_RADIUS
  615. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  616. L_CFLAGS += -DCONFIG_NO_VLAN
  617. OBJS += src/ap/hostapd.c
  618. OBJS += src/ap/wpa_auth_glue.c
  619. OBJS += src/ap/utils.c
  620. OBJS += src/ap/authsrv.c
  621. OBJS += src/ap/ap_config.c
  622. OBJS += src/utils/ip_addr.c
  623. OBJS += src/ap/sta_info.c
  624. OBJS += src/ap/tkip_countermeasures.c
  625. OBJS += src/ap/ap_mlme.c
  626. OBJS += src/ap/ieee802_1x.c
  627. OBJS += src/eapol_auth/eapol_auth_sm.c
  628. OBJS += src/ap/ieee802_11_auth.c
  629. OBJS += src/ap/ieee802_11_shared.c
  630. OBJS += src/ap/drv_callbacks.c
  631. OBJS += src/ap/ap_drv_ops.c
  632. OBJS += src/ap/beacon.c
  633. ifdef CONFIG_IEEE80211N
  634. OBJS += src/ap/ieee802_11_ht.c
  635. endif
  636. ifdef CONFIG_CTRL_IFACE
  637. OBJS += src/ap/ctrl_iface_ap.c
  638. endif
  639. L_CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  640. OBJS += src/eap_server/eap_server.c
  641. OBJS += src/eap_server/eap_server_identity.c
  642. OBJS += src/eap_server/eap_server_methods.c
  643. ifdef CONFIG_IEEE80211N
  644. L_CFLAGS += -DCONFIG_IEEE80211N
  645. endif
  646. ifdef NEED_AP_MLME
  647. OBJS += src/ap/wmm.c
  648. OBJS += src/ap/ap_list.c
  649. OBJS += src/ap/ieee802_11.c
  650. OBJS += src/ap/hw_features.c
  651. L_CFLAGS += -DNEED_AP_MLME
  652. endif
  653. ifdef CONFIG_WPS
  654. L_CFLAGS += -DEAP_SERVER_WSC
  655. OBJS += src/ap/wps_hostapd.c
  656. OBJS += src/eap_server/eap_server_wsc.c
  657. endif
  658. ifdef CONFIG_INTERWORKING
  659. OBJS += src/ap/gas_serv.c
  660. endif
  661. ifdef CONFIG_HS20
  662. OBJS += src/ap/hs20.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. ifdef CONFIG_OPENSSL_CMAC
  937. CFLAGS += -DCONFIG_OPENSSL_CMAC
  938. else
  939. AESOBJS += src/crypto/aes-omac1.c
  940. endif
  941. endif
  942. ifdef NEED_AES_WRAP
  943. NEED_AES_ENC=y
  944. AESOBJS += src/crypto/aes-wrap.c
  945. endif
  946. ifdef NEED_AES_CBC
  947. NEED_AES_ENC=y
  948. AESOBJS += src/crypto/aes-cbc.c
  949. endif
  950. ifdef NEED_AES_ENC
  951. ifdef CONFIG_INTERNAL_AES
  952. AESOBJS += src/crypto/aes-internal-enc.c
  953. endif
  954. endif
  955. ifdef NEED_AES
  956. OBJS += $(AESOBJS)
  957. endif
  958. SHA1OBJS =
  959. ifdef NEED_SHA1
  960. ifneq ($(CONFIG_TLS), openssl)
  961. SHA1OBJS += src/crypto/sha1.c
  962. endif
  963. SHA1OBJS += src/crypto/sha1-prf.c
  964. ifdef CONFIG_INTERNAL_SHA1
  965. SHA1OBJS += src/crypto/sha1-internal.c
  966. ifdef NEED_FIPS186_2_PRF
  967. SHA1OBJS += src/crypto/fips_prf_internal.c
  968. endif
  969. endif
  970. ifdef CONFIG_NO_WPA_PASSPHRASE
  971. L_CFLAGS += -DCONFIG_NO_PBKDF2
  972. else
  973. ifneq ($(CONFIG_TLS), openssl)
  974. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  975. endif
  976. endif
  977. ifdef NEED_T_PRF
  978. SHA1OBJS += src/crypto/sha1-tprf.c
  979. endif
  980. ifdef NEED_TLS_PRF
  981. SHA1OBJS += src/crypto/sha1-tlsprf.c
  982. endif
  983. endif
  984. MD5OBJS = src/crypto/md5.c
  985. ifdef NEED_MD5
  986. ifdef CONFIG_INTERNAL_MD5
  987. MD5OBJS += src/crypto/md5-internal.c
  988. endif
  989. OBJS += $(MD5OBJS)
  990. OBJS_p += $(MD5OBJS)
  991. endif
  992. ifdef NEED_MD4
  993. ifdef CONFIG_INTERNAL_MD4
  994. OBJS += src/crypto/md4-internal.c
  995. endif
  996. endif
  997. DESOBJS = # none needed when not internal
  998. ifdef NEED_DES
  999. ifdef CONFIG_INTERNAL_DES
  1000. DESOBJS += src/crypto/des-internal.c
  1001. endif
  1002. endif
  1003. ifdef NEED_RC4
  1004. ifdef CONFIG_INTERNAL_RC4
  1005. OBJS += src/crypto/rc4.c
  1006. endif
  1007. endif
  1008. SHA256OBJS = # none by default
  1009. ifdef NEED_SHA256
  1010. L_CFLAGS += -DCONFIG_SHA256
  1011. ifneq ($(CONFIG_TLS), openssl)
  1012. SHA256OBJS += src/crypto/sha256.c
  1013. endif
  1014. SHA256OBJS += src/crypto/sha256-prf.c
  1015. ifdef CONFIG_INTERNAL_SHA256
  1016. SHA256OBJS += src/crypto/sha256-internal.c
  1017. endif
  1018. OBJS += $(SHA256OBJS)
  1019. endif
  1020. ifdef NEED_DH_GROUPS
  1021. OBJS += src/crypto/dh_groups.c
  1022. endif
  1023. ifdef NEED_DH_GROUPS_ALL
  1024. L_CFLAGS += -DALL_DH_GROUPS
  1025. endif
  1026. ifdef CONFIG_INTERNAL_DH_GROUP5
  1027. ifdef NEED_DH_GROUPS
  1028. OBJS += src/crypto/dh_group5.c
  1029. endif
  1030. endif
  1031. ifdef CONFIG_NO_RANDOM_POOL
  1032. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1033. else
  1034. OBJS += src/crypto/random.c
  1035. endif
  1036. ifdef CONFIG_CTRL_IFACE
  1037. ifeq ($(CONFIG_CTRL_IFACE), y)
  1038. ifdef CONFIG_NATIVE_WINDOWS
  1039. CONFIG_CTRL_IFACE=named_pipe
  1040. else
  1041. CONFIG_CTRL_IFACE=unix
  1042. endif
  1043. endif
  1044. L_CFLAGS += -DCONFIG_CTRL_IFACE
  1045. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1046. L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1047. endif
  1048. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1049. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1050. endif
  1051. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1052. L_CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1053. endif
  1054. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1055. CONFIG_CTRL_IFACE=udp
  1056. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1057. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1058. endif
  1059. OBJS += ctrl_iface.c ctrl_iface_$(CONFIG_CTRL_IFACE).c
  1060. endif
  1061. ifdef CONFIG_CTRL_IFACE_DBUS
  1062. DBUS=y
  1063. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1064. DBUS_OBJS += dbus/dbus_old.c dbus/dbus_old_handlers.c
  1065. ifdef CONFIG_WPS
  1066. DBUS_OBJS += dbus/dbus_old_handlers_wps.c
  1067. endif
  1068. DBUS_OBJS += dbus/dbus_dict_helpers.c
  1069. ifndef DBUS_LIBS
  1070. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1071. endif
  1072. ifndef DBUS_INCLUDE
  1073. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1074. endif
  1075. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1076. endif
  1077. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1078. DBUS=y
  1079. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1080. DBUS_OBJS ?= dbus/dbus_dict_helpers.c
  1081. DBUS_OBJS += dbus/dbus_new_helpers.c
  1082. DBUS_OBJS += dbus/dbus_new.c dbus/dbus_new_handlers.c
  1083. ifdef CONFIG_WPS
  1084. DBUS_OBJS += dbus/dbus_new_handlers_wps.c
  1085. endif
  1086. ifdef CONFIG_P2P
  1087. DBUS_OBJS += dbus/dbus_new_handlers_p2p.c
  1088. endif
  1089. ifndef DBUS_LIBS
  1090. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1091. endif
  1092. ifndef DBUS_INCLUDE
  1093. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1094. endif
  1095. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1096. DBUS_OBJS += dbus/dbus_new_introspect.c
  1097. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1098. endif
  1099. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1100. endif
  1101. ifdef DBUS
  1102. DBUS_CFLAGS += -DCONFIG_DBUS
  1103. DBUS_OBJS += dbus/dbus_common.c
  1104. endif
  1105. OBJS += $(DBUS_OBJS)
  1106. L_CFLAGS += $(DBUS_CFLAGS)
  1107. LIBS += $(DBUS_LIBS)
  1108. ifdef CONFIG_READLINE
  1109. OBJS_c += src/utils/edit_readline.c
  1110. LIBS_c += -lncurses -lreadline
  1111. else
  1112. ifdef CONFIG_WPA_CLI_EDIT
  1113. OBJS_c += src/utils/edit.c
  1114. else
  1115. OBJS_c += src/utils/edit_simple.c
  1116. endif
  1117. endif
  1118. ifdef CONFIG_NATIVE_WINDOWS
  1119. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1120. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1121. LIBS_c += -lws2_32
  1122. LIBS_p += -lws2_32 -lgdi32
  1123. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1124. LIBS_p += -lcrypt32
  1125. endif
  1126. endif
  1127. ifdef CONFIG_NO_STDOUT_DEBUG
  1128. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1129. ifndef CONFIG_CTRL_IFACE
  1130. L_CFLAGS += -DCONFIG_NO_WPA_MSG
  1131. endif
  1132. endif
  1133. ifdef CONFIG_ANDROID_LOG
  1134. L_CFLAGS += -DCONFIG_ANDROID_LOG
  1135. endif
  1136. ifdef CONFIG_IPV6
  1137. # for eapol_test only
  1138. L_CFLAGS += -DCONFIG_IPV6
  1139. endif
  1140. ifdef NEED_BASE64
  1141. OBJS += src/utils/base64.c
  1142. endif
  1143. ifdef NEED_SME
  1144. NEED_80211_COMMON=y
  1145. OBJS += sme.c
  1146. L_CFLAGS += -DCONFIG_SME
  1147. endif
  1148. ifdef NEED_80211_COMMON
  1149. OBJS += src/common/ieee802_11_common.c
  1150. endif
  1151. ifdef NEED_EAP_COMMON
  1152. OBJS += src/eap_common/eap_common.c
  1153. endif
  1154. ifndef CONFIG_MAIN
  1155. CONFIG_MAIN=main
  1156. endif
  1157. ifdef CONFIG_DEBUG_SYSLOG
  1158. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1159. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1160. L_CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1161. endif
  1162. endif
  1163. ifdef CONFIG_DEBUG_FILE
  1164. L_CFLAGS += -DCONFIG_DEBUG_FILE
  1165. endif
  1166. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1167. L_CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1168. endif
  1169. ifdef CONFIG_FIPS
  1170. L_CFLAGS += -DCONFIG_FIPS
  1171. endif
  1172. OBJS += $(SHA1OBJS) $(DESOBJS)
  1173. OBJS_p += $(SHA1OBJS)
  1174. ifdef CONFIG_BGSCAN_SIMPLE
  1175. L_CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1176. OBJS += bgscan_simple.c
  1177. NEED_BGSCAN=y
  1178. endif
  1179. ifdef CONFIG_BGSCAN_LEARN
  1180. L_CFLAGS += -DCONFIG_BGSCAN_LEARN
  1181. OBJS += bgscan_learn.c
  1182. NEED_BGSCAN=y
  1183. endif
  1184. ifdef NEED_BGSCAN
  1185. L_CFLAGS += -DCONFIG_BGSCAN
  1186. OBJS += bgscan.c
  1187. endif
  1188. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1189. L_CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1190. OBJS += autoscan_exponential.c
  1191. NEED_AUTOSCAN=y
  1192. endif
  1193. ifdef CONFIG_AUTOSCAN_PERIODIC
  1194. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1195. OBJS += autoscan_periodic.c
  1196. NEED_AUTOSCAN=y
  1197. endif
  1198. ifdef NEED_AUTOSCAN
  1199. L_CFLAGS += -DCONFIG_AUTOSCAN
  1200. OBJS += autoscan.c
  1201. endif
  1202. ifdef CONFIG_EXT_PASSWORD_TEST
  1203. OBJS += ../src/utils/ext_password_test.c
  1204. L_CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1205. NEED_EXT_PASSWORD=y
  1206. endif
  1207. ifdef NEED_EXT_PASSWORD
  1208. OBJS += ../src/utils/ext_password.c
  1209. L_CFLAGS += -DCONFIG_EXT_PASSWORD
  1210. endif
  1211. ifdef NEED_GAS
  1212. OBJS += ../src/common/gas.c
  1213. OBJS += gas_query.c
  1214. L_CFLAGS += -DCONFIG_GAS
  1215. NEED_OFFCHANNEL=y
  1216. endif
  1217. ifdef NEED_OFFCHANNEL
  1218. OBJS += offchannel.c
  1219. L_CFLAGS += -DCONFIG_OFFCHANNEL
  1220. endif
  1221. OBJS += src/drivers/driver_common.c
  1222. OBJS_wpa_rm := ctrl_iface.c ctrl_iface_unix.c
  1223. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.c
  1224. ifdef CONFIG_AUTHENTICATOR
  1225. OBJS_wpa += tests/link_test.c
  1226. endif
  1227. OBJS_wpa += $(OBJS_l2)
  1228. OBJS += wpa_supplicant.c events.c blacklist.c wpas_glue.c scan.c
  1229. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.c
  1230. OBJS_t += src/radius/radius_client.c
  1231. OBJS_t += src/radius/radius.c
  1232. ifndef CONFIG_AP
  1233. OBJS_t += src/utils/ip_addr.c
  1234. endif
  1235. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.c
  1236. OBJS += $(CONFIG_MAIN).c
  1237. ifdef CONFIG_PRIVSEP
  1238. OBJS_priv += $(OBJS_d) src/drivers/drivers.c
  1239. OBJS_priv += $(OBJS_l2)
  1240. OBJS_priv += src/utils/os_$(CONFIG_OS).c
  1241. OBJS_priv += src/utils/$(CONFIG_ELOOP).c
  1242. OBJS_priv += src/utils/common.c
  1243. OBJS_priv += src/utils/wpa_debug.c
  1244. OBJS_priv += src/utils/wpabuf.c
  1245. OBJS_priv += wpa_priv.c
  1246. ifdef CONFIG_DRIVER_TEST
  1247. OBJS_priv += $(SHA1OBJS)
  1248. OBJS_priv += $(MD5OBJS)
  1249. ifeq ($(CONFIG_TLS), openssl)
  1250. OBJS_priv += src/crypto/crypto_openssl.c
  1251. endif
  1252. ifeq ($(CONFIG_TLS), gnutls)
  1253. OBJS_priv += src/crypto/crypto_gnutls.c
  1254. endif
  1255. ifeq ($(CONFIG_TLS), nss)
  1256. OBJS_priv += src/crypto/crypto_nss.c
  1257. endif
  1258. ifeq ($(CONFIG_TLS), internal)
  1259. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  1260. OBJS_priv += src/crypto/crypto_libtomcrypt.c
  1261. else
  1262. OBJS_priv += src/crypto/crypto_internal.c
  1263. endif
  1264. endif
  1265. endif # CONFIG_DRIVER_TEST
  1266. OBJS += src/l2_packet/l2_packet_privsep.c
  1267. OBJS += src/drivers/driver_privsep.c
  1268. EXTRA_progs += wpa_priv
  1269. else
  1270. OBJS += $(OBJS_d) src/drivers/drivers.c
  1271. OBJS += $(OBJS_l2)
  1272. endif
  1273. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1274. L_CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1275. OBJS += src/drivers/ndis_events.c
  1276. EXTRALIBS += -loleaut32 -lole32 -luuid
  1277. ifdef PLATFORMSDKLIB
  1278. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1279. else
  1280. EXTRALIBS += WbemUuid.Lib
  1281. endif
  1282. endif
  1283. ifndef LDO
  1284. LDO=$(CC)
  1285. endif
  1286. ########################
  1287. include $(CLEAR_VARS)
  1288. LOCAL_MODULE := wpa_cli
  1289. LOCAL_MODULE_TAGS := debug
  1290. LOCAL_SHARED_LIBRARIES := libc libcutils
  1291. LOCAL_CFLAGS := $(L_CFLAGS)
  1292. LOCAL_SRC_FILES := $(OBJS_c)
  1293. LOCAL_C_INCLUDES := $(INCLUDES)
  1294. include $(BUILD_EXECUTABLE)
  1295. ########################
  1296. include $(CLEAR_VARS)
  1297. LOCAL_MODULE := wpa_supplicant
  1298. ifdef CONFIG_DRIVER_CUSTOM
  1299. LOCAL_STATIC_LIBRARIES := libCustomWifi
  1300. endif
  1301. ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
  1302. LOCAL_STATIC_LIBRARIES += $(BOARD_WPA_SUPPLICANT_PRIVATE_LIB)
  1303. endif
  1304. LOCAL_SHARED_LIBRARIES := libc libcutils
  1305. ifeq ($(CONFIG_TLS), openssl)
  1306. LOCAL_SHARED_LIBRARIES += libcrypto libssl
  1307. endif
  1308. ifdef CONFIG_DRIVER_NL80211
  1309. LOCAL_STATIC_LIBRARIES += libnl_2
  1310. endif
  1311. LOCAL_CFLAGS := $(L_CFLAGS)
  1312. LOCAL_SRC_FILES := $(OBJS)
  1313. LOCAL_C_INCLUDES := $(INCLUDES)
  1314. include $(BUILD_EXECUTABLE)
  1315. ########################
  1316. #
  1317. #include $(CLEAR_VARS)
  1318. #LOCAL_MODULE := eapol_test
  1319. #ifdef CONFIG_DRIVER_CUSTOM
  1320. #LOCAL_STATIC_LIBRARIES := libCustomWifi
  1321. #endif
  1322. #LOCAL_SHARED_LIBRARIES := libc libcrypto libssl
  1323. #LOCAL_CFLAGS := $(L_CFLAGS)
  1324. #LOCAL_SRC_FILES := $(OBJS_t)
  1325. #LOCAL_C_INCLUDES := $(INCLUDES)
  1326. #include $(BUILD_EXECUTABLE)
  1327. #
  1328. ########################
  1329. #
  1330. #local_target_dir := $(TARGET_OUT)/etc/wifi
  1331. #
  1332. #include $(CLEAR_VARS)
  1333. #LOCAL_MODULE := wpa_supplicant.conf
  1334. #LOCAL_MODULE_TAGS := user
  1335. #LOCAL_MODULE_CLASS := ETC
  1336. #LOCAL_MODULE_PATH := $(local_target_dir)
  1337. #LOCAL_SRC_FILES := $(LOCAL_MODULE)
  1338. #include $(BUILD_PREBUILT)
  1339. #
  1340. ########################
  1341. endif # ifeq ($(WPA_BUILD_SUPPLICANT),true)
  1342. include $(CLEAR_VARS)
  1343. LOCAL_MODULE = libwpa_client
  1344. LOCAL_CFLAGS = $(L_CFLAGS)
  1345. LOCAL_SRC_FILES = src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
  1346. LOCAL_C_INCLUDES = $(INCLUDES)
  1347. LOCAL_SHARED_LIBRARIES := libcutils
  1348. LOCAL_COPY_HEADERS_TO := libwpa_client
  1349. LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
  1350. include $(BUILD_SHARED_LIBRARY)