From 511aafb0d94069e7333ec415c71b7f7cc83f978b Mon Sep 17 00:00:00 2001 From: sav-ix Date: Mon, 13 Aug 2018 19:18:20 +0300 Subject: [PATCH] ICU-13138 fix ICU data binary naming for builds with Static layout (#44) * ICU-13138 do not create symlink to Static ICU Data binary For builds using mingw-w64 and MSVC with Static layout, ICU installation folder contains '.dll' file, which is a symbolic link to '.a' or '.lib' Data binary. This have no sense anyway, since it can't be used as binary with shared layout. * ICU-13138 mingw: add lib prefix to Static Data binary name For builds using mingw-w64 with Static layout, missing 'lib' prefix in ICU Data binary name leads to Stubdata binary use during ICU extras, samples and tests build. ICU Stubdata binary also substitutes Data in installation directory. The above leads to runtime errors of ICU tools, tests and ICU-based software. Thus need to add 'lib' prefix to ICU Data binary name during Pkgdata run. Task-number: ICU-13138 Task-number: ICU-13187 --- icu4c/source/tools/pkgdata/pkgdata.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/icu4c/source/tools/pkgdata/pkgdata.cpp b/icu4c/source/tools/pkgdata/pkgdata.cpp index ffcf459c349..942a55d77cc 100644 --- a/icu4c/source/tools/pkgdata/pkgdata.cpp +++ b/icu4c/source/tools/pkgdata/pkgdata.cpp @@ -904,7 +904,8 @@ static void createFileNames(UPKGOptions *o, const char mode, const char *version if (IN_DLL_MODE(mode)) { sprintf(libFileNames[LIB_FILE], "%s", libName); } else { - sprintf(libFileNames[LIB_FILE], "%s%s", + sprintf(libFileNames[LIB_FILE], "%s%s%s", + (strstr(libName, "icudt") ? "lib" : ""), pkgDataFlags[LIBPREFIX], libName); } @@ -1020,7 +1021,7 @@ static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling) char name2[SMALL_BUFFER_MAX_SIZE]; /* file name to symlink */ const char* FILE_EXTENSION_SEP = uprv_strlen(pkgDataFlags[SO_EXT]) == 0 ? "" : "."; -#if !defined(USING_CYGWIN) && U_PLATFORM != U_PF_MINGW +#if U_PLATFORM != U_PF_CYGWIN /* No symbolic link to make. */ if (uprv_strlen(libFileNames[LIB_FILE_VERSION]) == 0 || uprv_strlen(libFileNames[LIB_FILE_VERSION_MAJOR]) == 0 || uprv_strcmp(libFileNames[LIB_FILE_VERSION], libFileNames[LIB_FILE_VERSION_MAJOR]) == 0) { -- 2.40.0