summaryrefslogtreecommitdiff
path: root/neon
diff options
context:
space:
mode:
authorAndres Gomez <agomez@igalia.com>2013-04-11 10:32:54 +0300
committerDavid Tardon <dtardon@redhat.com>2013-04-13 10:49:46 +0000
commit48d49759a4d43b5e5dd997b4a87555ce25ae2a04 (patch)
tree738b34263b3c6c71a9cff99b60035b46dbf4a07d /neon
parentf3f9db6d1d1fe63a4323f43de91a13aae03b1228 (diff)
neon: honor --disable-openssl and use GNUTLS
On --disable-openssl, the bundled neon library will link against GNUTLS + gcrypt instead of OpenSSL. Change-Id: I5b3f09cd1003aefde0478aaab026536c962212c4 Reviewed-on: https://gerrit.libreoffice.org/3330 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'neon')
-rw-r--r--neon/Library_neon.mk15
-rw-r--r--neon/UnpackedTarball_neon.mk1
-rw-r--r--neon/configs/config.h14
-rw-r--r--neon/neon_with_gnutls.patch29
4 files changed, 54 insertions, 5 deletions
diff --git a/neon/Library_neon.mk b/neon/Library_neon.mk
index bc5fe25af1b2..2dad2ed8f30a 100644
--- a/neon/Library_neon.mk
+++ b/neon/Library_neon.mk
@@ -12,7 +12,9 @@ $(eval $(call gb_Library_Library,neon))
$(eval $(call gb_Library_use_unpacked,neon,neon))
$(eval $(call gb_Library_use_externals,neon,\
+ gnutls \
libxml2 \
+ libgcrypt \
openssl \
openssl_headers \
zlib \
@@ -56,8 +58,19 @@ $(eval $(call gb_Library_add_generated_cobjects,neon,\
UnpackedTarball/neon/src/ne_utils \
UnpackedTarball/neon/src/ne_xml \
UnpackedTarball/neon/src/ne_xmlreq \
+))
+
+
+ifneq ($(DISABLE_OPENSSL),YES)
+$(eval $(call gb_Library_add_generated_cobjects,neon,\
UnpackedTarball/neon/src/ne_openssl \
))
+else
+$(eval $(call gb_Library_add_generated_cobjects,neon,\
+ UnpackedTarball/neon/src/ne_gnutls \
+))
+endif
+
ifeq ($(OS),WNT)
$(eval $(call gb_Library_use_system_win32_libs,neon,\
@@ -76,9 +89,11 @@ $(eval $(call gb_Library_add_generated_cobjects,neon,\
))
else
+ifneq ($(DISABLE_OPENSSL),YES)
$(eval $(call gb_Library_add_generated_cobjects,neon,\
UnpackedTarball/neon/src/ne_ntlm \
))
+endif
endif
diff --git a/neon/UnpackedTarball_neon.mk b/neon/UnpackedTarball_neon.mk
index a099718ec50a..a6cb87b54e19 100644
--- a/neon/UnpackedTarball_neon.mk
+++ b/neon/UnpackedTarball_neon.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,neon,0))
$(eval $(call gb_UnpackedTarball_add_patches,neon,\
neon/neon.patch \
neon/neon_ne_set_request_flag.patch \
+ neon/neon_with_gnutls.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/neon/configs/config.h b/neon/configs/config.h
index db68aa289ac8..b0fdf22559e3 100644
--- a/neon/configs/config.h
+++ b/neon/configs/config.h
@@ -79,23 +79,25 @@
#define HAVE_GETSOCKOPT 1
#endif
+#ifdef DISABLE_OPENSSL
/* Define if GnuTLS support is enabled */
-/* #undef HAVE_GNUTLS */
+#define HAVE_GNUTLS
/* Define to 1 if you have the `gnutls_certificate_get_x509_cas' function. */
/* #undef HAVE_GNUTLS_CERTIFICATE_GET_X509_CAS */
/* Define to 1 if you have the `gnutls_certificate_verify_peers2' function. */
-/* #undef HAVE_GNUTLS_CERTIFICATE_VERIFY_PEERS2 */
+#define HAVE_GNUTLS_CERTIFICATE_VERIFY_PEERS2
/* Define to 1 if you have the `gnutls_session_get_data2' function. */
-/* #undef HAVE_GNUTLS_SESSION_GET_DATA2 */
+#define HAVE_GNUTLS_SESSION_GET_DATA2
/* Define to 1 if you have the `gnutls_sign_callback_set' function. */
-/* #undef HAVE_GNUTLS_SIGN_CALLBACK_SET */
+#define HAVE_GNUTLS_SIGN_CALLBACK_SET
/* Define to 1 if you have the `gnutls_x509_dn_get_rdn_ava' function. */
-/* #undef HAVE_GNUTLS_X509_DN_GET_RDN_AVA */
+#define HAVE_GNUTLS_X509_DN_GET_RDN_AVA
+#endif /* DISABLE_OPENSSL */
/* Define if GSSAPI support is enabled */
/* #undef HAVE_GSSAPI */
@@ -179,6 +181,7 @@
#define HAVE_NETINET_TCP_H 1
#endif
+#ifndef DISABLE_OPENSSL
/* Define if NTLM is supported */
#ifndef WIN32
#define HAVE_NTLM 1
@@ -192,6 +195,7 @@
/* Define to 1 if you have the <openssl/ssl.h> header file. */
#define HAVE_OPENSSL_SSL_H 1
+#endif /* !DISABLE_OPENSSL */
/* Define if pakchois library supported */
/* #undef HAVE_PAKCHOIS */
diff --git a/neon/neon_with_gnutls.patch b/neon/neon_with_gnutls.patch
new file mode 100644
index 000000000000..ed8b7faadebf
--- /dev/null
+++ b/neon/neon_with_gnutls.patch
@@ -0,0 +1,29 @@
+--- src/ne_gnutls.c 2009-12-02 23:40:41.000000000 +0200
++++ src/ne_gnutls.c 2013-03-29 13:41:00.429857276 +0200
+@@ -48,6 +48,26 @@
+ #include <iconv.h>
+ #endif
+
++
++/* GnuTLS removed these symbols from 2.99.0.
++ *
++ * This is a dodgy solution to avoid further patching of neon
++ * sources */
++#if LIBGNUTLS_VERSION_NUMBER >= 0x026300
++# define gnutls_pkcs12 gnutls_pkcs12_t
++# define gnutls_pkcs12_bag gnutls_pkcs12_bag_t
++# define gnutls_pkcs12_bag_type gnutls_pkcs12_bag_type_t
++# define gnutls_certificate_verify_peers(_ssl) ({ \
++ int __status_ ## __LINE__ = 0; \
++ gnutls_certificate_verify_peers2((_ssl), &__status_ ## __LINE__) == 0 \
++ ? __status_ ## __LINE__ : -1; \
++ })
++#elif LIBGNUTLS_VERSION_NUMBER >= 0x020303
++/* GnuTLS had these symbols since 2.3.3. */
++# define HAVE_GNUTLS_CERTIFICATE_GET_X509_CAS
++#endif /* LIBGNUTLS_VERSION_NUMBER */
++
++
+ #include "ne_ssl.h"
+ #include "ne_string.h"
+ #include "ne_session.h"