1 Star 0 Fork 49

Funda Wang/samba_1

forked from src-openEuler/samba 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-samba-link-against-icu-uc.patch 3.88 KB
一键复制 编辑 原始数据 按行查看 历史
From 05807488fd340751ee976c5f8a367013ff94843e Mon Sep 17 00:00:00 2001
From: Earl Chew <earl_chew@yahoo.com>
Date: Sat, 16 Dec 2023 08:48:36 -0800
Subject: [PATCH] Combine ICU libraries icu-i18n and icu-uc into a single
dependency
Rather than probing for icu-i18n, icu-uc, and icudata libraries
separately, only probe for icu-i18n, and icu-uc, as direct dependencies
This avoids overlinking with icudata, and allows the package
to build even when ICU is not installed as a system library.
RN: Only use icu-i18n and icu-uc to express ICU dependency
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15623
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
---
lib/util/charset/iconv.c | 8 ++++----
lib/util/charset/wscript_build | 3 ++-
lib/util/charset/wscript_configure | 17 +++++++----------
3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/lib/util/charset/iconv.c b/lib/util/charset/iconv.c
index 131df6409866..074794a26e31 100644
--- a/lib/util/charset/iconv.c
+++ b/lib/util/charset/iconv.c
@@ -26,7 +26,7 @@
#include "lib/util/charset/charset.h"
#include "lib/util/charset/charset_proto.h"
-#ifdef HAVE_ICU_I18N
+#ifdef HAVE_ICUI18N
#include <unicode/ustring.h>
#include <unicode/utrans.h>
#endif
@@ -168,7 +168,7 @@ static size_t sys_iconv(void *cd,
}
#endif
-#ifdef HAVE_ICU_I18N
+#ifdef HAVE_ICUI18N
static size_t sys_uconv(void *cd,
const char **inbuf,
size_t *inbytesleft,
@@ -334,7 +334,7 @@ static bool is_utf16(const char *name)
static int smb_iconv_t_destructor(smb_iconv_t hwd)
{
-#ifdef HAVE_ICU_I18N
+#ifdef HAVE_ICUI18N
/*
* This has to come first, as the cd_direct member won't be an iconv
* handle and must not be passed to iconv_close().
@@ -418,7 +418,7 @@ _PUBLIC_ smb_iconv_t smb_iconv_open_ex(TALLOC_CTX *mem_ctx, const char *tocode,
}
#endif
-#ifdef HAVE_ICU_I18N
+#ifdef HAVE_ICUI18N
if (strcasecmp(fromcode, "UTF8-NFD") == 0 &&
strcasecmp(tocode, "UTF8-NFC") == 0)
{
diff --git a/lib/util/charset/wscript_build b/lib/util/charset/wscript_build
index c69a17170ad6..3af90a0ad574 100644
--- a/lib/util/charset/wscript_build
+++ b/lib/util/charset/wscript_build
@@ -6,7 +6,8 @@ bld.SAMBA_SUBSYSTEM('ICONV_WRAPPER',
weird.c
charset_macosxfs.c
''',
- public_deps='iconv replace talloc ' + bld.env['icu-libs'])
+ deps=bld.env['icu-libs'],
+ public_deps='iconv replace talloc')
bld.SAMBA_SUBSYSTEM('charset',
public_headers='charset.h',
diff --git a/lib/util/charset/wscript_configure b/lib/util/charset/wscript_configure
index 58858f69b319..c49b55a4fd4b 100644
--- a/lib/util/charset/wscript_configure
+++ b/lib/util/charset/wscript_configure
@@ -37,15 +37,12 @@ conf.CHECK_CODE('''
lib='iconv',
headers='errno.h iconv.h')
-if conf.CHECK_CFG(package='icu-i18n',
+if conf.CHECK_CFG(package='icu-i18n icu-uc',
args='--cflags --libs',
- msg='Checking for icu-i18n',
- uselib_store='ICU_I18N'):
- for lib in conf.env['LIB_ICU_I18N']:
- conf.CHECK_LIB(lib, shlib=True, mandatory=True)
- conf.env['icu-libs'] = ' '.join(conf.env['LIB_ICU_I18N'])
- if not conf.CHECK_HEADERS('unicode/ustring.h'):
- conf.fatal('Found libicu, but unicode/ustring.h is missing')
+ msg='Checking for icu-i18n icu-uc',
+ uselib_store='ICUI18N'):
+ conf.env['icu-libs'] = 'icui18n icuuc'
+ conf.CHECK_LIB(conf.env['icu-libs'], shlib=True, mandatory=True)
+ if not conf.CHECK_HEADERS('unicode/ustring.h', lib='icui18n icuuc'):
+ conf.fatal('Found icui18n, but unicode/ustring.h is missing')
conf.DEFINE('HAVE_UTF8_NORMALISATION', 1)
-else:
- conf.env['icu-libs'] = ''
--
GitLab
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fundawang/samba_1.git
git@gitee.com:fundawang/samba_1.git
fundawang
samba_1
samba_1
master

搜索帮助