static const char* __TIZEN_API_PATH_KEY = "db/dotnet/tizen_api_path";
static const char* __TIZEN_RID_VERSION_KEY = "db/dotnet/tizen_rid_version";
+static const char* __TIZEN_TFM_SUPPORT_KEY = "db/dotnet/tizen_tfm_support";
#define __XSTR(x) #x
#define __STR(x) __XSTR(x)
// 3. OS(tizen, linux, unix) + Architecture
// 4. OS(tizen, linux, unix)
// 5. any, base
-static std::string getExtraNativeLibDirs(const std::string& appRoot)
+static std::string getRidFallbackGraphDirs(const std::string& appRoot)
{
std::vector<std::string> RID_FALLBACK_GRAPH;
char* tizen_rid = vconf_get_str(__TIZEN_RID_VERSION_KEY);
candidate += concatPath(appRoot, "bin/runtimes/" + RID_FALLBACK_GRAPH[i] + "/native");
}
+ return candidate;
+}
+
+// 1. /appRoot/runtimes/{Platform}-{Architecture}/native/xxxxx.so
+// 2. /appRoot/lib/{Architecture}/xxxxx.so
+static std::string getExtraNativeLibDirs(const std::string& appRoot)
+{
+ std::string candidate = getRidFallbackGraphDirs(appRoot);
+
candidate = candidate + ":" + concatPath(appRoot, "lib/" ARCHITECTURE_IDENTIFIER);
if (!strncmp(ARCHITECTURE_IDENTIFIER, "arm64", 5)) {
candidate = candidate + ":" + concatPath(appRoot, "lib/aarch64");
return candidate;
}
+// 1. /appRoot/runtimes/{Platform}-{Architecture}/lib/{TFMs}/xxxxx.dll
+static std::string getExtraTfmDirs(const std::string& appRoot)
+{
+ std::string candidate;
+ std::vector<std::string> tfmList;
+ char* tizen_tfm = vconf_get_str(__TIZEN_TFM_SUPPORT_KEY);
+ if (tizen_tfm) {
+ splitPath(tizen_tfm, tfmList);
+ free(tizen_tfm);
+ }
+
+ std::vector<std::string> paths;
+ splitPath(replaceAll(getRidFallbackGraphDirs(appRoot), "/native", "/lib"), paths);
+
+ if (tfmList.empty() || paths.empty())
+ return candidate;
+
+ std::vector<std::string> tfmDirectoryList;
+ for (unsigned int i = 0; i < paths.size(); i++) {
+ for (unsigned int j = 0; j < tfmList.size(); j++) {
+ tfmDirectoryList.push_back(concatPath(paths[i], tfmList[j]));
+ }
+ }
+
+ for (unsigned int i = 0; i < tfmDirectoryList.size(); i++) {
+ if (!candidate.empty()) {
+ candidate += ":";
+ }
+ candidate += tfmDirectoryList[i];
+ }
+
+ return candidate;
+}
+
void PathManager::updateAppRelatedPath(const std::string& appRootPath)
{
std::string appBinPath = concatPath(appRootPath, "bin");
std::string appLibPath = concatPath(appRootPath, "lib");
appTacPath = concatPath(appBinPath, TAC_SYMLINK_SUB_DIR);
- appPaths = appRootPath + ":" + appBinPath + ":" + appLibPath + ":" + appTacPath;
+ appPaths = appRootPath + ":" + appBinPath + ":" + appLibPath + ":" + appTacPath + ":" + getExtraTfmDirs(appRootPath);
appNIPaths = concatPath(appBinPath, APP_NI_SUB_DIR) + ":" + concatPath(appLibPath, APP_NI_SUB_DIR) + ":"+ appTacPath;
nativeDllSearchingPaths = runtimePath + ":" + __NATIVE_LIB_DIR + ":" + getExtraNativeLibDirs(appRootPath) + ":" + appBinPath + ":" + appLibPath;
}