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_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_UFD
  517. L_CFLAGS += -DCONFIG_WPS_UFD
  518. OBJS += src/wps/wps_ufd.c
  519. NEED_WPS_OOB=y
  520. endif
  521. ifdef CONFIG_WPS_NFC
  522. L_CFLAGS += -DCONFIG_WPS_NFC
  523. OBJS += src/wps/ndef.c
  524. NEED_WPS_OOB=y
  525. endif
  526. ifdef NEED_WPS_OOB
  527. L_CFLAGS += -DCONFIG_WPS_OOB
  528. endif
  529. ifdef CONFIG_WPS_ER
  530. CONFIG_WPS_UPNP=y
  531. L_CFLAGS += -DCONFIG_WPS_ER
  532. OBJS += src/wps/wps_er.c
  533. OBJS += src/wps/wps_er_ssdp.c
  534. endif
  535. ifdef CONFIG_WPS_UPNP
  536. L_CFLAGS += -DCONFIG_WPS_UPNP
  537. OBJS += src/wps/wps_upnp.c
  538. OBJS += src/wps/wps_upnp_ssdp.c
  539. OBJS += src/wps/wps_upnp_web.c
  540. OBJS += src/wps/wps_upnp_event.c
  541. OBJS += src/wps/wps_upnp_ap.c
  542. OBJS += src/wps/upnp_xml.c
  543. OBJS += src/wps/httpread.c
  544. OBJS += src/wps/http_client.c
  545. OBJS += src/wps/http_server.c
  546. endif
  547. ifdef CONFIG_WPS_STRICT
  548. L_CFLAGS += -DCONFIG_WPS_STRICT
  549. OBJS += src/wps/wps_validate.c
  550. endif
  551. ifdef CONFIG_WPS_TESTING
  552. L_CFLAGS += -DCONFIG_WPS_TESTING
  553. endif
  554. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  555. L_CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  556. endif
  557. endif
  558. ifdef CONFIG_EAP_IKEV2
  559. # EAP-IKEv2
  560. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  561. L_CFLAGS += -DEAP_IKEV2_DYNAMIC
  562. EAPDYN += src/eap_peer/eap_ikev2.so src/eap_peer/ikev2.c
  563. EAPDYN += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  564. else
  565. L_CFLAGS += -DEAP_IKEV2
  566. OBJS += src/eap_peer/eap_ikev2.c src/eap_peer/ikev2.c
  567. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  568. OBJS_h += src/eap_server/eap_server_ikev2.c
  569. OBJS_h += src/eap_server/ikev2.c
  570. endif
  571. CONFIG_IEEE8021X_EAPOL=y
  572. NEED_DH_GROUPS=y
  573. NEED_DH_GROUPS_ALL=y
  574. NEED_MODEXP=y
  575. NEED_CIPHER=y
  576. endif
  577. ifdef CONFIG_EAP_VENDOR_TEST
  578. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  579. L_CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  580. EAPDYN += src/eap_peer/eap_vendor_test.so
  581. else
  582. L_CFLAGS += -DEAP_VENDOR_TEST
  583. OBJS += src/eap_peer/eap_vendor_test.c
  584. OBJS_h += src/eap_server/eap_server_vendor_test.c
  585. endif
  586. CONFIG_IEEE8021X_EAPOL=y
  587. endif
  588. ifdef CONFIG_EAP_TNC
  589. # EAP-TNC
  590. L_CFLAGS += -DEAP_TNC
  591. OBJS += src/eap_peer/eap_tnc.c
  592. OBJS += src/eap_peer/tncc.c
  593. OBJS_h += src/eap_server/eap_server_tnc.c
  594. OBJS_h += src/eap_server/tncs.c
  595. NEED_BASE64=y
  596. ifndef CONFIG_NATIVE_WINDOWS
  597. ifndef CONFIG_DRIVER_BSD
  598. LIBS += -ldl
  599. endif
  600. endif
  601. endif
  602. ifdef CONFIG_IEEE8021X_EAPOL
  603. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  604. L_CFLAGS += -DIEEE8021X_EAPOL
  605. OBJS += src/eapol_supp/eapol_supp_sm.c
  606. OBJS += src/eap_peer/eap.c src/eap_peer/eap_methods.c
  607. NEED_EAP_COMMON=y
  608. ifdef CONFIG_DYNAMIC_EAP_METHODS
  609. L_CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  610. LIBS += -ldl -rdynamic
  611. endif
  612. endif
  613. ifdef CONFIG_AP
  614. NEED_80211_COMMON=y
  615. NEED_EAP_COMMON=y
  616. NEED_RSN_AUTHENTICATOR=y
  617. L_CFLAGS += -DCONFIG_AP
  618. OBJS += ap.c
  619. L_CFLAGS += -DCONFIG_NO_RADIUS
  620. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  621. L_CFLAGS += -DCONFIG_NO_VLAN
  622. OBJS += src/ap/hostapd.c
  623. OBJS += src/ap/wpa_auth_glue.c
  624. OBJS += src/ap/utils.c
  625. OBJS += src/ap/authsrv.c
  626. OBJS += src/ap/ap_config.c
  627. OBJS += src/utils/ip_addr.c
  628. OBJS += src/ap/sta_info.c
  629. OBJS += src/ap/tkip_countermeasures.c
  630. OBJS += src/ap/ap_mlme.c
  631. OBJS += src/ap/ieee802_1x.c
  632. OBJS += src/eapol_auth/eapol_auth_sm.c
  633. OBJS += src/ap/ieee802_11_auth.c
  634. OBJS += src/ap/ieee802_11_shared.c
  635. OBJS += src/ap/drv_callbacks.c
  636. OBJS += src/ap/ap_drv_ops.c
  637. OBJS += src/ap/beacon.c
  638. ifdef CONFIG_IEEE80211N
  639. OBJS += src/ap/ieee802_11_ht.c
  640. endif
  641. ifdef CONFIG_CTRL_IFACE
  642. OBJS += src/ap/ctrl_iface_ap.c
  643. endif
  644. L_CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  645. OBJS += src/eap_server/eap_server.c
  646. OBJS += src/eap_server/eap_server_identity.c
  647. OBJS += src/eap_server/eap_server_methods.c
  648. ifdef CONFIG_IEEE80211N
  649. L_CFLAGS += -DCONFIG_IEEE80211N
  650. endif
  651. ifdef NEED_AP_MLME
  652. OBJS += src/ap/wmm.c
  653. OBJS += src/ap/ap_list.c
  654. OBJS += src/ap/ieee802_11.c
  655. OBJS += src/ap/hw_features.c
  656. L_CFLAGS += -DNEED_AP_MLME
  657. endif
  658. ifdef CONFIG_WPS
  659. L_CFLAGS += -DEAP_SERVER_WSC
  660. OBJS += src/ap/wps_hostapd.c
  661. OBJS += src/eap_server/eap_server_wsc.c
  662. endif
  663. ifdef CONFIG_INTERWORKING
  664. OBJS += src/ap/gas_serv.c
  665. endif
  666. ifdef CONFIG_HS20
  667. OBJS += src/ap/hs20.c
  668. endif
  669. endif
  670. ifdef NEED_RSN_AUTHENTICATOR
  671. L_CFLAGS += -DCONFIG_NO_RADIUS
  672. NEED_AES_WRAP=y
  673. OBJS += src/ap/wpa_auth.c
  674. OBJS += src/ap/wpa_auth_ie.c
  675. OBJS += src/ap/pmksa_cache_auth.c
  676. ifdef CONFIG_IEEE80211R
  677. OBJS += src/ap/wpa_auth_ft.c
  678. endif
  679. ifdef CONFIG_PEERKEY
  680. OBJS += src/ap/peerkey_auth.c
  681. endif
  682. endif
  683. ifdef CONFIG_EAP_SERVER
  684. L_CFLAGS += -DEAP_SERVER
  685. OBJS_h += src/eap_server/eap_server.c
  686. OBJS_h += src/eap_server/eap_server_identity.c
  687. OBJS_h += src/eap_server/eap_server_methods.c
  688. endif
  689. ifdef CONFIG_RADIUS_CLIENT
  690. OBJS_h += src/utils/ip_addr.c
  691. OBJS_h += src/radius/radius.c
  692. OBJS_h += src/radius/radius_client.c
  693. endif
  694. ifdef CONFIG_AUTHENTICATOR
  695. OBJS_h += src/eapol_auth/eapol_auth_sm.c
  696. OBJS_h += src/ap/ieee802_1x.c
  697. endif
  698. ifdef CONFIG_WPA_AUTHENTICATOR
  699. OBJS_h += src/ap/wpa_auth.c
  700. OBJS_h += src/ap/wpa_auth_ie.c
  701. OBJS_h += src/ap/pmksa_cache_auth.c
  702. ifdef CONFIG_IEEE80211R
  703. OBJS_h += src/ap/wpa_auth_ft.c
  704. endif
  705. ifdef CONFIG_PEERKEY
  706. OBJS_h += src/ap/peerkey_auth.c
  707. endif
  708. endif
  709. ifdef CONFIG_PCSC
  710. # PC/SC interface for smartcards (USIM, GSM SIM)
  711. L_CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  712. OBJS += src/utils/pcsc_funcs.c
  713. # -lpthread may not be needed depending on how pcsc-lite was configured
  714. ifdef CONFIG_NATIVE_WINDOWS
  715. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  716. #dynamic symbol loading that is now used in pcsc_funcs.c
  717. #LIBS += -lwinscard
  718. else
  719. LIBS += -lpcsclite -lpthread
  720. endif
  721. endif
  722. ifdef CONFIG_SIM_SIMULATOR
  723. L_CFLAGS += -DCONFIG_SIM_SIMULATOR
  724. NEED_MILENAGE=y
  725. endif
  726. ifdef CONFIG_USIM_SIMULATOR
  727. L_CFLAGS += -DCONFIG_USIM_SIMULATOR
  728. NEED_MILENAGE=y
  729. endif
  730. ifdef NEED_MILENAGE
  731. OBJS += src/crypto/milenage.c
  732. NEED_AES_ENCBLOCK=y
  733. endif
  734. ifdef CONFIG_PKCS12
  735. L_CFLAGS += -DPKCS12_FUNCS
  736. endif
  737. ifdef CONFIG_SMARTCARD
  738. L_CFLAGS += -DCONFIG_SMARTCARD
  739. endif
  740. ifdef MS_FUNCS
  741. OBJS += src/crypto/ms_funcs.c
  742. NEED_DES=y
  743. NEED_MD4=y
  744. endif
  745. ifdef CHAP
  746. OBJS += src/eap_common/chap.c
  747. endif
  748. ifdef TLS_FUNCS
  749. NEED_DES=y
  750. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  751. OBJS += src/eap_peer/eap_tls_common.c
  752. OBJS_h += src/eap_server/eap_server_tls_common.c
  753. NEED_TLS_PRF=y
  754. endif
  755. ifndef CONFIG_TLS
  756. CONFIG_TLS=openssl
  757. endif
  758. ifdef CONFIG_TLSV11
  759. L_CFLAGS += -DCONFIG_TLSV11
  760. endif
  761. ifeq ($(CONFIG_TLS), openssl)
  762. ifdef TLS_FUNCS
  763. L_CFLAGS += -DEAP_TLS_OPENSSL
  764. OBJS += src/crypto/tls_openssl.c
  765. LIBS += -lssl
  766. endif
  767. OBJS += src/crypto/crypto_openssl.c
  768. OBJS_p += src/crypto/crypto_openssl.c
  769. ifdef NEED_FIPS186_2_PRF
  770. OBJS += src/crypto/fips_prf_openssl.c
  771. endif
  772. LIBS += -lcrypto
  773. LIBS_p += -lcrypto
  774. endif
  775. ifeq ($(CONFIG_TLS), gnutls)
  776. ifdef TLS_FUNCS
  777. OBJS += src/crypto/tls_gnutls.c
  778. LIBS += -lgnutls -lgpg-error
  779. endif
  780. OBJS += src/crypto/crypto_gnutls.c
  781. OBJS_p += src/crypto/crypto_gnutls.c
  782. ifdef NEED_FIPS186_2_PRF
  783. OBJS += src/crypto/fips_prf_gnutls.c
  784. endif
  785. LIBS += -lgcrypt
  786. LIBS_p += -lgcrypt
  787. CONFIG_INTERNAL_SHA256=y
  788. CONFIG_INTERNAL_RC4=y
  789. CONFIG_INTERNAL_DH_GROUP5=y
  790. endif
  791. ifeq ($(CONFIG_TLS), schannel)
  792. ifdef TLS_FUNCS
  793. OBJS += src/crypto/tls_schannel.c
  794. endif
  795. OBJS += src/crypto/crypto_cryptoapi.c
  796. OBJS_p += src/crypto/crypto_cryptoapi.c
  797. ifdef NEED_FIPS186_2_PRF
  798. OBJS += src/crypto/fips_prf_cryptoapi.c
  799. endif
  800. CONFIG_INTERNAL_SHA256=y
  801. CONFIG_INTERNAL_RC4=y
  802. CONFIG_INTERNAL_DH_GROUP5=y
  803. endif
  804. ifeq ($(CONFIG_TLS), nss)
  805. ifdef TLS_FUNCS
  806. OBJS += src/crypto/tls_nss.c
  807. LIBS += -lssl3
  808. endif
  809. OBJS += src/crypto/crypto_nss.c
  810. OBJS_p += src/crypto/crypto_nss.c
  811. ifdef NEED_FIPS186_2_PRF
  812. OBJS += src/crypto/fips_prf_nss.c
  813. endif
  814. LIBS += -lnss3
  815. LIBS_p += -lnss3
  816. CONFIG_INTERNAL_MD4=y
  817. CONFIG_INTERNAL_DH_GROUP5=y
  818. endif
  819. ifeq ($(CONFIG_TLS), internal)
  820. ifndef CONFIG_CRYPTO
  821. CONFIG_CRYPTO=internal
  822. endif
  823. ifdef TLS_FUNCS
  824. OBJS += src/crypto/crypto_internal-rsa.c
  825. OBJS += src/crypto/tls_internal.c
  826. OBJS += src/tls/tlsv1_common.c
  827. OBJS += src/tls/tlsv1_record.c
  828. OBJS += src/tls/tlsv1_cred.c
  829. OBJS += src/tls/tlsv1_client.c
  830. OBJS += src/tls/tlsv1_client_write.c
  831. OBJS += src/tls/tlsv1_client_read.c
  832. OBJS += src/tls/asn1.c
  833. OBJS += src/tls/rsa.c
  834. OBJS += src/tls/x509v3.c
  835. OBJS += src/tls/pkcs1.c
  836. OBJS += src/tls/pkcs5.c
  837. OBJS += src/tls/pkcs8.c
  838. NEED_SHA256=y
  839. NEED_BASE64=y
  840. NEED_TLS_PRF=y
  841. NEED_MODEXP=y
  842. NEED_CIPHER=y
  843. L_CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  844. endif
  845. ifdef NEED_CIPHER
  846. NEED_DES=y
  847. OBJS += src/crypto/crypto_internal-cipher.c
  848. endif
  849. ifdef NEED_MODEXP
  850. OBJS += src/crypto/crypto_internal-modexp.c
  851. OBJS += src/tls/bignum.c
  852. endif
  853. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  854. OBJS += src/crypto/crypto_libtomcrypt.c
  855. OBJS_p += src/crypto/crypto_libtomcrypt.c
  856. LIBS += -ltomcrypt -ltfm
  857. LIBS_p += -ltomcrypt -ltfm
  858. CONFIG_INTERNAL_SHA256=y
  859. CONFIG_INTERNAL_RC4=y
  860. CONFIG_INTERNAL_DH_GROUP5=y
  861. endif
  862. ifeq ($(CONFIG_CRYPTO), internal)
  863. OBJS += src/crypto/crypto_internal.c
  864. OBJS_p += src/crypto/crypto_internal.c
  865. NEED_AES_ENC=y
  866. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  867. ifdef CONFIG_INTERNAL_LIBTOMMATH
  868. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  869. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  870. L_CFLAGS += -DLTM_FAST
  871. endif
  872. else
  873. LIBS += -ltommath
  874. LIBS_p += -ltommath
  875. endif
  876. CONFIG_INTERNAL_AES=y
  877. CONFIG_INTERNAL_DES=y
  878. CONFIG_INTERNAL_SHA1=y
  879. CONFIG_INTERNAL_MD4=y
  880. CONFIG_INTERNAL_MD5=y
  881. CONFIG_INTERNAL_SHA256=y
  882. CONFIG_INTERNAL_RC4=y
  883. CONFIG_INTERNAL_DH_GROUP5=y
  884. endif
  885. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  886. OBJS += src/crypto/crypto_cryptoapi.c
  887. OBJS_p += src/crypto/crypto_cryptoapi.c
  888. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  889. CONFIG_INTERNAL_SHA256=y
  890. CONFIG_INTERNAL_RC4=y
  891. endif
  892. endif
  893. ifeq ($(CONFIG_TLS), none)
  894. ifdef TLS_FUNCS
  895. OBJS += src/crypto/tls_none.c
  896. L_CFLAGS += -DEAP_TLS_NONE
  897. CONFIG_INTERNAL_AES=y
  898. CONFIG_INTERNAL_SHA1=y
  899. CONFIG_INTERNAL_MD5=y
  900. endif
  901. OBJS += src/crypto/crypto_none.c
  902. OBJS_p += src/crypto/crypto_none.c
  903. CONFIG_INTERNAL_SHA256=y
  904. CONFIG_INTERNAL_RC4=y
  905. endif
  906. ifdef TLS_FUNCS
  907. ifdef CONFIG_SMARTCARD
  908. ifndef CONFIG_NATIVE_WINDOWS
  909. ifneq ($(CONFIG_L2_PACKET), freebsd)
  910. LIBS += -ldl
  911. endif
  912. endif
  913. endif
  914. endif
  915. ifndef TLS_FUNCS
  916. OBJS += src/crypto/tls_none.c
  917. ifeq ($(CONFIG_TLS), internal)
  918. CONFIG_INTERNAL_AES=y
  919. CONFIG_INTERNAL_SHA1=y
  920. CONFIG_INTERNAL_MD5=y
  921. CONFIG_INTERNAL_RC4=y
  922. endif
  923. endif
  924. AESOBJS = # none so far (see below)
  925. ifdef CONFIG_INTERNAL_AES
  926. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-dec.c
  927. endif
  928. AESOBJS += src/crypto/aes-unwrap.c
  929. ifdef NEED_AES_EAX
  930. AESOBJS += src/crypto/aes-eax.c
  931. NEED_AES_CTR=y
  932. endif
  933. ifdef NEED_AES_CTR
  934. AESOBJS += src/crypto/aes-ctr.c
  935. endif
  936. ifdef NEED_AES_ENCBLOCK
  937. AESOBJS += src/crypto/aes-encblock.c
  938. endif
  939. ifdef NEED_AES_OMAC1
  940. NEED_AES_ENC=y
  941. ifdef CONFIG_OPENSSL_CMAC
  942. CFLAGS += -DCONFIG_OPENSSL_CMAC
  943. else
  944. AESOBJS += src/crypto/aes-omac1.c
  945. endif
  946. endif
  947. ifdef NEED_AES_WRAP
  948. NEED_AES_ENC=y
  949. AESOBJS += src/crypto/aes-wrap.c
  950. endif
  951. ifdef NEED_AES_CBC
  952. NEED_AES_ENC=y
  953. AESOBJS += src/crypto/aes-cbc.c
  954. endif
  955. ifdef NEED_AES_ENC
  956. ifdef CONFIG_INTERNAL_AES
  957. AESOBJS += src/crypto/aes-internal-enc.c
  958. endif
  959. endif
  960. ifdef NEED_AES
  961. OBJS += $(AESOBJS)
  962. endif
  963. SHA1OBJS =
  964. ifdef NEED_SHA1
  965. ifneq ($(CONFIG_TLS), openssl)
  966. SHA1OBJS += src/crypto/sha1.c
  967. endif
  968. SHA1OBJS += src/crypto/sha1-prf.c
  969. ifdef CONFIG_INTERNAL_SHA1
  970. SHA1OBJS += src/crypto/sha1-internal.c
  971. ifdef NEED_FIPS186_2_PRF
  972. SHA1OBJS += src/crypto/fips_prf_internal.c
  973. endif
  974. endif
  975. ifdef CONFIG_NO_WPA_PASSPHRASE
  976. L_CFLAGS += -DCONFIG_NO_PBKDF2
  977. else
  978. ifneq ($(CONFIG_TLS), openssl)
  979. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  980. endif
  981. endif
  982. ifdef NEED_T_PRF
  983. SHA1OBJS += src/crypto/sha1-tprf.c
  984. endif
  985. ifdef NEED_TLS_PRF
  986. SHA1OBJS += src/crypto/sha1-tlsprf.c
  987. endif
  988. endif
  989. MD5OBJS = src/crypto/md5.c
  990. ifdef NEED_MD5
  991. ifdef CONFIG_INTERNAL_MD5
  992. MD5OBJS += src/crypto/md5-internal.c
  993. endif
  994. OBJS += $(MD5OBJS)
  995. OBJS_p += $(MD5OBJS)
  996. endif
  997. ifdef NEED_MD4
  998. ifdef CONFIG_INTERNAL_MD4
  999. OBJS += src/crypto/md4-internal.c
  1000. endif
  1001. endif
  1002. DESOBJS = # none needed when not internal
  1003. ifdef NEED_DES
  1004. ifdef CONFIG_INTERNAL_DES
  1005. DESOBJS += src/crypto/des-internal.c
  1006. endif
  1007. endif
  1008. ifdef NEED_RC4
  1009. ifdef CONFIG_INTERNAL_RC4
  1010. OBJS += src/crypto/rc4.c
  1011. endif
  1012. endif
  1013. SHA256OBJS = # none by default
  1014. ifdef NEED_SHA256
  1015. L_CFLAGS += -DCONFIG_SHA256
  1016. ifneq ($(CONFIG_TLS), openssl)
  1017. SHA256OBJS += src/crypto/sha256.c
  1018. endif
  1019. SHA256OBJS += src/crypto/sha256-prf.c
  1020. ifdef CONFIG_INTERNAL_SHA256
  1021. SHA256OBJS += src/crypto/sha256-internal.c
  1022. endif
  1023. OBJS += $(SHA256OBJS)
  1024. endif
  1025. ifdef NEED_DH_GROUPS
  1026. OBJS += src/crypto/dh_groups.c
  1027. endif
  1028. ifdef NEED_DH_GROUPS_ALL
  1029. L_CFLAGS += -DALL_DH_GROUPS
  1030. endif
  1031. ifdef CONFIG_INTERNAL_DH_GROUP5
  1032. ifdef NEED_DH_GROUPS
  1033. OBJS += src/crypto/dh_group5.c
  1034. endif
  1035. endif
  1036. ifdef CONFIG_NO_RANDOM_POOL
  1037. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1038. else
  1039. OBJS += src/crypto/random.c
  1040. endif
  1041. ifdef CONFIG_CTRL_IFACE
  1042. ifeq ($(CONFIG_CTRL_IFACE), y)
  1043. ifdef CONFIG_NATIVE_WINDOWS
  1044. CONFIG_CTRL_IFACE=named_pipe
  1045. else
  1046. CONFIG_CTRL_IFACE=unix
  1047. endif
  1048. endif
  1049. L_CFLAGS += -DCONFIG_CTRL_IFACE
  1050. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1051. L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1052. endif
  1053. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1054. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1055. endif
  1056. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1057. L_CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1058. endif
  1059. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1060. CONFIG_CTRL_IFACE=udp
  1061. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1062. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1063. endif
  1064. OBJS += ctrl_iface.c ctrl_iface_$(CONFIG_CTRL_IFACE).c
  1065. endif
  1066. ifdef CONFIG_CTRL_IFACE_DBUS
  1067. DBUS=y
  1068. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1069. DBUS_OBJS += dbus/dbus_old.c dbus/dbus_old_handlers.c
  1070. ifdef CONFIG_WPS
  1071. DBUS_OBJS += dbus/dbus_old_handlers_wps.c
  1072. endif
  1073. DBUS_OBJS += dbus/dbus_dict_helpers.c
  1074. ifndef DBUS_LIBS
  1075. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1076. endif
  1077. ifndef DBUS_INCLUDE
  1078. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1079. endif
  1080. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1081. endif
  1082. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1083. DBUS=y
  1084. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1085. DBUS_OBJS ?= dbus/dbus_dict_helpers.c
  1086. DBUS_OBJS += dbus/dbus_new_helpers.c
  1087. DBUS_OBJS += dbus/dbus_new.c dbus/dbus_new_handlers.c
  1088. ifdef CONFIG_WPS
  1089. DBUS_OBJS += dbus/dbus_new_handlers_wps.c
  1090. endif
  1091. ifdef CONFIG_P2P
  1092. DBUS_OBJS += dbus/dbus_new_handlers_p2p.c
  1093. endif
  1094. ifndef DBUS_LIBS
  1095. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1096. endif
  1097. ifndef DBUS_INCLUDE
  1098. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1099. endif
  1100. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1101. DBUS_OBJS += dbus/dbus_new_introspect.c
  1102. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1103. endif
  1104. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1105. endif
  1106. ifdef DBUS
  1107. DBUS_CFLAGS += -DCONFIG_DBUS
  1108. DBUS_OBJS += dbus/dbus_common.c
  1109. endif
  1110. OBJS += $(DBUS_OBJS)
  1111. L_CFLAGS += $(DBUS_CFLAGS)
  1112. LIBS += $(DBUS_LIBS)
  1113. ifdef CONFIG_READLINE
  1114. OBJS_c += src/utils/edit_readline.c
  1115. LIBS_c += -lncurses -lreadline
  1116. else
  1117. ifdef CONFIG_WPA_CLI_EDIT
  1118. OBJS_c += src/utils/edit.c
  1119. else
  1120. OBJS_c += src/utils/edit_simple.c
  1121. endif
  1122. endif
  1123. ifdef CONFIG_NATIVE_WINDOWS
  1124. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1125. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1126. LIBS_c += -lws2_32
  1127. LIBS_p += -lws2_32 -lgdi32
  1128. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1129. LIBS_p += -lcrypt32
  1130. endif
  1131. endif
  1132. ifdef CONFIG_NO_STDOUT_DEBUG
  1133. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1134. ifndef CONFIG_CTRL_IFACE
  1135. L_CFLAGS += -DCONFIG_NO_WPA_MSG
  1136. endif
  1137. endif
  1138. ifdef CONFIG_ANDROID_LOG
  1139. L_CFLAGS += -DCONFIG_ANDROID_LOG
  1140. endif
  1141. ifdef CONFIG_IPV6
  1142. # for eapol_test only
  1143. L_CFLAGS += -DCONFIG_IPV6
  1144. endif
  1145. ifdef NEED_BASE64
  1146. OBJS += src/utils/base64.c
  1147. endif
  1148. ifdef NEED_SME
  1149. NEED_80211_COMMON=y
  1150. OBJS += sme.c
  1151. L_CFLAGS += -DCONFIG_SME
  1152. endif
  1153. ifdef NEED_80211_COMMON
  1154. OBJS += src/common/ieee802_11_common.c
  1155. endif
  1156. ifdef NEED_EAP_COMMON
  1157. OBJS += src/eap_common/eap_common.c
  1158. endif
  1159. ifndef CONFIG_MAIN
  1160. CONFIG_MAIN=main
  1161. endif
  1162. ifdef CONFIG_DEBUG_SYSLOG
  1163. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1164. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1165. L_CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1166. endif
  1167. endif
  1168. ifdef CONFIG_DEBUG_FILE
  1169. L_CFLAGS += -DCONFIG_DEBUG_FILE
  1170. endif
  1171. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1172. L_CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1173. endif
  1174. ifdef CONFIG_FIPS
  1175. L_CFLAGS += -DCONFIG_FIPS
  1176. endif
  1177. OBJS += $(SHA1OBJS) $(DESOBJS)
  1178. OBJS_p += $(SHA1OBJS)
  1179. ifdef CONFIG_BGSCAN_SIMPLE
  1180. L_CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1181. OBJS += bgscan_simple.c
  1182. NEED_BGSCAN=y
  1183. endif
  1184. ifdef CONFIG_BGSCAN_LEARN
  1185. L_CFLAGS += -DCONFIG_BGSCAN_LEARN
  1186. OBJS += bgscan_learn.c
  1187. NEED_BGSCAN=y
  1188. endif
  1189. ifdef NEED_BGSCAN
  1190. L_CFLAGS += -DCONFIG_BGSCAN
  1191. OBJS += bgscan.c
  1192. endif
  1193. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1194. L_CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1195. OBJS += autoscan_exponential.c
  1196. NEED_AUTOSCAN=y
  1197. endif
  1198. ifdef CONFIG_AUTOSCAN_PERIODIC
  1199. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1200. OBJS += autoscan_periodic.c
  1201. NEED_AUTOSCAN=y
  1202. endif
  1203. ifdef NEED_AUTOSCAN
  1204. L_CFLAGS += -DCONFIG_AUTOSCAN
  1205. OBJS += autoscan.c
  1206. endif
  1207. ifdef CONFIG_EXT_PASSWORD_TEST
  1208. OBJS += ../src/utils/ext_password_test.c
  1209. L_CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1210. NEED_EXT_PASSWORD=y
  1211. endif
  1212. ifdef NEED_EXT_PASSWORD
  1213. OBJS += ../src/utils/ext_password.c
  1214. L_CFLAGS += -DCONFIG_EXT_PASSWORD
  1215. endif
  1216. ifdef NEED_GAS
  1217. OBJS += ../src/common/gas.c
  1218. OBJS += gas_query.c
  1219. L_CFLAGS += -DCONFIG_GAS
  1220. NEED_OFFCHANNEL=y
  1221. endif
  1222. ifdef NEED_OFFCHANNEL
  1223. OBJS += offchannel.c
  1224. L_CFLAGS += -DCONFIG_OFFCHANNEL
  1225. endif
  1226. OBJS += src/drivers/driver_common.c
  1227. OBJS_wpa_rm := ctrl_iface.c ctrl_iface_unix.c
  1228. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.c
  1229. ifdef CONFIG_AUTHENTICATOR
  1230. OBJS_wpa += tests/link_test.c
  1231. endif
  1232. OBJS_wpa += $(OBJS_l2)
  1233. OBJS += wpa_supplicant.c events.c blacklist.c wpas_glue.c scan.c
  1234. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.c
  1235. OBJS_t += src/radius/radius_client.c
  1236. OBJS_t += src/radius/radius.c
  1237. ifndef CONFIG_AP
  1238. OBJS_t += src/utils/ip_addr.c
  1239. endif
  1240. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.c
  1241. OBJS += $(CONFIG_MAIN).c
  1242. ifdef CONFIG_PRIVSEP
  1243. OBJS_priv += $(OBJS_d) src/drivers/drivers.c
  1244. OBJS_priv += $(OBJS_l2)
  1245. OBJS_priv += src/utils/os_$(CONFIG_OS).c
  1246. OBJS_priv += src/utils/$(CONFIG_ELOOP).c
  1247. OBJS_priv += src/utils/common.c
  1248. OBJS_priv += src/utils/wpa_debug.c
  1249. OBJS_priv += src/utils/wpabuf.c
  1250. OBJS_priv += wpa_priv.c
  1251. ifdef CONFIG_DRIVER_TEST
  1252. OBJS_priv += $(SHA1OBJS)
  1253. OBJS_priv += $(MD5OBJS)
  1254. ifeq ($(CONFIG_TLS), openssl)
  1255. OBJS_priv += src/crypto/crypto_openssl.c
  1256. endif
  1257. ifeq ($(CONFIG_TLS), gnutls)
  1258. OBJS_priv += src/crypto/crypto_gnutls.c
  1259. endif
  1260. ifeq ($(CONFIG_TLS), nss)
  1261. OBJS_priv += src/crypto/crypto_nss.c
  1262. endif
  1263. ifeq ($(CONFIG_TLS), internal)
  1264. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  1265. OBJS_priv += src/crypto/crypto_libtomcrypt.c
  1266. else
  1267. OBJS_priv += src/crypto/crypto_internal.c
  1268. endif
  1269. endif
  1270. endif # CONFIG_DRIVER_TEST
  1271. OBJS += src/l2_packet/l2_packet_privsep.c
  1272. OBJS += src/drivers/driver_privsep.c
  1273. EXTRA_progs += wpa_priv
  1274. else
  1275. OBJS += $(OBJS_d) src/drivers/drivers.c
  1276. OBJS += $(OBJS_l2)
  1277. endif
  1278. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1279. L_CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1280. OBJS += src/drivers/ndis_events.c
  1281. EXTRALIBS += -loleaut32 -lole32 -luuid
  1282. ifdef PLATFORMSDKLIB
  1283. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1284. else
  1285. EXTRALIBS += WbemUuid.Lib
  1286. endif
  1287. endif
  1288. ifndef LDO
  1289. LDO=$(CC)
  1290. endif
  1291. ########################
  1292. include $(CLEAR_VARS)
  1293. LOCAL_MODULE := wpa_cli
  1294. LOCAL_MODULE_TAGS := debug
  1295. LOCAL_SHARED_LIBRARIES := libc libcutils
  1296. LOCAL_CFLAGS := $(L_CFLAGS)
  1297. LOCAL_SRC_FILES := $(OBJS_c)
  1298. LOCAL_C_INCLUDES := $(INCLUDES)
  1299. include $(BUILD_EXECUTABLE)
  1300. ########################
  1301. include $(CLEAR_VARS)
  1302. LOCAL_MODULE := wpa_supplicant
  1303. ifdef CONFIG_DRIVER_CUSTOM
  1304. LOCAL_STATIC_LIBRARIES := libCustomWifi
  1305. endif
  1306. ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
  1307. LOCAL_STATIC_LIBRARIES += $(BOARD_WPA_SUPPLICANT_PRIVATE_LIB)
  1308. endif
  1309. LOCAL_SHARED_LIBRARIES := libc libcutils
  1310. ifeq ($(CONFIG_TLS), openssl)
  1311. LOCAL_SHARED_LIBRARIES += libcrypto libssl
  1312. endif
  1313. ifdef CONFIG_DRIVER_NL80211
  1314. LOCAL_STATIC_LIBRARIES += libnl_2
  1315. endif
  1316. LOCAL_CFLAGS := $(L_CFLAGS)
  1317. LOCAL_SRC_FILES := $(OBJS)
  1318. LOCAL_C_INCLUDES := $(INCLUDES)
  1319. include $(BUILD_EXECUTABLE)
  1320. ########################
  1321. #
  1322. #include $(CLEAR_VARS)
  1323. #LOCAL_MODULE := eapol_test
  1324. #ifdef CONFIG_DRIVER_CUSTOM
  1325. #LOCAL_STATIC_LIBRARIES := libCustomWifi
  1326. #endif
  1327. #LOCAL_SHARED_LIBRARIES := libc libcrypto libssl
  1328. #LOCAL_CFLAGS := $(L_CFLAGS)
  1329. #LOCAL_SRC_FILES := $(OBJS_t)
  1330. #LOCAL_C_INCLUDES := $(INCLUDES)
  1331. #include $(BUILD_EXECUTABLE)
  1332. #
  1333. ########################
  1334. #
  1335. #local_target_dir := $(TARGET_OUT)/etc/wifi
  1336. #
  1337. #include $(CLEAR_VARS)
  1338. #LOCAL_MODULE := wpa_supplicant.conf
  1339. #LOCAL_MODULE_TAGS := user
  1340. #LOCAL_MODULE_CLASS := ETC
  1341. #LOCAL_MODULE_PATH := $(local_target_dir)
  1342. #LOCAL_SRC_FILES := $(LOCAL_MODULE)
  1343. #include $(BUILD_PREBUILT)
  1344. #
  1345. ########################
  1346. endif # ifeq ($(WPA_BUILD_SUPPLICANT),true)
  1347. include $(CLEAR_VARS)
  1348. LOCAL_MODULE = libwpa_client
  1349. LOCAL_CFLAGS = $(L_CFLAGS)
  1350. LOCAL_SRC_FILES = src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
  1351. LOCAL_C_INCLUDES = $(INCLUDES)
  1352. LOCAL_SHARED_LIBRARIES := libcutils
  1353. LOCAL_COPY_HEADERS_TO := libwpa_client
  1354. LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
  1355. include $(BUILD_SHARED_LIBRARY)