summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcommon/llprocess.cpp14
-rw-r--r--indra/llcommon/llprocess.h5
-rw-r--r--indra/llplugin/llpluginclassmedia.cpp4
-rw-r--r--indra/newview/llappviewer.cpp4
-rw-r--r--indra/newview/llviewermedia.cpp16
-rw-r--r--indra/newview/llvoicevivox.cpp6
6 files changed, 43 insertions, 6 deletions
diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp
index 2208b33b94..cf19e3aae9 100644
--- a/indra/llcommon/llprocess.cpp
+++ b/indra/llcommon/llprocess.cpp
@@ -691,10 +691,22 @@ LLProcess::LLProcess(const LLSDOrParams& params):
// terminate with a null pointer
argv.push_back(NULL);
+ // create an env vector for the child process
+ std::vector<const char*> envv;
+
+ // Add environment value assignments. See above remarks about c_str().
+ for (const std::string& env : params.envs)
+ {
+ envv.push_back(env.c_str());
+ }
+
+ // terminate with a null pointer
+ envv.push_back(NULL);
+
// Launch! The NULL would be the environment block, if we were passing
// one. Hand-expand chkapr() macro so we can fill in the actual command
// string instead of the variable names.
- if (ll_apr_warn_status(apr_proc_create(&mProcess, argv[0], &argv[0], NULL, procattr,
+ if (ll_apr_warn_status(apr_proc_create(&mProcess, argv[0], &argv[0], &envv[0], procattr,
mPool)))
{
LLTHROW(LLProcessError(STRINGIZE(params << " failed")));
diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h
index dcd316cb0f..4e7451c4a1 100644
--- a/indra/llcommon/llprocess.h
+++ b/indra/llcommon/llprocess.h
@@ -165,6 +165,7 @@ public:
Params():
executable("executable"),
args("args"),
+ envs("envs"),
cwd("cwd"),
autokill("autokill", true),
attached("attached", true),
@@ -182,6 +183,10 @@ public:
* argument while assembling the command line.
*/
Multiple<std::string> args;
+ /**
+ * zero or more additional command-line environment values.
+ */
+ Multiple<std::string> envs;
/// current working directory, if need it changed
Optional<std::string> cwd;
/// implicitly kill child process on termination of parent, whether
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index 3c5d216938..453223b43e 100644
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -33,7 +33,7 @@
#include "llpluginmessageclasses.h"
#include "llcontrol.h"
-#if LL_DARWIN || LL_LINUX
+#if LL_DARWIN || LL_LINUX || __FreeBSD__
extern LLControlGroup gSavedSettings;
#endif
#if LL_DARWIN
@@ -936,7 +936,7 @@ void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache
message.setValue("username", username); // cef shares cache between users but creates user-based contexts
message.setValue("cef_log_file", user_data_path_cef_log);
-#if LL_DARWIN || LL_LINUX
+#if LL_DARWIN || LL_LINUX || __FreeBSD__
bool cef_verbose_log = gSavedSettings.getBOOL("CefVerboseLog");
message.setValueBoolean("cef_verbose_log", cef_verbose_log);
#endif
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 12c2740e64..f46580c6c0 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -132,7 +132,7 @@
#include "stringize.h"
#include "llcoros.h"
#include "llexception.h"
-#if LL_DARWIN || LL_LINUX
+#if LL_DARWIN || LL_LINUX || __FreeBSD__
#include "cef/dullahan_version.h"
#endif
#include "vlc/libvlc_version.h"
@@ -3420,7 +3420,7 @@ LLSD LLAppViewer::getViewerInfo() const
info["VOICE_VERSION"] = LLTrans::getString("NotConnected");
}
-#if LL_DARWIN || LL_LINUX
+#if LL_DARWIN || LL_LINUX || __FreeBSD__
std::ostringstream cef_ver_codec;
cef_ver_codec << "Dullahan: ";
cef_ver_codec << DULLAHAN_VERSION_MAJOR;
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index c8b7a9c29b..e86cb7ab39 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1719,6 +1719,13 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
{
std::string launcher_name = gDirUtilp->getLLPluginLauncher();
std::string plugin_name = gDirUtilp->getLLPluginFilename(plugin_basename);
+#if __FreeBSD__
+ if (plugin_basename == "media_plugin_cef")
+ {
+ launcher_name = "/compat/linux/usr/libexec/megapahit/SLPlugin";
+ plugin_name = "/compat/linux/usr/lib/x86_64-linux-gnu/libmedia_plugin_cef.so";
+ }
+#endif
std::string user_data_path_cache = gDirUtilp->getCacheDir(false);
user_data_path_cache += gDirUtilp->getDirDelimiter();
@@ -1779,7 +1786,16 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
media_source->setTarget(target);
+#if __FreeBSD__
+ std::string plugin_dir = gDirUtilp->getLLPluginDir();
+ if (plugin_basename == "media_plugin_cef")
+ {
+ plugin_dir = "/compat/linux/usr/lib/x86_64-linux-gnu";
+ plugin_name = "/usr/lib/x86_64-linux-gnu/libmedia_plugin_cef.so";
+ }
+#else
const std::string plugin_dir = gDirUtilp->getLLPluginDir();
+#endif
if (media_source->init(launcher_name, plugin_dir, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins")))
{
return media_source;
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 2034727ac0..673a760a81 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -948,11 +948,15 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
// vivox executable exists. Build the command line and launch the daemon.
LLProcess::Params params;
#if LL_LINUX || __FreeBSD__
+#if __FreeBSD__
+ params.envs.add("WINEARCH=win32");
+ params.envs.add("WINEPREFIX=~/.i386-wine-pkg");
+#endif // __FreeBSD__
params.executable = "wine";
params.args.add(exe_path);
#else
params.executable = exe_path;
-#endif
+#endif // LL_LINUX || __FreeBSD__
// VOICE-88: Cycle through [portbase..portbase+portrange) on
// successive tries because attempting to relaunch (after manually