From d746cdf71c8b9b06198fb9a64c26598b68f344b9 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Mon, 21 Jun 2010 15:14:35 +0000 Subject: [PATCH] ICU-7774 Ensure that pkgdata tool builds correct library on Windows. X-SVN-Rev: 28233 --- icu4c/source/tools/pkgdata/pkgdata.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/icu4c/source/tools/pkgdata/pkgdata.cpp b/icu4c/source/tools/pkgdata/pkgdata.cpp index f7d23843ef..de08f3c01e 100644 --- a/icu4c/source/tools/pkgdata/pkgdata.cpp +++ b/icu4c/source/tools/pkgdata/pkgdata.cpp @@ -1413,7 +1413,6 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD #define LINK_CMD "link.exe /nologo /release /out:" #define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /base:0x4ad00000 /implib:" #define LIB_CMD "LIB.exe /nologo /out:" -#define LIB_FILE "icudt.lib" #define LIB_EXT UDATA_LIB_SUFFIX #define DLL_EXT UDATA_SO_SUFFIX @@ -1436,6 +1435,7 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U char dllFilePath[SMALL_BUFFER_MAX_SIZE] = ""; char libFilePath[SMALL_BUFFER_MAX_SIZE] = ""; char resFilePath[SMALL_BUFFER_MAX_SIZE] = ""; + char tmpResFilePath[SMALL_BUFFER_MAX_SIZE] = ""; #ifdef CYGWINMSVC uprv_strcpy(dllFilePath, o->targetDir); @@ -1445,25 +1445,23 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U uprv_strcat(dllFilePath, PKGDATA_FILE_SEP_STRING); uprv_strcpy(libFilePath, dllFilePath); -#ifdef CYGWINMSVC uprv_strcat(libFilePath, o->libName); uprv_strcat(libFilePath, ".lib"); +#ifdef CYGWINMSVC uprv_strcat(dllFilePath, o->libName); uprv_strcat(dllFilePath, o->version); #else uprv_strcat(dllFilePath, o->entryName); - - uprv_strcat(libFilePath, LIB_FILE); #endif uprv_strcat(dllFilePath, DLL_EXT); - uprv_strcpy(resFilePath, o->tmpDir); - uprv_strcat(resFilePath, PKGDATA_FILE_SEP_STRING); - uprv_strcat(resFilePath, ICUDATA_RES_FILE); + uprv_strcpy(tmpResFilePath, o->tmpDir); + uprv_strcat(tmpResFilePath, PKGDATA_FILE_SEP_STRING); + uprv_strcat(tmpResFilePath, ICUDATA_RES_FILE); - if (!T_FileStream_file_exists(resFilePath)) { - uprv_memset(resFilePath, 0, sizeof(resFilePath)); + if (T_FileStream_file_exists(tmpResFilePath)) { + sprintf(resFilePath, "\"%s\"", tmpResFilePath) } /* Check if dll file and lib file exists and that it is not newer than genc file. */ @@ -1475,7 +1473,7 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U return 0; } - sprintf(cmd, "%s\"%s\" %s\"%s\" \"%s\" \"%s\"", + sprintf(cmd, "%s\"%s\" %s\"%s\" \"%s\" %s", LINK_CMD, dllFilePath, LINK_FLAGS,