uprv_strcat(targetDir, PKGDATA_FILE_SEP_STRING);
uprv_strcat(targetDir, o->shortName);
}
-
+
if(o->verbose) {
fprintf(stdout, "# Install: Files mode, copying files to %s..\n", targetDir);
}
if(o->verbose) {
fprintf(stdout, "# Generating assembly code %s of type %s ..\n", gencFilePath, genccodeAssembly);
}
-
+
/* Offset genccodeAssembly by 3 because "-a " */
if (genccodeAssembly &&
(uprv_strlen(genccodeAssembly)>3) &&
uprv_strcmp(libFileNames[LIB_FILE_VERSION], libFileNames[LIB_FILE_VERSION_MAJOR]) == 0) {
return result;
}
-
+
sprintf(cmd, "cd %s && %s %s && %s %s %s",
targetDir,
RM_CMD,
targetDir,
libFileNames[LIB_FILE_VERSION_TMP]);
- result = runCommand(cmd);
- if (result != 0) {
+ result = runCommand(cmd);
+ if (result != 0) {
fprintf(stderr, "Error creating archive library. Failed command: %s\n", cmd);
- return result;
- }
-
- sprintf(cmd, "%s %s%s",
- pkgDataFlags[RANLIB],
- targetDir,
+ return result;
+ }
+
+ sprintf(cmd, "%s %s%s",
+ pkgDataFlags[RANLIB],
+ targetDir,
libFileNames[LIB_FILE_VERSION]);
-
- result = runCommand(cmd);
+
+ result = runCommand(cmd);
if (result != 0) {
fprintf(stderr, "Error creating archive library. Failed command: %s\n", cmd);
return result;
result = runCommand(cmd);
if (result == 0) {
- sprintf(cmd, "%s %s%s",
- pkgDataFlags[RANLIB],
- targetDir,
- libFileNames[LIB_FILE_VERSION]);
-
+ sprintf(cmd, "%s %s%s",
+ pkgDataFlags[RANLIB],
+ targetDir,
+ libFileNames[LIB_FILE_VERSION]);
+
result = runCommand(cmd);
}
} else /* if (IN_DLL_MODE(mode)) */ {
#ifdef USE_SINGLE_CCODE_FILE
char icudtAll[SMALL_BUFFER_MAX_SIZE] = "";
FileStream *icudtAllFile = NULL;
-
+
sprintf(icudtAll, "%s%s%sall.c",
o->tmpDir,
- PKGDATA_FILE_SEP_STRING,
+ PKGDATA_FILE_SEP_STRING,
libFileNames[LIB_FILE]);
/* Remove previous icudtall.c file. */
if (T_FileStream_file_exists(icudtAll) && (result = remove(icudtAll)) != 0) {
#ifdef USE_SINGLE_CCODE_FILE
uprv_strcpy(tempObjectFile, gencmnFile);
tempObjectFile[uprv_strlen(tempObjectFile) - 1] = 'o';
-
+
sprintf(cmd, "%s %s -o %s %s",
pkgDataFlags[COMPILER],
pkgDataFlags[LIBFLAGS],
tempObjectFile,
gencmnFile);
-
+
result = runCommand(cmd);
if (result != 0) {
break;
}
-
+
sprintf(buffer, "%s",tempObjectFile);
#endif
} else {
#ifndef USE_SINGLE_CCODE_FILE
uprv_strcpy(tempObjectFile, gencmnFile);
tempObjectFile[uprv_strlen(tempObjectFile) - 1] = 'o';
-
+
sprintf(cmd, "%s %s -o %s %s",
pkgDataFlags[COMPILER],
pkgDataFlags[LIBFLAGS],
uprv_strcat(buffer, tempObjectFile);
#endif
-
+
if (i > 0) {
list = list->next;
listNames = listNames->next;
pkgDataFlags[LIBFLAGS],
tempObjectFile,
icudtAll);
-
+
result = runCommand(cmd);
if (result == 0) {
uprv_strcat(buffer, " ");
#ifdef CYGWINMSVC
uprv_strcat(libFilePath, o->libName);
uprv_strcat(libFilePath, ".lib");
-
+
uprv_strcat(dllFilePath, o->libName);
uprv_strcat(dllFilePath, o->version);
#else
uprv_strcat(dllFilePath, o->entryName);
#endif
uprv_strcat(dllFilePath, DLL_EXT);
-
+
uprv_strcpy(tmpResFilePath, o->tmpDir);
uprv_strcat(tmpResFilePath, PKGDATA_FILE_SEP_STRING);
uprv_strcat(tmpResFilePath, ICUDATA_RES_FILE);
return NULL;
} else {
sprintf(tmpbuffer, "%s%s ", o->entryName, UDATA_CMN_INTERMEDIATE_SUFFIX);
-
+
T_FileStream_writeLine(f, tmpbuffer);
-
+
T_FileStream_close(f);
}
}
#endif
// Don't really need a return value, just need to stop compiler warnings about
// the unused parameter 'o' on platforms where it is not otherwise used.
- return o;
+ return o;
}
static void loadLists(UPKGOptions *o, UErrorCode *status)
fprintf(stderr, "pkgdata: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\n\tBad path: '%s'\n", U_FILE_SEP_CHAR, s);
exit(U_ILLEGAL_ARGUMENT_ERROR);
}
- tmpLength = uprv_strlen(o->srcDir) +
+ tmpLength = uprv_strlen(o->srcDir) +
uprv_strlen(s) + 5; /* 5 is to add a little extra space for, among other things, PKGDATA_FILE_SEP_STRING */
if((tmp = (char *)uprv_malloc(tmpLength)) == NULL) {
fprintf(stderr, "pkgdata: Error: Unable to allocate tmp buffer size: %d\n", tmpLength);
icu::CharString cmdBuf;
UErrorCode status = U_ZERO_ERROR;
const char cmd[] = "icu-config --incpkgdatafile";
+#if _TIZEN_FEATURE_
+ const char cmdPath[] = "/usr/bin/icu-config --incpkgdatafile";
+#endif
char dirBuf[1024] = "";
/* #1 try the same path where pkgdata was called from. */
findDirname(progname, dirBuf, UPRV_LENGTHOF(dirBuf), &status);
if (cmdBuf[0] != 0) {
cmdBuf.append( U_FILE_SEP_STRING, status );
}
+#if _TIZEN_FEATURE_
+ else {
+ cmdBuf.append("/usr/bin/", status );
+ }
+#endif
+
cmdBuf.append( cmd, status );
-
+
if(verbose) {
fprintf(stdout, "# Calling icu-config: %s\n", cmdBuf.data());
}
if(p.isNull() || (n = fread(buf, 1, UPRV_LENGTHOF(buf)-1, p.getAlias())) <= 0) {
if(verbose) {
+#if _TIZEN_FEATURE_
+ fprintf(stdout, "# Calling icu-config: %s\n", cmdPath);
+#else
fprintf(stdout, "# Calling icu-config: %s\n", cmd);
+#endif
}
+#if _TIZEN_FEATURE_
+ p.adoptInstead(popen(cmdPath, "r"));
+#else
p.adoptInstead(popen(cmd, "r"));
+#endif
if(p.isNull() || (n = fread(buf, 1, UPRV_LENGTHOF(buf)-1, p.getAlias())) <= 0) {
fprintf(stderr, "%s: icu-config: No icu-config found. (fix PATH or use -O option)\n", progname);
return -1;