From b0e28d27bd990393e22ca3f474c340e77a08357b Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Mon, 18 Dec 2023 20:42:30 +0800
Subject: Unix install sets plugin dir to system library dir

because (at least) the vlc/plugins dirs are inside it in the same way
it's been inside llplugin. This is so the app can find system VLC
plugins. And for this, BUILD_SHARED_LIBS set on must work first on Linux
(has already been working on FreeBSD), since libmedia_plugin_libvlc is a
shared library (which now gets installed to system library dir too, on
both OSes).
---
 indra/llfilesystem/CMakeLists.txt  | 2 +-
 indra/llfilesystem/lldir_linux.cpp | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

(limited to 'indra/llfilesystem')

diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt
index 9a69a833c0..7db1971460 100644
--- a/indra/llfilesystem/CMakeLists.txt
+++ b/indra/llfilesystem/CMakeLists.txt
@@ -37,7 +37,7 @@ if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   if (INSTALL)
     set_source_files_properties(lldir_linux.cpp
                                 PROPERTIES COMPILE_FLAGS
-                                "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\" -DAPP_LIBEXEC_DIR=\\\"${APP_LIBEXEC_DIR}\\\""
+				"-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\" -DAPP_LIBEXEC_DIR=\\\"${APP_LIBEXEC_DIR}\\\" -DAPP_PLUGIN_DIR=\\\"${INSTALL_LIBRARY_DIR}\\\""
                                 )
   endif (INSTALL)
 endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
diff --git a/indra/llfilesystem/lldir_linux.cpp b/indra/llfilesystem/lldir_linux.cpp
index 7e8fe157ba..c343728505 100644
--- a/indra/llfilesystem/lldir_linux.cpp
+++ b/indra/llfilesystem/lldir_linux.cpp
@@ -137,7 +137,11 @@ LLDir_Linux::LLDir_Linux()
 		}
 	}
 
+#ifdef APP_PLUGIN_DIR
+	mLLPluginDir = APP_PLUGIN_DIR;
+#else
 	mLLPluginDir = mExecutableDir + mDirDelimiter + "llplugin";
+#endif
 
 	// *TODO: don't use /tmp, use $HOME/.secondlife/tmp or something.
 	mTempDir = "/tmp";
-- 
cgit v1.2.3