From a106d6cf78833a3e24f8d478807f6363e4af5652 Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Mon, 29 Mar 2021 21:30:40 +0300
Subject: SL-13182 Turn on openmp paralellization on Windows

---
 indra/cmake/00-Common.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/cmake')

diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 8aea50e02b..289d65e975 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -72,10 +72,10 @@ if (WINDOWS)
   endif()
 
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO 
-      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo"
+      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /openmp /Zo"
       CACHE STRING "C++ compiler release-with-debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELEASE
-      "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo"
+      "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /openmp /Zo"
       CACHE STRING "C++ compiler release options" FORCE)
   # zlib has assembly-language object files incompatible with SAFESEH
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099")
-- 
cgit v1.2.3


From c2711f2d763cfbf96d8db48b0809dd7a6e65a73e Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Wed, 31 Mar 2021 23:46:08 +0300
Subject: Revert "SL-13182 Turn on openmp paralellization on Windows"

This reverts commit a106d6cf78833a3e24f8d478807f6363e4af5652.
---
 indra/cmake/00-Common.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/cmake')

diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 289d65e975..8aea50e02b 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -72,10 +72,10 @@ if (WINDOWS)
   endif()
 
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO 
-      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /openmp /Zo"
+      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo"
       CACHE STRING "C++ compiler release-with-debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELEASE
-      "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /openmp /Zo"
+      "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo"
       CACHE STRING "C++ compiler release options" FORCE)
   # zlib has assembly-language object files incompatible with SAFESEH
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099")
-- 
cgit v1.2.3


From f729cfc33f258781c5fd85a3d8773bf6149d12db Mon Sep 17 00:00:00 2001
From: Bennett Goble <signal@lindenlab.com>
Date: Sat, 5 Jun 2021 22:02:54 -0700
Subject: SL-15742: Convert build scripts to Python 3

This changeset makes it possible to build the Second Life viewer using
Python 3. It is designed to be used with an equivalent Autobuild branch
so that a developer can compile without needing Python 2 on their
machine.

Breaking change: Python 2 support ending

Rather than supporting two versions of Python, including one that was
discontinued at the beginning of the year, this branch focuses on
pouring future effort into Python 3 only. As a result, scripts do not
need to be backwards compatible. This means that build environments,
be they on personal computers and on build agents, need to have a
compatible interpreter.

Notes

- SLVersionChecker will still use Python 2 on macOS
- Fixed the message template url used by template_verifier.py
---
 indra/cmake/Python.cmake      | 48 +++++++++++++------------------------------
 indra/cmake/Variables.cmake   |  2 +-
 indra/cmake/run_build_test.py | 18 ++++++++--------
 3 files changed, 23 insertions(+), 45 deletions(-)

(limited to 'indra/cmake')

diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake
index a81c9307fc..ed595f6966 100644
--- a/indra/cmake/Python.cmake
+++ b/indra/cmake/Python.cmake
@@ -6,47 +6,27 @@ if (WINDOWS)
   # On Windows, explicitly avoid Cygwin Python.
 
   find_program(PYTHON_EXECUTABLE
-    NAMES python25.exe python23.exe python.exe
+    NAMES python.exe
     NO_DEFAULT_PATH # added so that cmake does not find cygwin python
     PATHS
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
-    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
-    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
-    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
-    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
-    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
-    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
-    )
-elseif (EXISTS /etc/debian_version)
-  # On Debian and Ubuntu, avoid Python 2.4 if possible.
-
-  find_program(PYTHON_EXECUTABLE python PATHS /usr/bin)
-
-  if (PYTHON_EXECUTABLE)
-    set(PYTHONINTERP_FOUND ON)
-  endif (PYTHON_EXECUTABLE)
-elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-  # On MAC OS X be sure to search standard locations first
-
-  string(REPLACE ":" ";" PATH_LIST "$ENV{PATH}")
-  find_program(PYTHON_EXECUTABLE
-    NAMES python python25 python24 python23
-    NO_DEFAULT_PATH # Avoid searching non-standard locations first
-    PATHS
-    /bin
-    /usr/bin
-    /usr/local/bin
-    ${PATH_LIST}
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
+    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
+    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
+    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
+    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
     )
