Android.mk 33 KB

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