ICU-7774 Ensure that pkgdata tool builds correct library on Windows.

X-SVN-Rev: 28233
This commit is contained in:
Michael Ow 2010-06-21 15:14:35 +00:00
parent 390d56db41
commit d746cdf71c

View File

@ -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,