From 5a5a5e8d35fb36151e3c687d728b0113a9f67234 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 28 Jun 2011 04:52:49 +1000 Subject: Build libgpg-error and libgcrypt under linux, for OTR. There is still a problem, the linux compile script (number 3) will bomb out at the link stage, but simply starting it again it runs fine. This was too much work, and it's way past my bed time. It works, so commiting it now, and fixing that problem later. Still could use some cleaning up to. --- linden/indra/CMakeLists.txt | 7 ++++- linden/indra/cmake/libgcrypt.cmake | 4 ++- linden/indra/cmake/libgpg-error.cmake | 4 ++- linden/indra/libgcrypt/CMakeLists.txt | 52 +++++++++++++++++++++++++++----- linden/indra/libgpg-error/CMakeLists.txt | 46 +++++++++++++++++++++++++--- linden/indra/libotr/CMakeLists.txt | 10 ++++-- linden/indra/newview/CMakeLists.txt | 45 ++++++++++++++------------- 7 files changed, 129 insertions(+), 39 deletions(-) (limited to 'linden') diff --git a/linden/indra/CMakeLists.txt b/linden/indra/CMakeLists.txt index 2085ea1..e3b5fa8 100644 --- a/linden/indra/CMakeLists.txt +++ b/linden/indra/CMakeLists.txt @@ -46,7 +46,8 @@ endif (WINDOWS) # if off will use the systems libotr.so but won't be fully compatible with windows version set(STATIC_LIBOTR_ETC 1) -add_subdirectory(${LIBS_OPEN_PREFIX}libotr) +add_subdirectory(${LIBS_OPEN_PREFIX}libgpg-error) +add_subdirectory(${LIBS_OPEN_PREFIX}libgcrypt) # [/$PLOTR$] add_subdirectory(${LIBS_OPEN_PREFIX}llaudio) @@ -63,6 +64,10 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llvfs) add_subdirectory(${LIBS_OPEN_PREFIX}llwindow) add_subdirectory(${LIBS_OPEN_PREFIX}llxml) +# [$PLOTR$] +add_subdirectory(${LIBS_OPEN_PREFIX}libotr) +# [/$PLOTR$] + add_subdirectory(${LIBS_OPEN_PREFIX}lscript) if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) diff --git a/linden/indra/cmake/libgcrypt.cmake b/linden/indra/cmake/libgcrypt.cmake index 0134618..6ac93b9 100644 --- a/linden/indra/cmake/libgcrypt.cmake +++ b/linden/indra/cmake/libgcrypt.cmake @@ -1,8 +1,10 @@ # -*- cmake -*- set(LIBGCRYPT_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/../libgcrypt/libgcrypt-1.2.2/include ) set(LIBGCRYPT_LIBRARIES - libgcrypt + ${CMAKE_CURRENT_SOURCE_DIR}/../libgcrypt/libgcrypt-1.2.2/lib ) + diff --git a/linden/indra/cmake/libgpg-error.cmake b/linden/indra/cmake/libgpg-error.cmake index 71deeaa..e2df9f7 100644 --- a/linden/indra/cmake/libgpg-error.cmake +++ b/linden/indra/cmake/libgpg-error.cmake @@ -1,8 +1,10 @@ # -*- cmake -*- set(LIBGPG-ERROR_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/../libgpg-error/libgpg-error-1.0/include ) set(LIBGPG-ERROR_LIBRARIES - libgpg-error + ${CMAKE_CURRENT_SOURCE_DIR}/../libgpg-error/libgpg-error-1.0/lib ) + diff --git a/linden/indra/libgcrypt/CMakeLists.txt b/linden/indra/libgcrypt/CMakeLists.txt index 6c7446c..31c547f 100644 --- a/linden/indra/libgcrypt/CMakeLists.txt +++ b/linden/indra/libgcrypt/CMakeLists.txt @@ -2,6 +2,11 @@ project(libgcrypt) +include(00-Common) +include(libgpg-error) +include(libgcrypt) +include(Linking) + if (WINDOWS) include_directories( ../gpg.vs/inc.vs @@ -11,13 +16,6 @@ if (WINDOWS) libgcrypt-1.2.2/mpi libgcrypt-1.2.2/mpi/generic ) -else (WINDOWS) - include_directories( - libgcrypt-1.2.2/src - libgcrypt-1.2.2/mpi - libgcrypt-1.2.2/mpi/generic - ) -endif (WINDOWS) set(libgcrypt_SOURCE_FILES libgcrypt-1.2.2/src/ath.c @@ -116,6 +114,46 @@ set_source_files_properties(${libgcrypt_HEADER_FILES} list(APPEND libgcrypt_SOURCE_FILES ${libgcrypt_HEADER_FILES}) add_library (libgcrypt ${libgcrypt_SOURCE_FILES}) + +else (WINDOWS) + +include(ExternalProject) + + include_directories( + ${LIBGPG-ERROR_INCLUDE_DIRS} + libgcrypt-1.2.2/src + libgcrypt-1.2.2/mpi + libgcrypt-1.2.2/mpi/generic + libgcrypt-1.2.2 + ) + +# Gotta fake a DOWNLOAD_COMMAND to work around a bug in cmake before 2.8.3. +externalproject_add(EP_libgcrypt + DEPENDS EP_libgpg-error + DOWNLOAD_COMMAND "" + PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/../libgcrypt/libgcrypt-1.2.2 + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libgcrypt/libgcrypt-1.2.2 + CONFIGURE_COMMAND /configure -prefix= --with-gpg-error-prefix=${CMAKE_CURRENT_SOURCE_DIR}/../libgpg-error/libgpg-error-1.0 + BUILD_COMMAND ${MAKE} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make install + ) + +link_directories(${LIBGCRYPT_LIBRARIES}) +include_directories(${LIBGCRYPT_INCLUDE_DIRS}) + +add_library(libgcrypt STATIC IMPORTED) + +set_target_properties(libgcrypt PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../libgcrypt/libgcrypt-1.2.2/lib/libgcrypt.a + ) + +# This wont work until 2.8.4 sigh +#add_dependencies(libgcrypt EP_libgcrypt) + +endif (WINDOWS) + target_link_libraries( libgcrypt ) + diff --git a/linden/indra/libgpg-error/CMakeLists.txt b/linden/indra/libgpg-error/CMakeLists.txt index 6548a83..a595ab8 100644 --- a/linden/indra/libgpg-error/CMakeLists.txt +++ b/linden/indra/libgpg-error/CMakeLists.txt @@ -2,17 +2,17 @@ project(libgpg-error) +include(00-Common) +include(libgpg-error) +include(Linking) + if (WINDOWS) + include_directories( ../gpg.vs/inc.vs ../gpg.vs/libgpg-error-1.1.vs/custom libgpg-error-1.0/src ) -else (WINDOWS) - include_directories( - libgpg-error-1.0/src - ) -endif (WINDOWS) set(libgpg-error_SOURCE_FILES libgpg-error-1.0/src/code-from-errno.c @@ -40,6 +40,42 @@ set_source_files_properties(${libgpg-error_HEADER_FILES} list(APPEND libgpg-error_SOURCE_FILES ${libgpg-error_HEADER_FILES}) add_library (libgpg-error ${libgpg-error_SOURCE_FILES}) + +else (WINDOWS) + +include(ExternalProject) + + include_directories( + libgpg-error-1.0/src + libgpg-error-1.0 + ) + +# Gotta fake a DOWNLOAD_COMMAND to work around a bug in cmake before 2.8.3. +externalproject_add(EP_libgpg-error + DOWNLOAD_COMMAND "" + PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/../libgpg-error/libgpg-error-1.0 + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libgpg-error/libgpg-error-1.0 + CONFIGURE_COMMAND /configure -prefix= + BUILD_COMMAND ${MAKE} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make install + ) + +link_directories(${LIBGPG-ERROR_LIBRARIES}) +include_directories(${LIBGPG-ERROR_INCLUDE_DIRS}) + +add_library(libgpg-error STATIC IMPORTED) + +#set_target_properties(libgpg-error PROPERTIES +# IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../libgpg-error/libgpg-error-1.0/lib/libgpg-error.a +# ) + +# This wont work until 2.8.4 sigh +#add_dependencies(libgpg-error EP_libgpg-error) + +endif (WINDOWS) + target_link_libraries( libgpg-error ) + diff --git a/linden/indra/libotr/CMakeLists.txt b/linden/indra/libotr/CMakeLists.txt index f81e71a..b9da8f1 100644 --- a/linden/indra/libotr/CMakeLists.txt +++ b/linden/indra/libotr/CMakeLists.txt @@ -1,5 +1,7 @@ # -*- cmake -*- +project(libgpg-error) +project(libgcrypt) project(libotr) if (WINDOWS) @@ -12,7 +14,8 @@ if (WINDOWS) ) else (WINDOWS) include_directories( - ../libgpg-error/libgpg-error-1.0/src + ${LIBGPG-ERROR_INCLUDE_DIRS} + ${LIBGCRYPT_INCLUDE_DIRS} ../libgcrypt/libgcrypt-1.2.2/src ) endif (WINDOWS) @@ -56,6 +59,7 @@ set_source_files_properties(${libotr_HEADER_FILES} list(APPEND libotr_SOURCE_FILES ${libotr_HEADER_FILES}) add_library (libotr ${libotr_SOURCE_FILES}) -target_link_libraries( - libotr +target_link_libraries(libotr + gcrypt + gpg-error ) diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index e729e6c..cdc2a9a 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -15,6 +15,24 @@ include(HUNSPELL) include(FindOpenGL) include(JsonCpp) include(LLAddBuildTest) + +# [$PLOTR$] +include(libgpg-error) +include(libgcrypt) + +if (WINDOWS) + include(libotr) + # on windows always build libotr from source and statically link in libgcrypt and libgpg-error +endif (WINDOWS) +if (DARWIN OR LINUX) + if (STATIC_LIBOTR_ETC) + include(libotr) # to build libotr from source and statically link in libgcrypt and libgpg-error + else (STATIC_LIBOTR_ETC) + include(libotrb) + endif (STATIC_LIBOTR_ETC) +endif (DARWIN OR LINUX) +# [/$PLOTR$] + include(LLAudio) include(LLCharacter) include(LLCommon) @@ -43,23 +61,6 @@ if (WINDOWS) include(CopyWinLibs) endif (WINDOWS) -# [$PLOTR$] -include(libgcrypt) -include(libgpg-error) - -if (WINDOWS) - include(libotr) - # on windows always build libotr from source and statically link in libgcrypt and libgpg-error -endif (WINDOWS) -if (DARWIN OR LINUX) - if (STATIC_LIBOTR_ETC) - include(libotr) # to build libotr from source and statically link in libgcrypt and libgpg-error - else (STATIC_LIBOTR_ETC) - include(libotrb) - endif (STATIC_LIBOTR_ETC) -endif (DARWIN OR LINUX) -# [/$PLOTR$] - include_directories( ${DBUSGLIB_INCLUDE_DIRS} ${HUNSPELL_INCLUDE_DIR} @@ -1072,13 +1073,13 @@ if (LINUX) # [$PLOTR$] if (STATIC_LIBOTR_ETC) # defined in .../linden/indra/CMakeLists.txt set(viewer_LIBRARIES - Xinerama - gpg-error - gcrypt # to build libotr from source and statically link in libgcrypt and libgpg-error + Xinerama + #gpg-error + #gcrypt # to build libotr from source and statically link in libgcrypt and libgpg-error ) else (STATIC_LIBOTR_ETC) # below for dynamically linked, unmodified libotr set(viewer_LIBRARIES - Xinerama + Xinerama ) endif (STATIC_LIBOTR_ETC) # [/$PLOTR$] @@ -1449,6 +1450,8 @@ if (WINDOWS) else (WINDOWS) if (STATIC_LIBOTR_ETC) set(otr_link_libs ${LIBOTR_LIBRARIES} + ${LIBGCRYPT_LIBRARIES} + ${LIBGPG-ERROR_LIBRARIES} ) # statically linked libotr, built from source else (STATIC_LIBOTR_ETC) set(otr_link_libs ${OTR_LIBRARY} -- cgit v1.1