[hamradio-commits] [gnss-sdr] 09/18: Replacing the usage of OpenSSL by GnuTLS due to a GPL incompatibility from the former.
Carles Fernandez
carles_fernandez-guest at moszumanska.debian.org
Fri Sep 18 10:27:52 UTC 2015
This is an automated email from the git hooks/post-receive script.
carles_fernandez-guest pushed a commit to branch next
in repository gnss-sdr.
commit 18545077d84c02fe77b2a257a06f6d4456a1359f
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date: Tue Sep 15 01:41:18 2015 +0200
Replacing the usage of OpenSSL by GnuTLS due to a GPL incompatibility
from the former.
---
CMakeLists.txt | 18 +++++++++---------
README.md | 8 ++++----
src/core/libs/supl/CMakeLists.txt | 27 +++++++++++++++++++++------
src/core/libs/supl/supl.c | 12 +++---------
src/core/libs/supl/supl.h | 8 +++++++-
5 files changed, 44 insertions(+), 29 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a28ae4..1770d25 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 82a6269..5e77999 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 0be3c7f..4214832 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 08cc102..1ab843e 100644
--- a/src/core/libs/supl/supl.c
+++ b/src/core/libs/supl/supl.c
@@ -4,9 +4,11 @@
** Copyright (c) 2007 Tatu Mannisto <tatu a-t tajuma d-o-t com>
** All rights reserved.
** Redistribution and modifications are permitted subject to BSD license.
-**
+** Modifified by Carles Fernandez <carles d-o-t fernandez a-t cttc d-o-t es>
+** to make use of the gnutls library.
*/
+#include "supl.h"
#include <stdio.h>
#include <fcntl.h>
#include <netdb.h>
@@ -16,16 +18,8 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/time.h>
-#include <openssl/crypto.h>
-#include <openssl/x509.h>
-#include <openssl/pem.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#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 541a556..5355ce6 100644
--- a/src/core/libs/supl/supl.h
+++ b/src/core/libs/supl/supl.h
@@ -4,6 +4,8 @@
** Copyright (c) 2007 Tatu Mannisto <tatu a-t tajuma d-o-t com>
** All rights reserved.
** Redistribution and modifications are permitted subject to BSD license.
+** Modifified by Carles Fernandez <carles d-o-t fernandez a-t cttc d-o-t es>
+** to make use of the gnutls library.
**
*/
@@ -16,7 +18,11 @@
#define EXPORT
#endif
-#include <openssl/ssl.h>
+#include <gnutls/gnutls.h>
+#include <gnutls/compat.h>
+#include <gnutls/crypto.h>
+#include <gnutls/openssl.h>
+#include <gnutls/x509.h>
#include <PDU.h>
#include <ULP-PDU.h>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git
More information about the pkg-hamradio-commits
mailing list