+    include(FindPythonInterp)
+else()
+  find_program(PYTHON_EXECUTABLE python3)
 
   if (PYTHON_EXECUTABLE)
     set(PYTHONINTERP_FOUND ON)
   endif (PYTHON_EXECUTABLE)
-else (WINDOWS)
-  include(FindPythonInterp)
 endif (WINDOWS)
 
 if (NOT PYTHON_EXECUTABLE)
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index c81b22e572..e72475cbc4 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -60,7 +60,7 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
   set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries")
 endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
 set(TEMPLATE_VERIFIER_OPTIONS "" CACHE STRING "Options for scripts/template_verifier.py")
-set(TEMPLATE_VERIFIER_MASTER_URL "http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg" CACHE STRING "Location of the master message template")
+set(TEMPLATE_VERIFIER_MASTER_URL "https://bitbucket.org/lindenlab/master-message-template-git/raw/master/message_template.msg" CACHE STRING "Location of the master message template")
 
 if (NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
index ec5d33f902..1e92868ae7 100755
--- a/indra/cmake/run_build_test.py
+++ b/indra/cmake/run_build_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """\
 @file   run_build_test.py
 @author Nat Goodspeed
@@ -17,7 +17,7 @@ line.
 
 Example:
 
-python run_build_test.py -DFOO=bar myprog somearg otherarg
+python3 run_build_test.py -DFOO=bar myprog somearg otherarg
 
 sets environment variable FOO=bar, then runs:
 myprog somearg otherarg
@@ -47,7 +47,7 @@ $/LicenseInfo$
 import os
 import sys
 import errno
-import HTMLParser
+import html.parser
 import re
 import signal
 import subprocess
@@ -111,10 +111,10 @@ def main(command, arguments=[], libpath=[], vars={}):
     # Now handle arbitrary environment variables. The tricky part is ensuring
     # that all the keys and values we try to pass are actually strings.
     if vars:
-        for key, value in vars.items():
+        for key, value in list(vars.items()):
             # As noted a few lines above, facilitate copy-paste rerunning.
             log.info("%s='%s' \\" % (key, value))
-    os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()]))
+    os.environ.update(dict([(str(key), str(value)) for key, value in vars.items()]))
     # Run the child process.
     command_list = [command]
     command_list.extend(arguments)
@@ -177,7 +177,7 @@ def translate_rc(rc):
         try:
             table = get_windows_table()
             symbol, desc = table[hexrc]
-        except Exception, err:
+        except Exception as err:
             log.error("(%s -- carrying on)" % err)
             log.error("terminated with rc %s (%s)" % (rc, hexrc))
         else:
@@ -194,7 +194,7 @@ def translate_rc(rc):
             strc = str(rc)
         return "terminated by signal %s" % strc
 
-class TableParser(HTMLParser.HTMLParser):
+class TableParser(html.parser.HTMLParser):
     """
     This HTMLParser subclass is designed to parse the table we know exists
     in windows-rcs.html, hopefully without building in too much knowledge of
@@ -204,9 +204,7 @@ class TableParser(HTMLParser.HTMLParser):
     whitespace = re.compile(r'\s*$')
 
     def __init__(self):
-        # Because Python 2.x's HTMLParser is an old-style class, we must use
-        # old-style syntax to forward the __init__() call -- not super().
-        HTMLParser.HTMLParser.__init__(self)
+        super().__init__()
         # this will collect all the data, eventually
         self.table = []
         # Stack whose top (last item) indicates where to append current
-- 
cgit v1.2.3


From 38e77cb958cc88dd75e4d06994c0c93953692f83 Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Tue, 11 Jan 2022 21:13:17 +0200
Subject: SL-16614 Viewer's uploader crash with RenderGLCoreProfile

---
 indra/cmake/GLOD.cmake | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'indra/cmake')

diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake
index a347eb6fee..6f42b44ab8 100644
--- a/indra/cmake/GLOD.cmake
+++ b/indra/cmake/GLOD.cmake
@@ -5,5 +5,7 @@ if (NOT USESYSTEMLIBS)
   use_prebuilt_binary(glod)
 endif (NOT USESYSTEMLIBS)
 
+set(GLODLIB ON CACHE BOOL "Using GLOD library")
+
 set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
 set(GLOD_LIBRARIES GLOD)
-- 
cgit v1.2.3