Skip to contentSkip to conversation

gnutls: use included unistring unless libunistring is selected

PATCH New Sven Neumann 3 participants 4 messages Jun 15, 2018 – Jun 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gnutls: use included unistring unless libunistring is selected

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.

---
 package/gnutls/Config.in |  1 -
 package/gnutls/gnutls.mk | 10 ++++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)
package/gnutls/Config.in +0 -1
index cfb7cb3f3b..998e213c7d 100644
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_GNUTLS
 	bool "gnutls"
 	select BR2_PACKAGE_LIBTASN1
-	select BR2_PACKAGE_LIBUNISTRING
 	select BR2_PACKAGE_NETTLE
 	select BR2_PACKAGE_PCRE
 	depends on BR2_USE_WCHAR
package/gnutls/gnutls.mk +8 -2
index be1cf00e06..7d8071c824 100644
@@ -10,7 +10,7 @@ GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
 GNUTLS_SITE = ftp://ftp.gnutls.org/gcrypt/gnutls/v$(GNUTLS_VERSION_MAJOR)
 GNUTLS_LICENSE = LGPLv2.1+ (core library), GPLv3+ (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)
@@ -75,6 +74,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
Signature · 1 line
2.14.4
#1 lore raw

PATCH 1/1 gnutls: use included unistring unless libunistring is selected

Hi Sven,

Quoted 17 lines · Sven Neumann

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.

---
 package/gnutls/Config.in |  1 -
 package/gnutls/gnutls.mk | 10 ++++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)
package/gnutls/Config.in +0 -0
index cfb7cb3f3b..998e213c7d 100644

package/gnutls/Config.in line 6

Quoted 7 lines
package/gnutls/Config.in +0 -1
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_GNUTLS
 	bool "gnutls"
 	select BR2_PACKAGE_LIBTASN1
-	select BR2_PACKAGE_LIBUNISTRING
 	select BR2_PACKAGE_NETTLE
 	select BR2_PACKAGE_PCRE
 	depends on BR2_USE_WCHAR

Is it possible now to remove the BR2_USE_WCHAR dependency of gnutls?

baruch

Quoted 35 lines
package/gnutls/gnutls.mk +8 -2
index be1cf00e06..7d8071c824 100644
@@ -10,7 +10,7 @@ GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
 GNUTLS_SITE = ftp://ftp.gnutls.org/gcrypt/gnutls/v$(GNUTLS_VERSION_MAJOR)
 GNUTLS_LICENSE = LGPLv2.1+ (core library), GPLv3+ (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)
@@ -75,6 +74,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
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 gnutls: use included unistring unless libunistring is selected

Hello,

Quoted 6 lines · Baruch Siach
Quoted 6 lines
package/gnutls/Config.in +0 -0
index cfb7cb3f3b..998e213c7d 100644
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_GNUTLS
Quoted 8 lines

package/gnutls/Config.in line 6

Quoted 6 lines
package/gnutls/Config.in +0 -1
 	bool "gnutls"
 	select BR2_PACKAGE_LIBTASN1
-	select BR2_PACKAGE_LIBUNISTRING
 	select BR2_PACKAGE_NETTLE
 	select BR2_PACKAGE_PCRE
 	depends on BR2_USE_WCHAR  

Is it possible now to remove the BR2_USE_WCHAR dependency of gnutls?

gnutls indeed builds fine with wchar support now. However, looking at the commit that introduced the wchar dependency back in 2013, it doesn't seem it was due to the libunistring dependency (see 669de89be785f83ae4840b0ba3983d044e374172).

So it would probably be good to drop the wchar dependency in gnutls. This requires also checking all the reverse dependencies of gnutls:

package/connman/Config.in: select BR2_PACKAGE_GNUTLS

-> Anyway needs wchar because of libglib2

package/libmicrohttpd/Config.in: select BR2_PACKAGE_GNUTLS

-> In this one, the wchar dependency can probably be dropped

package/libnice/Config.in: select BR2_PACKAGE_GNUTLS

-> Also uses libglib2, so wchar needed

package/libsoup/Config.in: select BR2_PACKAGE_GNUTLS

-> Ditto

package/network-manager/Config.in: select BR2_PACKAGE_GNUTLS

-> Interestingly... this one does *NOT* have the wchar dependency
expressed directly. It works because this package depends on BR2_PACKAGE_HAS_UDEV, and both eudev and systemd need wchar support.

package/ntfs-3g/Config.in: select BR2_PACKAGE_GNUTLS

-> Will probably still need the wchar dependency.

package/samba4/Config.in: select BR2_PACKAGE_GNUTLS

-> Will still need the wchar dependency.

package/taskd/Config.in: select BR2_PACKAGE_GNUTLS

-> Might be possible to drop the wchar dependency.

package/vpnc/Config.in: select BR2_PACKAGE_GNUTLS

-> Might be possible to drop the wchar dependency.

and these are only the first-level reverse dependencies.

Anybody interested in looking into this ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 1/1 gnutls: use included unistring unless libunistring is selected

In reply to Sven Neumann

Hello,

Quoted 11 lines · Sven Neumann

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.

---
 package/gnutls/Config.in |  1 -
 package/gnutls/gnutls.mk | 10 ++++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com