diff options
author | Don Kjer <don@lindenlab.com> | 2012-10-24 18:19:22 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2012-10-24 18:19:22 +0000 |
commit | 27933214f41e369337fc83ec7a9ecb2a9cdbaeee (patch) | |
tree | ccec5eeebd243fed4ede877a00ee65dc538e5a86 | |
parent | 7f025073771b808b65f85e5f2e67e0944e903c33 (diff) |
Switching to system osmesa library instead of pre-packaged library
-rw-r--r-- | autobuild.xml | 28 | ||||
-rw-r--r-- | indra/cmake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | indra/cmake/ConfigurePkgConfig.cmake | 74 | ||||
-rw-r--r-- | indra/cmake/LLWindow.cmake | 1 | ||||
-rw-r--r-- | indra/cmake/OpenGL.cmake | 1 | ||||
-rw-r--r-- | indra/cmake/Variables.cmake | 25 |
6 files changed, 97 insertions, 33 deletions
diff --git a/autobuild.xml b/autobuild.xml index 415858d274..5d30c662b6 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1290,9 +1290,9 @@ <key>archive</key> <map> <key>hash</key> - <string>57598f72d41ea0f3c2b4ed4804856636</string> + <string>adf0a54dab1bbd9ffc7b8d20173f72d6</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/266096/arch/Linux/installer/llappearanceutility_source-0.1-linux-20121019.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/266247/arch/Linux/installer/llappearanceutility_source-0.1-linux-20121024.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1453,30 +1453,6 @@ </map> </map> </map> - <key>mesa</key> - <map> - <key>license</key> - <string>mesa</string> - <key>license_file</key> - <string>LICENSES/mesa.txt</string> - <key>name</key> - <string>mesa</string> - <key>platforms</key> - <map> - <key>linux</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>621ec29861ddac6614668b2b00c0ea8e</string> - <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-mesa/rev/265524/arch/Linux/installer/mesa-7.11.1-linux-20121004.tar.bz2</string> - </map> - <key>name</key> - <string>linux</string> - </map> - </map> - </map> <key>ndofdev</key> <map> <key>license</key> diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index bee7a1b7c3..a21fa90950 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -15,6 +15,7 @@ set(cmake_SOURCE_FILES BuildVersion.cmake CARes.cmake CMakeCopyIfDifferent.cmake + ConfigurePkgConfig.cmake CURL.cmake Copy3rdPartyLibs.cmake DBusGlib.cmake diff --git a/indra/cmake/ConfigurePkgConfig.cmake b/indra/cmake/ConfigurePkgConfig.cmake new file mode 100644 index 0000000000..82ee3e7a5b --- /dev/null +++ b/indra/cmake/ConfigurePkgConfig.cmake @@ -0,0 +1,74 @@ +# -*- cmake -*- + +SET(DEBUG_PKG_CONFIG "YES") + +# Don't change this if manually set by user. +IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") + + # Guess at architecture-specific system library paths. + if (WORD_SIZE EQUAL 32) + SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib32 /usr/lib) + SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib32 /usr/local/lib) + SET(PKG_CONFIG_MULTI_GUESS /usr/lib/i386-linux-gnu) + SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/i386-linux-gnu) + else (WORD_SIZE EQUAL 32) + SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib) + SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib) + SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu) + SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu) + endif (WORD_SIZE EQUAL 32) + + # Use DPKG architecture, if available. + IF (${DPKG_ARCH}) + SET(PKG_CONFIG_MULTI_GUESS /usr/lib/${DPKG_ARCH}) + SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usrlocal/lib/${DPKG_ARCH}) + ENDIF (${DPKG_ARCH}) + + # Explicitly include anything listed in PKG_CONFIG_PATH + string(REPLACE ":" ";" PKG_CONFIG_PATH_LIST "$ENV{PKG_CONFIG_PATH}") + FOREACH(PKG_CONFIG_DIR ${PKG_CONFIG_PATH_LIST}) + SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_DIR}/pkgconfig") + ENDFOREACH(PKG_CONFIG_DIR) + + # Look for valid pkgconfig directories. + FIND_PATH(PKG_CONFIG_ENV pkgconfig ENV LD_LIBRARY_PATH) + FIND_PATH(PKG_CONFIG_MULTI pkgconfig HINT ${PKG_CONFIG_MULTI_GUESS}) + FIND_PATH(PKG_CONFIG_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_MULTI_LOCAL_GUESS}) + FIND_PATH(PKG_CONFIG_NO_MULTI pkgconfig HINT ${PKG_CONFIG_NO_MULTI_GUESS}) + FIND_PATH(PKG_CONFIG_NO_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_NO_MULTI_LOCAL_GUESS}) + + # Add anything we found to our list. + IF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND) + SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_ENV}/pkgconfig") + ENDIF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND) + + IF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND) + SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI}/pkgconfig") + ENDIF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND) + + IF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND) + SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI_LOCAL}/pkgconfig") + ENDIF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND) + + IF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND) + SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI}/pkgconfig") + ENDIF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND) + + IF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND) + SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI_LOCAL}/pkgconfig") + ENDIF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND) + + # Also add some non-architecture specific package locations. + SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:/usr/share/pkgconfig:/usr/local/share/pkgconfig") + + # Remove first unwanted ':' + string(SUBSTRING ${VALID_PKG_LIBDIRS} 1 -1 VALID_PKG_LIBDIRS) + + # Set PKG_CONFIG_LIBDIR environment. + SET(ENV{PKG_CONFIG_LIBDIR} ${VALID_PKG_LIBDIRS}) +ENDIF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") + +IF(DEBUG_PKG_CONFIG) + MESSAGE(STATUS "Using PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}") +ENDIF(DEBUG_PKG_CONFIG) + diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index f6c40c174c..0def507e65 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -14,7 +14,6 @@ if (STANDALONE) SDL_LIBRARY ) else (STANDALONE) - use_prebuilt_binary(mesa) if (LINUX) use_prebuilt_binary(SDL) set (SDL_FOUND TRUE) diff --git a/indra/cmake/OpenGL.cmake b/indra/cmake/OpenGL.cmake index 742d8e25a0..2259c99293 100644 --- a/indra/cmake/OpenGL.cmake +++ b/indra/cmake/OpenGL.cmake @@ -4,7 +4,6 @@ include(Variables) include(Prebuilt) if (BUILD_HEADLESS) - use_prebuilt_binary(mesa) SET(OPENGL_glu_LIBRARY GLU) SET(OPENGL_HEADLESS_LIBRARIES OSMesa16 dl GLU) endif (BUILD_HEADLESS) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 895b3003db..54c77da64e 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -70,10 +70,6 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(LINUX ON BOOl FORCE) - if (INSTALL_PROPRIETARY) - set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") - endif (INSTALL_PROPRIETARY) - # If someone has specified a word size, use that to determine the # architecture. Otherwise, let the architecture specify the word size. if (WORD_SIZE EQUAL 32) @@ -97,18 +93,37 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (WORD_SIZE EQUAL 32) set(DEB_ARCHITECTURE i386) + set(FIND_LIBRARY_USE_LIB64_PATHS OFF) + set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib32 ${CMAKE_SYSTEM_LIBRARY_PATH}) else (WORD_SIZE EQUAL 32) set(DEB_ARCHITECTURE amd64) + set(FIND_LIBRARY_USE_LIB64_PATHS ON) endif (WORD_SIZE EQUAL 32) - execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH RESULT_VARIABLE DPKG_RESULT OUTPUT_VARIABLE DPKG_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) + execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH + RESULT_VARIABLE DPKG_RESULT + OUTPUT_VARIABLE DPKG_ARCH + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) #message (STATUS "DPKG_RESULT ${DPKG_RESULT}, DPKG_ARCH ${DPKG_ARCH}") if (DPKG_RESULT EQUAL 0) set(CMAKE_LIBRARY_ARCHITECTURE ${DPKG_ARCH}) + set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/${DPKG_ARCH} /usr/local/lib/${DPKG_ARCH} ${CMAKE_SYSTEM_LIBRARY_PATH}) endif (DPKG_RESULT EQUAL 0) + include(ConfigurePkgConfig) + set(LL_ARCH ${ARCH}_linux) set(LL_ARCH_DIR ${ARCH}-linux) + + if (INSTALL_PROPRIETARY) + # Only turn on headless if we can find osmesa libraries. + include(FindPkgConfig) + pkg_check_modules(OSMESA osmesa) + if (OSMESA_FOUND) + set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") + endif (OSMESA_FOUND) + endif (INSTALL_PROPRIETARY) + endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |