diff options
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 103 | ||||
-rw-r--r-- | indra/cmake/LLKDU.cmake | 19 | ||||
-rw-r--r-- | indra/integration_tests/llui_libtest/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/llimage/CMakeLists.txt | 1 | ||||
-rw-r--r-- | indra/llimage/llimage.cpp | 2 | ||||
-rw-r--r-- | indra/llimage/llimagej2c.cpp | 162 | ||||
-rw-r--r-- | indra/llimage/llimagej2c.h | 2 | ||||
-rw-r--r-- | indra/newview/CMakeLists.txt | 18 | ||||
-rw-r--r-- | install.xml | 19 |
9 files changed, 74 insertions, 254 deletions
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index e852cf463c..176ae9787e 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -60,22 +60,6 @@ if(WINDOWS) set(release_files ${release_files} fmod.dll) endif (FMOD) - #******************************* - # LLKDU - set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") - if(NOT EXISTS ${internal_llkdu_path}) - if (EXISTS "${debug_src_dir}/llkdu.dll") - set(debug_llkdu_src "${debug_src_dir}/llkdu.dll") - set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/llkdu.dll") - endif (EXISTS "${debug_src_dir}/llkdu.dll") - - if (EXISTS "${release_src_dir}/llkdu.dll") - set(release_llkdu_src "${release_src_dir}/llkdu.dll") - set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/llkdu.dll") - set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/llkdu.dll") - endif (EXISTS "${release_src_dir}/llkdu.dll") - endif (NOT EXISTS ${internal_llkdu_path}) - #******************************* # Copy MS C runtime dlls, required for packaging. # *TODO - Adapt this to support VC9 @@ -174,21 +158,6 @@ elseif(DARWIN) # fmod is statically linked on darwin set(fmod_files "") - #******************************* - # LLKDU - set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") - if(NOT EXISTS ${internal_llkdu_path}) - if (EXISTS "${debug_src_dir}/libllkdu.dylib") - set(debug_llkdu_src "${debug_src_dir}/libllkdu.dylib") - set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/libllkdu.dylib") - endif (EXISTS "${debug_src_dir}/libllkdu.dylib") - - if (EXISTS "${release_src_dir}/libllkdu.dylib") - set(release_llkdu_src "${release_src_dir}/libllkdu.dylib") - set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.dylib") - set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.dylib") - endif (EXISTS "${release_src_dir}/libllkdu.dylib") - endif (NOT EXISTS ${internal_llkdu_path}) elseif(LINUX) # linux is weird, multiple side by side configurations aren't supported # and we don't seem to have any debug shared libs built yet anyways... @@ -242,21 +211,6 @@ elseif(LINUX) set(release_files ${release_files} "libfmod-3.75.so") endif (FMOD) - #******************************* - # LLKDU - set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") - if(NOT EXISTS ${internal_llkdu_path}) - if (EXISTS "${debug_src_dir}/libllkdu.so") - set(debug_llkdu_src "${debug_src_dir}/libllkdu.so") - set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/libllkdu.so") - endif (EXISTS "${debug_src_dir}/libllkdu.so") - - if (EXISTS "${release_src_dir}/libllkdu.so") - set(release_llkdu_src "${release_src_dir}/libllkdu.so") - set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.so") - set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.so") - endif (EXISTS "${release_src_dir}/libllkdu.so") - endif(NOT EXISTS ${internal_llkdu_path}) else(WINDOWS) message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...") set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") @@ -334,40 +288,29 @@ copy_if_different( ) set(third_party_targets ${third_party_targets} ${out_targets}) -#******************************* -# LLKDU -set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") -if(NOT EXISTS ${internal_llkdu_path}) - if (EXISTS "${debug_llkdu_src}") - ADD_CUSTOM_COMMAND( - OUTPUT ${debug_llkdu_dst} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst} - DEPENDS ${debug_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_DEBUG}" - ) - set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst}) - endif (EXISTS "${debug_llkdu_src}") - - if (EXISTS "${release_llkdu_src}") - ADD_CUSTOM_COMMAND( - OUTPUT ${release_llkdu_dst} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst} - DEPENDS ${release_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELEASE}" - ) - set(third_party_targets ${third_party_targets} ${release_llkdu_dst}) - - ADD_CUSTOM_COMMAND( - OUTPUT ${relwithdebinfo_llkdu_dst} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst} - DEPENDS ${release_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" - ) - set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst}) - endif (EXISTS "${release_llkdu_src}") - -endif (NOT EXISTS ${internal_llkdu_path}) - +if (FMOD_SDK_DIR) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/Debug" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/Release" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) +endif (FMOD_SDK_DIR) if(NOT STANDALONE) add_custom_target( diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 27c8ada686..25703ee785 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -1,7 +1,24 @@ # -*- cmake -*- include(Prebuilt) +# USE_KDU can be set when launching cmake or develop.py as an option using the argument -DUSE_KDU:BOOL=ON +# When building using proprietary binaries though (i.e. having access to LL private servers), we always build with KDU if (INSTALL_PROPRIETARY AND NOT STANDALONE) + set(USE_KDU ON) +endif (INSTALL_PROPRIETARY AND NOT STANDALONE) + +if (USE_KDU) use_prebuilt_binary(kdu) + if (WINDOWS) + set(KDU_LIBRARY debug kdu_cored optimized kdu_core) + else (WINDOWS) + set(KDU_LIBRARY kdu) + endif (WINDOWS) + + set(KDU_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) + set(LLKDU_LIBRARY llkdu) -endif (INSTALL_PROPRIETARY AND NOT STANDALONE) + set(LLKDU_STATIC_LIBRARY llkdu_static) + set(LLKDU_LIBRARIES ${LLKDU_LIBRARY}) + set(LLKDU_STATIC_LIBRARIES ${LLKDU_STATIC_LIBRARY}) +endif (USE_KDU) diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt index 452d37d3be..2a00dbee6f 100644 --- a/indra/integration_tests/llui_libtest/CMakeLists.txt +++ b/indra/integration_tests/llui_libtest/CMakeLists.txt @@ -71,6 +71,8 @@ endif (DARWIN) target_link_libraries(llui_libtest llui llmessage + ${LLIMAGE_LIBRARIES} + ${LLIMAGEJ2COJ_LIBRARIES} ${OS_LIBRARIES} ${GOOGLE_PERFTOOLS_LIBRARIES} ) diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index a69621a57b..6834267d4b 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -57,7 +57,6 @@ add_library (llimage ${llimage_SOURCE_FILES}) # Sort by high-level to low-level target_link_libraries(llimage llcommon - llimagej2coj # *HACK: In theory a noop for KDU builds? ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 5c33b675ca..b46a99e030 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -52,13 +52,11 @@ LLMutex* LLImage::sMutex = NULL; void LLImage::initClass() { sMutex = new LLMutex(NULL); - LLImageJ2C::openDSO(); } //static void LLImage::cleanupClass() { - LLImageJ2C::closeDSO(); delete sMutex; sMutex = NULL; } diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 08a5912c57..2b4a2935e9 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -24,9 +24,6 @@ */ #include "linden_common.h" -#include "apr_pools.h" -#include "apr_dso.h" - #include "lldir.h" #include "llimagej2c.h" #include "llmemtype.h" @@ -37,18 +34,10 @@ typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)(); typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*); typedef const char* (*EngineInfoLLImageJ2CFunction)(); -//some "private static" variables so we only attempt to load -//dynamic libaries once -CreateLLImageJ2CFunction j2cimpl_create_func; -DestroyLLImageJ2CFunction j2cimpl_destroy_func; -EngineInfoLLImageJ2CFunction j2cimpl_engineinfo_func; -apr_pool_t *j2cimpl_dso_memory_pool; -apr_dso_handle_t *j2cimpl_dso_handle; - -//Declare the prototype for theses functions here, their functionality -//will be implemented in other files which define a derived LLImageJ2CImpl -//but only ONE static library which has the implementation for this -//function should ever be included +// Declare the prototype for theses functions here. Their functionality +// will be implemented in other files which define a derived LLImageJ2CImpl +// but only ONE static library which has the implementation for these +// functions should ever be included. LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl(); void fallbackDestroyLLImageJ2CImpl(LLImageJ2CImpl* impl); const char* fallbackEngineInfoLLImageJ2CImpl(); @@ -58,120 +47,9 @@ LLImageCompressionTester* LLImageJ2C::sTesterp = NULL ; const std::string sTesterName("ImageCompressionTester"); //static -//Loads the required "create", "destroy" and "engineinfo" functions needed -void LLImageJ2C::openDSO() -{ - //attempt to load a DSO and get some functions from it - std::string dso_name; - std::string dso_path; - - bool all_functions_loaded = false; - apr_status_t rv; - -#if LL_WINDOWS - dso_name = "llkdu.dll"; -#elif LL_DARWIN - dso_name = "libllkdu.dylib"; -#else - dso_name = "libllkdu.so"; -#endif - - dso_path = gDirUtilp->findFile(dso_name, - gDirUtilp->getAppRODataDir(), - gDirUtilp->getExecutableDir()); - - j2cimpl_dso_handle = NULL; - j2cimpl_dso_memory_pool = NULL; - - //attempt to load the shared library - apr_pool_create(&j2cimpl_dso_memory_pool, NULL); - rv = apr_dso_load(&j2cimpl_dso_handle, - dso_path.c_str(), - j2cimpl_dso_memory_pool); - - //now, check for success - if ( rv == APR_SUCCESS ) - { - //found the dynamic library - //now we want to load the functions we're interested in - CreateLLImageJ2CFunction create_func = NULL; - DestroyLLImageJ2CFunction dest_func = NULL; - EngineInfoLLImageJ2CFunction engineinfo_func = NULL; - - rv = apr_dso_sym((apr_dso_handle_sym_t*)&create_func, - j2cimpl_dso_handle, - "createLLImageJ2CKDU"); - if ( rv == APR_SUCCESS ) - { - //we've loaded the create function ok - //we need to delete via the DSO too - //so lets check for a destruction function - rv = apr_dso_sym((apr_dso_handle_sym_t*)&dest_func, - j2cimpl_dso_handle, - "destroyLLImageJ2CKDU"); - if ( rv == APR_SUCCESS ) - { - //we've loaded the destroy function ok - rv = apr_dso_sym((apr_dso_handle_sym_t*)&engineinfo_func, - j2cimpl_dso_handle, - "engineInfoLLImageJ2CKDU"); - if ( rv == APR_SUCCESS ) - { - //ok, everything is loaded alright - j2cimpl_create_func = create_func; - j2cimpl_destroy_func = dest_func; - j2cimpl_engineinfo_func = engineinfo_func; - all_functions_loaded = true; - } - } - } - } - - if ( !all_functions_loaded ) - { - //something went wrong with the DSO or function loading.. - //fall back onto our satefy impl creation function - -#if 0 - // precious verbose debugging, sadly we can't use our - // 'llinfos' stream etc. this early in the initialisation seq. - char errbuf[256]; - fprintf(stderr, "failed to load syms from DSO %s (%s)\n", - dso_name.c_str(), dso_path.c_str()); - apr_strerror(rv, errbuf, sizeof(errbuf)); - fprintf(stderr, "error: %d, %s\n", rv, errbuf); - apr_dso_error(j2cimpl_dso_handle, errbuf, sizeof(errbuf)); - fprintf(stderr, "dso-error: %d, %s\n", rv, errbuf); -#endif - - if ( j2cimpl_dso_handle ) - { - apr_dso_unload(j2cimpl_dso_handle); - j2cimpl_dso_handle = NULL; - } - - if ( j2cimpl_dso_memory_pool ) - { - apr_pool_destroy(j2cimpl_dso_memory_pool); - j2cimpl_dso_memory_pool = NULL; - } - } -} - -//static -void LLImageJ2C::closeDSO() -{ - if ( j2cimpl_dso_handle ) apr_dso_unload(j2cimpl_dso_handle); - if (j2cimpl_dso_memory_pool) apr_pool_destroy(j2cimpl_dso_memory_pool); -} - -//static std::string LLImageJ2C::getEngineInfo() { - if (!j2cimpl_engineinfo_func) - j2cimpl_engineinfo_func = fallbackEngineInfoLLImageJ2CImpl; - - return j2cimpl_engineinfo_func(); + return fallbackEngineInfoLLImageJ2CImpl(); } LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C), @@ -181,20 +59,7 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C), mReversible(FALSE), mAreaUsedForDataSizeCalcs(0) { - //We assume here that if we wanted to create via - //a dynamic library that the approriate open calls were made - //before any calls to this constructor. - - //Therefore, a NULL creation function pointer here means - //we either did not want to create using functions from the dynamic - //library or there were issues loading it, either way - //use our fall back - if ( !j2cimpl_create_func ) - { - j2cimpl_create_func = fallbackCreateLLImageJ2CImpl; - } - - mImpl = j2cimpl_create_func(); + mImpl = fallbackCreateLLImageJ2CImpl(); // Clear data size table for( S32 i = 0; i <= MAX_DISCARD_LEVEL; i++) @@ -216,22 +81,9 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C), // virtual LLImageJ2C::~LLImageJ2C() { - //We assume here that if we wanted to destroy via - //a dynamic library that the approriate open calls were made - //before any calls to this destructor. - - //Therefore, a NULL creation function pointer here means - //we either did not want to destroy using functions from the dynamic - //library or there were issues loading it, either way - //use our fall back - if ( !j2cimpl_destroy_func ) - { - j2cimpl_destroy_func = fallbackDestroyLLImageJ2CImpl; - } - if ( mImpl ) { - j2cimpl_destroy_func(mImpl); + fallbackDestroyLLImageJ2CImpl(mImpl); } } diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index 3933c9236f..007f3ddd2d 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -72,8 +72,6 @@ public: static S32 calcHeaderSizeJ2C(); static S32 calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate = 0.f); - static void openDSO(); - static void closeDSO(); static std::string getEngineInfo(); // Image compression/decompression tester diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 09622d3af5..2515321a6c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1444,11 +1444,6 @@ if (WINDOWS) # In the meantime, if you have any ideas on how to easily maintain one list, either here or in viewer_manifest.py # and have the build deps get tracked *please* tell me about it. - if(LLKDU_LIBRARY) - # Configure a var for llkdu which may not exist for all builds. - set(LLKDU_DLL_SOURCE ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llkdu.dll) - endif(LLKDU_LIBRARY) - if(USE_GOOGLE_PERFTOOLS) # Configure a var for tcmalloc location, if used. # Note the need to specify multiple names explicitly. @@ -1465,7 +1460,6 @@ if (WINDOWS) #${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libtcmalloc_minimal.dll => None ... Skipping libtcmalloc_minimal.dll ${CMAKE_SOURCE_DIR}/../etc/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg - ${LLKDU_DLL_SOURCE} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapr-1.dll ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libaprutil-1.dll @@ -1644,7 +1638,6 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLAUDIO_LIBRARIES} ${LLCHARACTER_LIBRARIES} ${LLIMAGE_LIBRARIES} - ${LLIMAGEJ2COJ_LIBRARIES} ${LLINVENTORY_LIBRARIES} ${LLMESSAGE_LIBRARIES} ${LLPLUGIN_LIBRARIES} @@ -1680,6 +1673,17 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${GOOGLE_PERFTOOLS_LIBRARIES} ) +if (LLKDU_LIBRARY) + target_link_libraries(${VIEWER_BINARY_NAME} + ${LLKDU_STATIC_LIBRARIES} + ${KDU_LIBRARY} + ) +else (LLKDU_LIBRARY) + target_link_libraries(${VIEWER_BINARY_NAME} + ${LLIMAGEJ2COJ_LIBRARIES} + ) +endif (LLKDU_LIBRARY) + build_version(viewer) set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH diff --git a/install.xml b/install.xml index 391d83b224..db148f1c61 100644 --- a/install.xml +++ b/install.xml @@ -830,23 +830,30 @@ <key>darwin</key> <map> <key>md5sum</key> - <string>ae18dd120807a46ac961b881a631ad94</string> + <string>3b40e7170dea82c1443e8d90cd44a13d</string> <key>url</key> - <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/indra_private-2.1.1-darwin-20100820.tar.bz2</uri> + <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/kdu-4.2.1-darwin-20080926.tar.bz2</uri> </map> <key>linux</key> <map> <key>md5sum</key> - <string>b1f15bbabb68445e55ce23a2aeaca598</string> + <string>a6d2f0995c25d7f53bd12b8ec0d6b462</string> <key>url</key> - <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/indra_private-2.1.1-linux-20100826.tar.bz2</uri> + <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/kdu-4.2.1-linux-20080930.tar.bz2</uri> + </map> + <key>linux64</key> + <map> + <key>md5sum</key> + <string>f4e2e2b3440594527729a8c85119e508</string> + <key>url</key> + <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/kdu-5.2.1-linux64-20080926.tar.bz2</uri> </map> <key>windows</key> <map> <key>md5sum</key> - <string>0e2fe621ce99085eba00d86d9a3bc130</string> + <string>1b9f61140f8b599cdae5e00d21dbb177</string> <key>url</key> - <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/indra_private-2.1.1-windows-20100820.tar.bz2</uri> + <uri>scp:install-packages.lindenlab.com:/local/www/install-packages/doc/kdu-4.2.1-windows-20080926.tar.bz2</uri> </map> </map> </map> |