From 4f817c0543ed20e4655198e0a05a8019fa795ee7 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Wed, 12 Jul 2023 15:09:44 +0800
Subject: Linux filesystem dir can still be used for FreeBSD

---
 indra/llfilesystem/lldir_linux.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/llfilesystem')

diff --git a/indra/llfilesystem/lldir_linux.h b/indra/llfilesystem/lldir_linux.h
index e83a020ba4..8c4d42f025 100644
--- a/indra/llfilesystem/lldir_linux.h
+++ b/indra/llfilesystem/lldir_linux.h
@@ -24,7 +24,7 @@
  * $/LicenseInfo$
  */
 
-#if !LL_LINUX
+#if !LL_LINUX && !LL_FREEBSD
 #error This header must not be included when compiling for any target other than Linux. Consider including lldir.h instead.
 #endif // !LL_LINUX
 
-- 
cgit v1.2.3


From b8952a7df228abd03783665ece0e91e2f0fd63bd Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Wed, 12 Jul 2023 20:37:38 +0800
Subject: FreeBSD can use lldir_linux too

---
 indra/llfilesystem/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/llfilesystem')

diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt
index 9f24f75eab..23193a30ea 100644
--- a/indra/llfilesystem/CMakeLists.txt
+++ b/indra/llfilesystem/CMakeLists.txt
@@ -30,7 +30,7 @@ if (DARWIN)
   LIST(APPEND llfilesystem_HEADER_FILES lldir_mac.h)
 endif (DARWIN)
 
-if (LINUX)
+if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   LIST(APPEND llfilesystem_SOURCE_FILES lldir_linux.cpp)
   LIST(APPEND llfilesystem_HEADER_FILES lldir_linux.h)
 
@@ -40,7 +40,7 @@ if (LINUX)
                                 "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\""
                                 )
   endif (INSTALL)
-endif (LINUX)
+endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
 
 if (WINDOWS)
   LIST(APPEND llfilesystem_SOURCE_FILES lldir_win32.cpp)
-- 
cgit v1.2.3


From 665a55a1a232877ccb499dbfd17806f438385e82 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sat, 29 Jul 2023 21:07:13 +0800
Subject: The Linden libraries can be installed now

Useful when installed as shared libraries, so other viewer executables
can share these libraries.
---
 indra/llfilesystem/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'indra/llfilesystem')

diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt
index 23193a30ea..6e9cec9085 100644
--- a/indra/llfilesystem/CMakeLists.txt
+++ b/indra/llfilesystem/CMakeLists.txt
@@ -56,6 +56,8 @@ target_link_libraries(llfilesystem
     )
 target_include_directories( llfilesystem  INTERFACE   ${CMAKE_CURRENT_SOURCE_DIR})
 
+include(LibraryInstall)
+
 # Add tests
 if (LL_TESTS)
     include(LLAddBuildTest)
-- 
cgit v1.2.3


From e08ad14176502a8cc26b401c48b7161ce8c39140 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sun, 30 Jul 2023 19:02:54 +0800
Subject: SLPlugin is in libexec when installed to system

---
 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 6e9cec9085..9a69a833c0 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_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\" -DAPP_LIBEXEC_DIR=\\\"${APP_LIBEXEC_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 80ad05345a..300cab39d6 100644
--- a/indra/llfilesystem/lldir_linux.cpp
+++ b/indra/llfilesystem/lldir_linux.cpp
@@ -83,7 +83,11 @@ LLDir_Linux::LLDir_Linux()
 
 	mExecutableFilename = "";
 	mExecutablePathAndName = "";
+#ifdef APP_LIBEXEC_DIR
+	mExecutableDir = APP_LIBEXEC_DIR;
+#else
 	mExecutableDir = tmp_str;
+#endif
 	mWorkingDir = tmp_str;
 #ifdef APP_RO_DATA_DIR
 	mAppRODataDir = APP_RO_DATA_DIR;
-- 
cgit v1.2.3


From 00dc394684356a21d02a798f9ad098587381d142 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sat, 26 Aug 2023 16:39:32 +0800
Subject: Certificate authority bundle gets installed too

When I tried using, for example, FBSD system's ca-root-nss.crt, at
runtime, the viewer would fail at downloading textures, avatar names,
and so on. So for now we're still relying on LLCA, it's just get
installed automatically without having to track the file in the viewer
project.
---
 indra/llfilesystem/lldir_linux.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/llfilesystem')

diff --git a/indra/llfilesystem/lldir_linux.cpp b/indra/llfilesystem/lldir_linux.cpp
index 300cab39d6..7e8fe157ba 100644
--- a/indra/llfilesystem/lldir_linux.cpp
+++ b/indra/llfilesystem/lldir_linux.cpp
@@ -209,7 +209,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
 		LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
 	}
 
-	mCAFile = getExpandedFilename(LL_PATH_EXECUTABLE, "ca-bundle.crt");
+	mCAFile = add(mAppRODataDir, "ca-bundle.crt");
 }
 
 U32 LLDir_Linux::countFilesInDir(const std::string &dirname, const std::string &mask)
-- 
cgit v1.2.3