From 351894a23f52e14307f617cfa37b38228e7f5790 Mon Sep 17 00:00:00 2001 From: aleajactaest Date: Tue, 8 Oct 2019 07:37:56 +0200 Subject: [PATCH] Resolve "error when build with static option on debian buster" --- .gitlab-ci.yml | 112 ++++++++++++++++++++++++++--- code/CMakeLists.txt | 3 +- code/CMakeModules/FindMySQL.cmake | 9 +++ code/CMakeModules/Findgnutls.cmake | 71 ++++++++++++++++++ 4 files changed, 183 insertions(+), 12 deletions(-) create mode 100644 code/CMakeModules/Findgnutls.cmake diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8323a6963..8ed3a2085 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,8 +19,10 @@ # gitlab-runner exec docker --timeout=3600 'Linux client build' # gitlab-runner exec docker --timeout=3600 'Linux server debian_amd64_strech build' # gitlab-runner exec docker --timeout=3600 'Linux server_static debian_amd64_strech build' +# gitlab-runner exec docker --timeout=3600 'Linux server_static_debug debian_amd64_buster build' # gitlab-runner exec docker --timeout=3600 'Linux server debian_amd64_buster build' # gitlab-runner exec docker --timeout=3600 'Linux client debian_amd64_strech build' +# gitlab-runner exec docker --timeout=3600 'Linux client_static_debug debian_i386_strech build' # gitlab-runner exec docker --timeout=3600 --docker-volumes $PWD/builds:/builds 'Linux client debian_amd64_buster build' # gitlab-runner exec docker --timeout=3600 --docker-volumes $PWD/builds:/builds 'Linux client_appimage debian_amd64_buster build' # gitlab-runner exec docker --timeout=3600 'Linux client_static debian_amd64_strech build' @@ -158,6 +160,7 @@ Linux server debian_amd64_strech build: libfreetype6-dev libx11-dev libgl1-mesa-dev + libgnutls28-dev libxxf86vm-dev libxrandr-dev libxrender-dev @@ -225,6 +228,7 @@ Linux server debian_amd64_strech build: - code/ryzom/client/windows - code/ryzom/tools/scripts/linux # expire_in: 2 week + when: manual Linux client debian_amd64_strech build: @@ -250,6 +254,7 @@ Linux client debian_amd64_strech build: libfreetype6-dev libgif-dev libgl1-mesa-dev + libgnutls28-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev @@ -290,6 +295,7 @@ Linux client debian_amd64_strech build: paths: - code/build/bin # expire_in: 2 week + when: manual Linux client_static debian_amd64_strech build: @@ -320,6 +326,7 @@ Linux client_static debian_amd64_strech build: libfreetype6-dev libgif-dev libgl1-mesa-dev + libgnutls28-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev @@ -403,7 +410,8 @@ Linux client_static debian_amd64_strech build: name: "khanat-client_static-debian_amd64_strech-$CI_COMMIT_REF_NAME" paths: - code/build/bin - expire_in: 2 week +# expire_in: 2 week + when: manual Linux client_static_debug debian_amd64_strech build: @@ -434,6 +442,7 @@ Linux client_static_debug debian_amd64_strech build: libfreetype6-dev libgif-dev libgl1-mesa-dev + libgnutls28-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev @@ -517,6 +526,7 @@ Linux client_static_debug debian_amd64_strech build: paths: - code/build/bin # expire_in: 2 week + when: manual Linux server_static debian_amd64_strech build: @@ -534,7 +544,7 @@ Linux server_static debian_amd64_strech build: # Prepare environment - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y - - DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 apache2-utils autoconf autogen automake bison build-essential cmake cpputest default-libmysqlclient-dev fakeroot git libapache2-mod-php libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblua5.2-0 liblua5.2-dev liblzma-dev libogg-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libvorbis-dev libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial mysql-server php php-gd php-imagick php-mysql python3 python3-pip python3-bcrypt python3-venv rrdtool unzip wget zlib1g-dev + - DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 apache2-utils autoconf autogen automake bison build-essential cmake cpputest default-libmysqlclient-dev fakeroot git libapache2-mod-php libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblua5.2-0 liblua5.2-dev liblzma-dev libogg-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libvorbis-dev libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial mysql-server php php-gd php-imagick php-mysql python3 python3-pip python3-bcrypt python3-venv rrdtool unzip wget zlib1g-dev libgnutls28-dev # Apply patch - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done) # Build Curl @@ -612,6 +622,7 @@ Linux server_static debian_amd64_strech build: - code/ryzom/client/windows - code/ryzom/tools/scripts/linux # expire_in: 2 week + when: manual Linux server_static_debug debian_amd64_strech build: @@ -629,7 +640,7 @@ Linux server_static_debug debian_amd64_strech build: # Prepare environment - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y - - DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 apache2-utils autoconf autogen automake bison build-essential cmake cpputest default-libmysqlclient-dev fakeroot git libapache2-mod-php libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblua5.2-0 liblua5.2-dev liblzma-dev libogg-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libvorbis-dev libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial mysql-server php php-gd php-imagick php-mysql python3 python3-pip python3-bcrypt python3-venv rrdtool unzip wget zlib1g-dev + - DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 apache2-utils autoconf autogen automake bison build-essential cmake cpputest default-libmysqlclient-dev fakeroot git libapache2-mod-php libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblua5.2-0 liblua5.2-dev liblzma-dev libogg-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libvorbis-dev libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial mysql-server php php-gd php-imagick php-mysql python3 python3-pip python3-bcrypt python3-venv rrdtool unzip wget zlib1g-dev libgnutls28-dev # Apply patch - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done) # Build Curl @@ -707,6 +718,71 @@ Linux server_static_debug debian_amd64_strech build: - code/ryzom/client/windows - code/ryzom/tools/scripts/linux # expire_in: 2 week + when: manual + + +Linux server_static_debug debian_amd64_buster build: + stage: build + except: + - mac-ci-build + tags: + - Docker + image: amd64/debian:10 + script: + # Calcul le nombre de cpu désactivé (on ne laisse que 4 au maximum) + #- disableproc=$(( $(nproc) - 4 )) + #- if [[ $disableproc -le 0 ]] ; then disableproc=0; fi + #- optionproc="-j$(nproc --ignore=$disableproc)" + - optionproc="-j $(nproc)" + # Prepare environment + - DEBIAN_FRONTEND=noninteractive apt-get update + - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y + - DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 apache2-utils autoconf autogen automake bison build-essential cmake cpputest default-libmysqlclient-dev fakeroot git libapache2-mod-php libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblua5.2-0 liblua5.2-dev liblzma-dev libogg-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libvorbis-dev libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial default-mysql-server php php-gd php-imagick php-mysql python3 python3-pip python3-bcrypt python3-venv rrdtool unzip wget zlib1g-dev python3-coverage python3-pep8 xsltproc rsync libogg-dev libvorbis-dev libgnutls28-dev + # Apply patch + - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done) + # Build & Install cpptest + # Impossible to build release 1.1.0, 1.1.1, 1.1.2 + - mkdir -p /opt/src/cpptest + - wget -q https://github.com/cpptest/cpptest/archive/1.0.5.tar.gz -O /opt/src/cpptest.tar.gz || exit 2 + - tar xf /opt/src/cpptest.tar.gz -C /opt/src --strip 1 || exit 2 + - (cd /opt/src/cpptest && ./autogen.sh && ./configure && make -j && make install) || exit 2 + # Build debug & install (cpptestd) + - (cd /opt/src/cpptest && make clean && CXXFLAGS="-g -O0" ./configure && make && for file in src/.libs/lib*.so* src/.libs/lib*.a;do extension=${file##*/libcpptest} ; cp -L $file /usr/local/lib/libcpptestd${extension}; done) + # Build & Install squish + - mkdir -p squish + - (cd squish; wget -c https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libsquish/squish-1.11.zip) + - (cd squish; unzip squish-1.11.zip) + - (cd squish/squish-1.11; patch -i ../../patch/squish-limit.patch) + - (cd squish/squish-1.11; make -j) + - (cd squish/squish-1.11; make install) + # Build & Install CURL - 7.58.0 + - wget -q https://curl.haxx.se/download/curl-7.58.0.tar.gz -O curl.tar.gz + - mkdir -p curl/build + - tar xvf curl.tar.gz -C curl --strip 1 + - (cd curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CURL_TESTS=OFF -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/x86_64-linux-gnu/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/x86_64-linux-gnu/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a -DCMAKE_C_FLAGS='-fPIC' ..) + - (cd curl/build; make -j) + - (cd curl/build; make install) + # Build & Install luabind + - mkdir -p luabind + - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz + - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz + - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2 + - tar xvf luabind-debian.tar.xz -C luabind || exit 2 + - cd luabind + - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done + - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)" + - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)" + - cd .. + # Action + - mkdir -p code/build + - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=OFF -DWITH_DRIVER_OPENGL=OFF -DWITH_DRIVER_OPENAL=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=OFF -DWITH_SYMBOLS=ON ..) + - (cd code/build; make $optionproc ryzom_admin_service ryzom_ai_service ryzom_backup_service ryzom_dynamic_scenario_service ryzom_entities_game_service ryzom_frontend_service ryzom_general_utilities_service ryzom_gpm_service ryzom_ios_service ryzom_log_analyser_service ryzom_logger_service ryzom_mail_forum_service ryzom_mirror_service ryzom_mission_compiler ryzom_monitor_service ryzom_naming_service ryzom_patchman_service ryzom_pd_support_service ryzom_persistant_data_service ryzom_reference_builder_service ryzom_session_browser_service ryzom_shard_unifier_service ryzom_tick_service ryzom_welcome_service sheets_packer bnp_make make_sheet_id patch_gen) + - (cd code/build/bin; ls -lh) + artifacts: + name: "khanat-server_static_debug-debian_amd64_buster-$CI_COMMIT_REF_NAME" + paths: + - code/build/bin +# expire_in: 2 week Linux client_static debian_i386_strech build: @@ -725,7 +801,7 @@ Linux client_static debian_i386_strech build: - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y - apt-get install -y autoconf autogen automake bison build-essential cmake cpputest fakeroot libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial rrdtool unzip wget zlib1g-dev patch - - apt-get install -y liblua5.2-0 liblua5.2-dev + - apt-get install -y liblua5.2-0 liblua5.2-dev libgnutls28-dev # Apply patch - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done) # Build Curl @@ -788,6 +864,7 @@ Linux client_static debian_i386_strech build: paths: - code/build/bin # expire_in: 2 week + when: manual Linux client_static_debug debian_i386_strech build: @@ -805,7 +882,7 @@ Linux client_static_debug debian_i386_strech build: # Prepare environment - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y - - DEBIAN_FRONTEND=noninteractive apt-get install -y autoconf autogen automake bison build-essential cmake cpputest fakeroot libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial rrdtool unzip wget zlib1g-dev patch + - DEBIAN_FRONTEND=noninteractive apt-get install -y autoconf autogen automake bison build-essential cmake cpputest fakeroot libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial rrdtool unzip wget zlib1g-dev patch libgnutls28-dev - apt-get install -y liblua5.2-0 liblua5.2-dev # Apply patch - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done) @@ -869,6 +946,7 @@ Linux client_static_debug debian_i386_strech build: paths: - code/build/bin # expire_in: 2 week + when: manual # Fedora Client @@ -1176,7 +1254,7 @@ Linux server debian_amd64_buster build: - code/ryzom/client/unix - code/ryzom/client/windows - code/ryzom/tools/scripts/linux - expire_in: 2 week +# expire_in: 2 week Linux client debian_amd64_buster build: @@ -1187,6 +1265,11 @@ Linux client debian_amd64_buster build: - Docker image: amd64/debian:10 script: + # Calcul le nombre de cpu désactivé (on ne laisse que 4 au maximum) + - disableproc=$(( $(nproc) - 4 )) + - if [[ $disableproc -le 0 ]] ; then disableproc=0; fi + - optionproc="-j$(nproc --ignore=$disableproc)" + - echo "disableproc:$disableproc, nb core compile:$(nproc --ignore=$disableproc) optionproc:$optionproc" # Prepare environment - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y @@ -1202,6 +1285,7 @@ Linux client debian_amd64_buster build: libfreetype6-dev libgif-dev libgl1-mesa-dev + libgnutls28-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev @@ -1237,13 +1321,13 @@ Linux client debian_amd64_buster build: # - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=OFF -DWITH_RYZOM_CUSTOM_PATCH_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=ON -DWITH_STATIC_CURL=ON ..) # - (cd code/build; make -j khanat_client) - (cd code/build ; cmake -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_NEL=ON -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_STUDIO=OFF -DWITH_STATIC=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=ON -DWITH_STATIC_CURL=ON ..) - - (cd code/build; make -j ) + - (cd code/build; make $optionproc ) - (cd code/build/bin; ls -lh) artifacts: name: "khanat-client-debian_buster-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID" paths: - code/build/bin - expire_in: 2 week +# expire_in: 2 week @@ -1255,6 +1339,11 @@ Linux client_appimage debian_amd64_buster build: - Docker image: amd64/debian:10 script: + # Calcul le nombre de cpu désactivé (on ne laisse que 4 au maximum) + - disableproc=$(( $(nproc) - 4 )) + - if [[ $disableproc -le 0 ]] ; then disableproc=0; fi + - optionproc="-j$(nproc --ignore=$disableproc)" + - echo "disableproc:$disableproc, nb core compile:$(nproc --ignore=$disableproc) optionproc:$optionproc" # Prepare environment - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y @@ -1270,6 +1359,7 @@ Linux client_appimage debian_amd64_buster build: libfreetype6-dev libgif-dev libgl1-mesa-dev + libgnutls28-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev @@ -1321,8 +1411,8 @@ Linux client_appimage debian_amd64_buster build: - mkdir -p code/build #- (cd code/build ; cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_NEL=ON -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_STUDIO=OFF -DWITH_STATIC=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=OFF -DWITH_RYZOM_CUSTOM_PATCH_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=ON -DWITH_STATIC_CURL=ON ..) - (cd code/build ; cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_NEL=ON -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_STUDIO=OFF -DWITH_STATIC=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=ON -DWITH_STATIC_CURL=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON ..) - - (cd code/build; make -j ) - - (cd code/build; make -j install DESTDIR=AppDir) + - (cd code/build; make $optionproc ) + - (cd code/build; make $optionproc install DESTDIR=AppDir) # Generate AppImage - (cd code/build; rm -rf AppDir/usr/bin) - (cd code/build; mv AppDir/usr/games AppDir/usr/bin) @@ -1334,7 +1424,7 @@ Linux client_appimage debian_amd64_buster build: name: "khanat-client_appimage-debian_buster-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID" paths: - code/build/Khanat-x86_64.AppImage - expire_in: 2 week +# expire_in: 2 week diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 4e5292f2a..110b802f3 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -150,8 +150,9 @@ IF(WITH_STATIC) IF(UNIX) # under Linux and OS X, recent libxml2 versions are linked against liblzma FIND_PACKAGE(LibLZMA) + FIND_PACKAGE(gnutls) IF(LIBLZMA_LIBRARIES) - SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES}) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES} ${GNUTLS_LIBRARY}) ENDIF() ENDIF() ENDIF() diff --git a/code/CMakeModules/FindMySQL.cmake b/code/CMakeModules/FindMySQL.cmake index 631a96224..069625f02 100644 --- a/code/CMakeModules/FindMySQL.cmake +++ b/code/CMakeModules/FindMySQL.cmake @@ -80,6 +80,15 @@ ELSE() ENDIF() ENDIF() + IF(WITH_STATIC) + IF(UNIX) + FIND_PACKAGE(gnutls) + IF(GNUTLS_FOUND) + SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${GNUTLS_LIBRARY}) + ENDIF() + ENDIF() + ENDIF() + IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) SET(MYSQL_FOUND TRUE) MESSAGE(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}") diff --git a/code/CMakeModules/Findgnutls.cmake b/code/CMakeModules/Findgnutls.cmake new file mode 100644 index 000000000..be1a74b17 --- /dev/null +++ b/code/CMakeModules/Findgnutls.cmake @@ -0,0 +1,71 @@ +# - Locate gnutls library +# This module defines +# GNUTLS_LIBRARY, the library to link against +# GNUTLS_FOUND, if false, do not try to link to JPEG +# GNUTLS_INCLUDE_DIR, where to find headers. + +IF(NOT UNIX) + MESSAGE(STATUS "Ignore gnutls: It's not Unix enviroment") + RETURN() +ENDIF() + +GET_CMAKE_PROPERTY(_variableNames VARIABLES) +LIST (SORT _variableNames) +FOREACH (_variableName ${_variableNames}) + MESSAGE(STATUS "${_variableName}=${${_variableName}}") +ENDFOREACH() + +IF(GNUTLS_LIBRARY AND GNUTLS_INCLUDE_DIR) + # in cache already + SET(GNUTLS_FIND_QUIETLY TRUE) +ENDIF() + +# Save default suffixes +SET(_OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + +# Define specific suffixes +SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) + +FIND_PATH(GNUTLS_INCLUDE_DIR + gnutls.h + PATHS + $ENV{GNUTLS_DIR}/include + /usr/local/include + /usr/include/gnutls + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include + PATH_SUFFIXES gnutls +) + +FIND_LIBRARY(GNUTLS_LIBRARY + NAMES gnutls libgnutls + PATHS + $ENV{GNUTLS_DIR}/lib + /usr/local/lib + /usr/lib + /usr/lib/x86_64-linux-gnu/ + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + +# Restore default suffixes +SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_OLD_SUFFIXES}) + +IF(GNUTLS_LIBRARY AND GNUTLS_INCLUDE_DIR) + SET(GNUTLS_FOUND "YES") + IF(NOT GNUTLS_FIND_QUIETLY) + MESSAGE(STATUS "Found gnutls: ${GNUTLS_LIBRARY}") + ENDIF() +ELSE() + IF(NOT GNUTLS_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find gnutls!") + ENDIF() +ENDIF()