From 2f44f512fe5a72131e889b2ab7f3dd8e6f766385 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Tue, 11 Jan 2022 20:34:35 +0100 Subject: [PATCH] [smb] Added smb to meson --- meson.build | 5 +++++ src/protocol/smb/smb2.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 0028d7dc..ff778823 100644 --- a/meson.build +++ b/meson.build @@ -328,6 +328,11 @@ if conf_data.get('CONFIG_FSP') deps += fspdeps endif +if conf_data.get('CONFIG_SMB') + smbdeps = dependency('smbclient', static: st) + deps += smbdeps +endif + dep_atomic = dependency('', required: false) if not compiler.links('''#include diff --git a/src/protocol/smb/smb2.c b/src/protocol/smb/smb2.c index 030b72a4..91d16663 100644 --- a/src/protocol/smb/smb2.c +++ b/src/protocol/smb/smb2.c @@ -5,9 +5,7 @@ #endif #include -#ifdef HAVE_LIBSMBCLIENT_H #include -#endif #include #include #include @@ -38,13 +36,22 @@ #include "util/memory.h" #include "util/string.h" +static char elsmbversion[32]; + +static void +init_smb(struct module *module) +{ + snprintf(elsmbversion, 31, "SMB(%s)", smbc_version()); + module->name = elsmbversion; +} + struct module smb_protocol_module = struct_module( /* name: */ N_("SMB"), /* options: */ NULL, /* hooks: */ NULL, /* submodules: */ NULL, /* data: */ NULL, - /* init: */ NULL, + /* init: */ init_smb, /* done: */ NULL );