From 61e05f912557e3086cd80a10075aeaa6586519be Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Mon, 22 Sep 2014 20:01:55 +0300 Subject: MAINT-4170 Eliminate homoglyphs in URL hostnames: used 3p-uriparser; --- indra/cmake/CMakeLists.txt | 2 ++ indra/cmake/FindURIPARSER.cmake | 46 +++++++++++++++++++++++++++++++++++++++++ indra/cmake/URIPARSER.cmake | 22 ++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 indra/cmake/FindURIPARSER.cmake create mode 100644 indra/cmake/URIPARSER.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 10a23ea068..9abdb4b146 100755 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -37,6 +37,7 @@ set(cmake_SOURCE_FILES FindNDOF.cmake FindOpenJPEG.cmake FindSCP.cmake + FindURIPARSER.cmake FindXmlRpcEpi.cmake FindZLIB.cmake FMODEX.cmake @@ -97,6 +98,7 @@ set(cmake_SOURCE_FILES Tut.cmake UI.cmake UnixInstall.cmake + URIPARSER.cmake Variables.cmake ViewerMiscLibs.cmake VisualLeakDetector.cmake diff --git a/indra/cmake/FindURIPARSER.cmake b/indra/cmake/FindURIPARSER.cmake new file mode 100644 index 0000000000..32457bcd60 --- /dev/null +++ b/indra/cmake/FindURIPARSER.cmake @@ -0,0 +1,46 @@ +# -*- cmake -*- + +# - Find uriparser +# Find the URIPARSER includes and library +# This module defines +# URIPARSER_INCLUDE_DIRS, where to find uriparser.h, etc. +# URIPARSER_LIBRARIES, the libraries needed to use uriparser. +# URIPARSER_FOUND, If false, do not try to use uriparser. +# +# This FindURIPARSER is about 43 times as fast the one provided with cmake (2.8.x), +# because it doesn't look up the version of uriparser, resulting in a dramatic +# speed up for configure (from 4 minutes 22 seconds to 6 seconds). +# +# Note: Since this file is only used for standalone, the windows +# specific parts were left out. + +FIND_PATH(URIPARSER_INCLUDE_DIR uriparser/uri.h + NO_SYSTEM_ENVIRONMENT_PATH + ) + +FIND_LIBRARY(URIPARSER_LIBRARY z) + +if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR) + SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR}) + SET(URIPARSER_LIBRARIES ${URIPARSER_LIBRARY}) + SET(URIPARSER_FOUND "YES") +else (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR) + SET(URIPARSER_FOUND "NO") +endif (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR) + +if (URIPARSER_FOUND) + if (NOT URIPARSER_FIND_QUIETLY) + message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARIES}") + SET(URIPARSER_FIND_QUIETLY TRUE) + endif (NOT URIPARSER_FIND_QUIETLY) +else (URIPARSER_FOUND) + if (URIPARSER_FIND_REQUIRED) + message(FATAL_ERROR "Could not find URIPARSER library") + endif (URIPARSER_FIND_REQUIRED) +endif (URIPARSER_FOUND) + +mark_as_advanced( + URIPARSER_LIBRARY + URIPARSER_INCLUDE_DIR + ) + diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake new file mode 100644 index 0000000000..477e142ce5 --- /dev/null +++ b/indra/cmake/URIPARSER.cmake @@ -0,0 +1,22 @@ +# -*- cmake -*- + +set(URIPARSER_FIND_QUIETLY ON) +set(URIPARSER_FIND_REQUIRED ON) + +include(Prebuilt) + +if (STANDALONE) + include(FindURIPARSER) +else (STANDALONE) + use_prebuilt_binary(uriparser) + if (WINDOWS) + set(URIPARSER_LIBRARIES + debug uriparserd + optimized uriparser) + else (WINDOWS) + set(URIPARSER_LIBRARIES z) + endif (WINDOWS) + if (WINDOWS OR LINUX) + set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser) + endif (WINDOWS OR LINUX) +endif (STANDALONE) -- cgit v1.2.3 From 454a4a2905198b884947e9a3d37dba2e480480da Mon Sep 17 00:00:00 2001 From: Savchenko Maksym Date: Wed, 24 Sep 2014 03:36:00 +0300 Subject: MAINT-4482 FIXED [viewer-lion] Mac build fails due to weirdo LLTextBase::normalizeUri() issue --- indra/cmake/FindURIPARSER.cmake | 2 +- indra/cmake/URIPARSER.cmake | 31 ++++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/FindURIPARSER.cmake b/indra/cmake/FindURIPARSER.cmake index 32457bcd60..8ab9f0f4ed 100644 --- a/indra/cmake/FindURIPARSER.cmake +++ b/indra/cmake/FindURIPARSER.cmake @@ -18,7 +18,7 @@ FIND_PATH(URIPARSER_INCLUDE_DIR uriparser/uri.h NO_SYSTEM_ENVIRONMENT_PATH ) -FIND_LIBRARY(URIPARSER_LIBRARY z) +FIND_LIBRARY(URIPARSER_LIBRARY uriparser) if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR) SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR}) diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index 477e142ce5..d726c2ffdf 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -5,18 +5,31 @@ set(URIPARSER_FIND_REQUIRED ON) include(Prebuilt) -if (STANDALONE) +if (USESYSTEMLIBS) include(FindURIPARSER) -else (STANDALONE) +else (USESYSTEMLIBS) use_prebuilt_binary(uriparser) if (WINDOWS) - set(URIPARSER_LIBRARIES + set(URIPARSER_LIBRARIES. debug uriparserd optimized uriparser) - else (WINDOWS) - set(URIPARSER_LIBRARIES z) + elseif (LINUX) + # + # When we have updated static libraries in competition with older + # shared libraries and we want the former to win, we need to do some + # extra work. The *_PRELOAD_ARCHIVES settings are invoked early + # and will pull in the entire archive to the binary giving it. + # priority in symbol resolution. Beware of cmake moving the + # achive load itself to another place on the link command line. If + # that happens, you can try something like -Wl,-luriparser here to hide + # the archive. Also be aware that the linker will not tolerate a + # second whole-archive load of the archive. See viewer's + # CMakeLists.txt for more information. + # + set(URIPARSER_PRELOAD_ARCHIVES -Wl,--whole-archive uriparser -Wl,--no-whole-archive) + set(URIPARSER_LIBRARIES uriparser) + elseif (DARWIN) + set(URIPARSER_LIBRARIES uriparser) endif (WINDOWS) - if (WINDOWS OR LINUX) - set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser) - endif (WINDOWS OR LINUX) -endif (STANDALONE) + set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser) +endif (USESYSTEMLIBS) -- cgit v1.2.3 From f0fa1961a8833fe4d6bb1f5a6c879d238ae7f263 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 24 Sep 2014 04:20:36 +0300 Subject: MAINT-4482 FIXED [viewer-lion] Mac build fails due to weirdo LLTextBase::normalizeUri() issue: windows build fix --- indra/cmake/URIPARSER.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/URIPARSER.cmake b/indra/cmake/URIPARSER.cmake index d726c2ffdf..de146885a0 100644 --- a/indra/cmake/URIPARSER.cmake +++ b/indra/cmake/URIPARSER.cmake @@ -10,7 +10,7 @@ if (USESYSTEMLIBS) else (USESYSTEMLIBS) use_prebuilt_binary(uriparser) if (WINDOWS) - set(URIPARSER_LIBRARIES. + set(URIPARSER_LIBRARIES debug uriparserd optimized uriparser) elseif (LINUX) -- cgit v1.2.3