package/libcoap: properly enable DTLS support
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Thu, 13 Feb 2020 22:15:10 +0000 (23:15 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 12 Apr 2020 20:08:47 +0000 (22:08 +0200)
The DTLS support needs either gnutls or openssl, so let's have these
packages as optional dependencies. We prefer gnutls over openssl as
done by upstream in their configure.ac when the user does not provide
any option (which is the case currently)

While there is support for tinydtls, and Buildroot has a tinydtls
package, libcoap is only able to use its own internal library, and
only when static linking is enabled, so we simply disable the use of
tinydtls altogether.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/libcoap/libcoap.mk

index e2fbaa3dfba605cff01f051c0aef0db34fa2972d..bea0e68889cf809d9850bf2c6b9b5892b8f3f45a 100644 (file)
@@ -10,7 +10,17 @@ LIBCOAP_INSTALL_STAGING = YES
 LIBCOAP_LICENSE = BSD-2-Clause
 LIBCOAP_LICENSE_FILES = COPYING LICENSE
 LIBCOAP_DEPENDENCIES = host-pkgconf
-LIBCOAP_CONF_OPTS = --disable-examples
+LIBCOAP_CONF_OPTS = --disable-examples --without-tinydtls
 LIBCOAP_AUTORECONF = YES
 
+ifeq ($(BR2_PACKAGE_GNUTLS),y)
+LIBCOAP_DEPENDENCIES += gnutls
+LIBCOAP_CONF_OPTS += --enable-dtls --with-gnutls --without-openssl
+else ifeq ($(BR2_PACKAGE_OPENSSL),y)
+LIBCOAP_DEPENDENCIES += openssl
+LIBCOAP_CONF_OPTS += --enable-dtls --without-gnutls --with-openssl
+else
+LIBCOAP_CONF_OPTS += --disable-dtls
+endif
+
 $(eval $(autotools-package))