gnutls: use included unistring unless libunistring is selected
authorSven Neumann <neumann@teufel.de>
Fri, 15 Jun 2018 08:48:38 +0000 (10:48 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 17 Jun 2018 12:05:40 +0000 (14:05 +0200)
Use the included copy of libunistring unless BR2_PACKAGE_LIBUNISTRING
is already selected.

The resulting gnutls library with libunistring included is about 1.2 MB
smaller than the sum of libgnutls and libunistring.

Signed-off-by: Sven Neumann <neumann@teufel.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/gnutls/Config.in
package/gnutls/gnutls.mk

index 176951a385ec9aa07a58ede626756dcad670c72e..ef995d21d2e0b89ebd8f19dc006dd1f13bf5d132 100644 (file)
@@ -4,7 +4,6 @@ config BR2_PACKAGE_GNUTLS
        depends on !BR2_STATIC_LIBS
        depends on BR2_USE_WCHAR
        select BR2_PACKAGE_LIBTASN1
-       select BR2_PACKAGE_LIBUNISTRING
        select BR2_PACKAGE_NETTLE
        select BR2_PACKAGE_PCRE
        help
index 3d1a627781b44fd23ce2c2b5b0b8b109a1932619..fec07dfe03a6f7ab315e3d3becf0a9cbcdc6429b 100644 (file)
@@ -10,7 +10,7 @@ GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
 GNUTLS_SITE = https://www.gnupg.org/ftp/gcrypt/gnutls/v$(GNUTLS_VERSION_MAJOR)
 GNUTLS_LICENSE = LGPL-2.1+ (core library), GPL-3.0+ (gnutls-openssl library)
 GNUTLS_LICENSE_FILES = doc/COPYING doc/COPYING.LESSER
-GNUTLS_DEPENDENCIES = host-pkgconf libunistring libtasn1 nettle pcre
+GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle pcre
 GNUTLS_CONF_OPTS = \
        --disable-doc \
        --disable-guile \
@@ -19,7 +19,6 @@ GNUTLS_CONF_OPTS = \
        --enable-local-libopts \
        --enable-openssl-compatibility \
        --with-libnettle-prefix=$(STAGING_DIR)/usr \
-       --with-libunistring-prefix=$(STAGING_DIR)/usr \
        --with-librt-prefix=$(STAGING_DIR) \
        --without-tpm \
        $(if $(BR2_PACKAGE_GNUTLS_TOOLS),--enable-tools,--disable-tools)
@@ -82,6 +81,13 @@ else
 GNUTLS_CONF_OPTS += --without-p11-kit
 endif
 
+ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
+GNUTLS_CONF_OPTS += --with-libunistring-prefix=$(STAGING_DIR)/usr
+GNUTLS_DEPENDENCIES += libunistring
+else
+GNUTLS_CONF_OPTS += --with-included-unistring
+endif
+
 ifeq ($(BR2_PACKAGE_ZLIB),y)
 GNUTLS_CONF_OPTS += --with-zlib
 GNUTLS_DEPENDENCIES += zlib