From 3b18f813a81582628fe886b551024dc08a4b2450 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 22 Nov 2010 22:41:42 -0800
Subject: [PATCH] STORM-151 : Attempt to fix Windows static linking, simplified
 manifest

---
 indra/CMakeLists.txt             |  5 +---
 indra/cmake/LLKDU.cmake          |  2 +-
 indra/llkdu/CMakeLists.txt       | 21 -------------
 indra/newview/viewer_manifest.py | 51 ++++++++++----------------------
 4 files changed, 17 insertions(+), 62 deletions(-)

diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 8d4969a49ea..a8716b10f16 100644
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -40,6 +40,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
 add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
 add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
 add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
+add_subdirectory(${LIBS_OPEN_PREFIX}llkdu)
 add_subdirectory(${LIBS_OPEN_PREFIX}llimagej2coj)
 add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
 add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
@@ -50,10 +51,6 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
 add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
 add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
 
-if (EXISTS ${LIBS_CLOSED_DIR}llkdu)
-  add_subdirectory(${LIBS_CLOSED_PREFIX}llkdu)
-endif (EXISTS ${LIBS_CLOSED_DIR}llkdu)
-
 add_subdirectory(${LIBS_OPEN_PREFIX}lscript)
 
 if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake
index e80b2353767..f5cbad03a61 100644
--- a/indra/cmake/LLKDU.cmake
+++ b/indra/cmake/LLKDU.cmake
@@ -10,7 +10,7 @@ endif (INSTALL_PROPRIETARY AND NOT STANDALONE)
 if (USE_KDU)
   use_prebuilt_binary(kdu)
   if (WINDOWS)
-    set(KDU_LIBRARY debug kdud.lib optimized kdu.lib)
+    set(KDU_LIBRARY kdu.lib)
   else (WINDOWS)
     set(KDU_LIBRARY libkdu.a)
   endif (WINDOWS)
diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt
index fe590c98f8c..b8b44b44fca 100644
--- a/indra/llkdu/CMakeLists.txt
+++ b/indra/llkdu/CMakeLists.txt
@@ -39,28 +39,7 @@ set_source_files_properties(${llkdu_HEADER_FILES}
 
 list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES})
 
-#if (WINDOWS)
-  # This turns off the warning about flow control ending in a destructor.
-#  set_source_files_properties(
-#      kdu_image.cpp llkdumem.cpp 
-#      PROPERTIES
-#      COMPILE_FLAGS "/wd4702 /wd4722"
-#      )
-
-  # This turns off the warning about sprintf in the following 2 files.
-#  set_source_files_properties(
-#      kde_flow_control.cpp kdc_flow_control.cpp
-#      PROPERTIES
-#      COMPILE_FLAGS /D_CRT_SECURE_NO_DEPRECATE
-#      )
-#endif (WINDOWS)
-
 if (USE_KDU)
   add_library (${LLKDU_LIBRARIES} ${llkdu_SOURCE_FILES})
   
-#  target_link_libraries(
-#        ${LLKDU_LIBRARY}
-#        ${LLMATH_LIBRARIES}
-#        ${KDU_LIBRARY}
-#        )
 endif (USE_KDU)
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 6861f02bfba..370dc3af8a4 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -253,12 +253,6 @@ def construct(self):
 
             self.enable_crt_manifest_check()
 
-            # Get kdu dll, continue if missing.
-            try:
-                self.path('llkdu.dll', dst='llkdu.dll')
-            except RuntimeError:
-                print "Skipping llkdu.dll"
-
             # Get llcommon and deps. If missing assume static linkage and continue.
             try:
                 self.path('llcommon.dll')
@@ -621,21 +615,21 @@ def construct(self):
                 libdir = "../../libraries/universal-darwin/lib_release"
                 dylibs = {}
 
-                # need to get the kdu dll from any of the build directories as well
-                for lib in "llkdu", "llcommon":
-                    libfile = "lib%s.dylib" % lib
-                    try:
-                        self.path(self.find_existing_file(os.path.join(os.pardir,
-                                                                       lib,
-                                                                       self.args['configuration'],
-                                                                       libfile),
-                                                          os.path.join(libdir, libfile)),
-                                  dst=libfile)
-                    except RuntimeError:
-                        print "Skipping %s" % libfile
-                        dylibs[lib] = False
-                    else:
-                        dylibs[lib] = True
+                # Need to get the llcommon dll from any of the build directories as well
+                lib = "llcommon"
+                libfile = "lib%s.dylib" % lib
+                try:
+                    self.path(self.find_existing_file(os.path.join(os.pardir,
+                                                                    lib,
+                                                                    self.args['configuration'],
+                                                                    libfile),
+                                                      os.path.join(libdir, libfile)),
+                                                      dst=libfile)
+                except RuntimeError:
+                    print "Skipping %s" % libfile
+                    dylibs[lib] = False
+                else:
+                    dylibs[lib] = True
 
                 if dylibs["llcommon"]:
                     for libfile in ("libapr-1.0.3.7.dylib",
@@ -906,15 +900,6 @@ class Linux_i686Manifest(LinuxManifest):
     def construct(self):
         super(Linux_i686Manifest, self).construct()
 
-        # install either the libllkdu we just built, or a prebuilt one, in
-        # decreasing order of preference.  for linux package, this goes to bin/
-        try:
-            self.path(self.find_existing_file('../llkdu/libllkdu.so',
-                '../../libraries/i686-linux/lib_release_client/libllkdu.so'),
-                  dst='bin/libllkdu.so')
-        except:
-            print "Skipping libllkdu.so - not found"
-
         if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"):
             self.path("libapr-1.so.0")
             self.path("libaprutil-1.so.0")
@@ -930,12 +915,6 @@ def construct(self):
             self.path("libalut.so")
             self.path("libopenal.so", "libopenal.so.1")
             self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname
-            try:
-                    self.path("libkdu.so")
-                    pass
-            except:
-                    print "Skipping libkdu.so - not found"
-                    pass
             try:
                     self.path("libfmod-3.75.so")
                     pass
-- 
GitLab