Skip to content

Commit

Permalink
#1: do not include prog dir in library path on android to avoid clash…
Browse files Browse the repository at this point in the history
…es with system libs
  • Loading branch information
andreas committed Feb 22, 2024
1 parent b4fe6eb commit fcfafa9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions provider/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ else()
message("openssl...")
#find_package(OpenSSL REQUIRED CONFIG) #already included by curl
target_link_libraries(${TARGET} PRIVATE openssl::crypto )
#package openssl
target_link_libraries(${TARGET} PRIVATE openssl::ssl )
endif()

#filesystem
Expand Down
13 changes: 11 additions & 2 deletions provider/src/OexControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class OexConfig{
bool fprStdout;
String preload;
String socketAddress;
bool setLibPath;
NameValueMap environment;
};

Expand All @@ -159,14 +160,16 @@ class OexConfig{
String("liboexserverd.so"),
true,
String(""),
String("com.opencpn.ocharts_pi")
String("com.opencpn.ocharts_pi"),
false
};
#else
static OexConfig oexconfig={
String("oexserverd"),
false,
String("libpreload.so"),
String("com.opencpn.ocharts_pi"),
true,
{{String(TEST_PIPE_ENV),String("LOCAL:com.opencpn.ocharts_pi")}}
};
#endif
Expand Down Expand Up @@ -237,7 +240,13 @@ StartResult runOexServerd(const OexConfig &config,const String &progDir,const St
putenv(StringHelper::cloneData(StringHelper::format("%s=%s",it->first.c_str(),it->second.c_str())));
}
putenv(StringHelper::cloneData(StringHelper::format("%s=%d",ENV_AVNAV_PID,parent)));
putenv(StringHelper::cloneData(StringHelper::format("LD_LIBRARY_PATH=%s",progDir)));
if (config.setLibPath){
LOG_DEBUG("setting LD_LIBRARY_PATH to %s",progDir);
putenv(StringHelper::cloneData(StringHelper::format("LD_LIBRARY_PATH=%s",progDir)));
}
else{
unsetenv("LD_LIBRARY_PATH");
}
if (config.preload != String("") && usePreload){
String preload=FileHelper::concatPath(progDir,oexconfig.preload);
putenv(StringHelper::cloneData(StringHelper::format("%s=%s","LD_PRELOAD",preload.c_str())));
Expand Down

0 comments on commit fcfafa9

Please sign in to comment.