diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a28ae482..1770d258e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -778,24 +778,24 @@ endif(NOT ARMADILLO_FOUND) ################################################################################ -# OpenSSL - http://www.openssl.org +# GnuTLS - http://www.gnutls.org/ ################################################################################ -find_package(OpenSSL) -if(NOT OPENSSL_FOUND) - message(" The OpenSSL library has not been found.") +find_package(GnuTLS) +if(NOT GNUTLS_FOUND) + message(" The GnuTLS library has not been found.") message(" You can try to install it by typing:") if(OS_IS_LINUX) if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo yum install openssl-devel") + message(" sudo yum install gnutls-devel") else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") - message(" sudo apt-get install libssl-dev") + message(" sudo apt-get install libgnutls28-dev") endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") endif(OS_IS_LINUX) if(OS_IS_MACOSX) - message(" sudo port install openssl") + message(" sudo port install gnutls") endif(OS_IS_MACOSX) - message(FATAL_ERROR "OpenSSL libraries are required to build gnss-sdr") -endif(NOT OPENSSL_FOUND) + message(FATAL_ERROR "GnuTLS libraries are required to build gnss-sdr") +endif(NOT GNUTLS_FOUND) ################################################################################ diff --git a/README.md b/README.md index 82a62698a..5e7799918 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \ libboost-serialization-dev libboost-program-options-dev libboost-test-dev \ liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr libblas-dev liblapack-dev \ - libarmadillo-dev libgflags-dev libgoogle-glog-dev libssl-dev libgtest-dev + libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls28-dev libgtest-dev ~~~~~~ Once you have installed these packages, you can jump directly to [how to download the source code and build GNSS-SDR](#download-and-build-linux). Alternatively, if you need to manually install those libraries, please keep reading. @@ -154,11 +154,11 @@ changing /home/username/gtest-1.7.0 by the actual directory where you downloaded -#### Install the [SSL development libraries](https://www.openssl.org/ "OpenSSL's Homepage"): +#### Install the [GnuTLS library](http://www.gnutls.org/ "GnuTLS's Homepage"): ~~~~~~ -$ sudo apt-get install libssl-dev # For Debian/Ubuntu/LinuxMint -$ sudo yum install openssl-devel # For Fedora/CentOS/RHEL +$ sudo apt-get install libgnutls28-dev # For Debian/Ubuntu/LinuxMint +$ sudo yum install gnutls-devel # For Fedora/CentOS/RHEL ~~~~~~ diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 0be3c7f1c..42148320a 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -24,11 +24,11 @@ set (SUPL_SOURCES ) include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${OPENSSL_INCLUDE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/libs/supl + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl + ${GNUTLS_INCLUDE_DIR} ) if(CMAKE_C_COMPILER_ID MATCHES "Clang") @@ -38,6 +38,21 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang") endif(CMAKE_C_COMPILER_ID MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") +find_library(GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl + HINTS /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/i386-linux-gnu + ) + add_library (supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) -target_link_libraries (supl_library ssl gnss_system_parameters) +target_link_libraries (supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) set_target_properties(supl_library PROPERTIES LINKER_LANGUAGE C) + + diff --git a/src/core/libs/supl/supl.c b/src/core/libs/supl/supl.c index 08cc10207..1ab843ead 100644 --- a/src/core/libs/supl/supl.c +++ b/src/core/libs/supl/supl.c @@ -4,9 +4,11 @@ ** Copyright (c) 2007 Tatu Mannisto ** All rights reserved. ** Redistribution and modifications are permitted subject to BSD license. -** +** Modifified by Carles Fernandez +** to make use of the gnutls library. */ +#include "supl.h" #include #include #include @@ -16,16 +18,8 @@ #include #include #include -#include -#include -#include -#include -#include -#include "ULP-PDU.h" -#include "PDU.h" -#include "supl.h" #define PARAM_GSM_CELL_CURRENT 1 #define PARAM_GSM_CELL_KNOWN 2 diff --git a/src/core/libs/supl/supl.h b/src/core/libs/supl/supl.h index 541a556c9..5355ce6c3 100644 --- a/src/core/libs/supl/supl.h +++ b/src/core/libs/supl/supl.h @@ -4,6 +4,8 @@ ** Copyright (c) 2007 Tatu Mannisto ** All rights reserved. ** Redistribution and modifications are permitted subject to BSD license. +** Modifified by Carles Fernandez +** to make use of the gnutls library. ** */ @@ -16,7 +18,11 @@ #define EXPORT #endif -#include +#include +#include +#include +#include +#include #include #include