Skip to contentSkip to conversation

libconfuse: add optional dependency on gettext

PATCH New Rahul Bedarkar 2 participants 4 messages Aug 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libconfuse: add optional dependency on gettext

---
 package/libconfuse/Config.in     | 1 +
 package/libconfuse/libconfuse.mk | 4 ++++
 2 files changed, 5 insertions(+)
package/libconfuse/Config.in +1 -0
index be18cbb..7dedd83 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LIBCONFUSE
 	bool "libconfuse"
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  LibConfuse is a configuration file parser library written in
 	  C. It supports sections and (lists of) values (strings,
package/libconfuse/libconfuse.mk +4 -0
index fea90f1..e289798 100644
@@ -14,5 +14,9 @@ HOST_LIBCONFUSE_DEPENDENCIES = host-flex
 LIBCONFUSE_LICENSE = ISC
 LIBCONFUSE_LICENSE_FILES = LICENSE
 
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
+LIBCONFUSE_DEPENDENCIES += gettext
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.6.2
#1 lore raw

PATCH 2/2 fwup: fix static linking issues

In case of static linking, we need to link against dependencies of dependencies. When static libs are enabled, pkg-config seems to be outputting private libs implicitly without need of --static option.

Instead of manually adding libs for dependencies of libconfuse and libarchive, use pkg-config.

Fixes:

http://autobuild.buildroot.net/results/69d/69d410e13a49b0ed34c501ba27d32df3269adb16/

---
 package/fwup/fwup.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/fwup/fwup.mk +4 -0
index ae85716..db13fcc 100644
@@ -13,5 +13,9 @@ HOST_FWUP_DEPENDENCIES = host-libconfuse host-libarchive host-libsodium
 FWUP_AUTORECONF = YES
 FWUP_CONF_ENV = ac_cv_path_HELP2MAN=""
 
+ifeq ($(BR2_STATIC_LIBS),y)
+FWUP_CONF_ENV += LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libconfuse libarchive`"
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.6.2
#2 lore raw

PATCH 2/2 fwup: fix static linking issues

Hello,

Quoted 4 lines · Rahul Bedarkar

In case of static linking, we need to link against dependencies of dependencies. When static libs are enabled, pkg-config seems to be outputting private libs implicitly without need of --static option.

Quoted 8 lines

Instead of manually adding libs for dependencies of libconfuse and libarchive, use pkg-config.

Fixes:

http://autobuild.buildroot.net/results/69d/69d410e13a49b0ed34c501ba27d32df3269adb16/

We already have some patches from Frank updating fwup:
especially https://patchwork.ozlabs.org/patch/657961/, which I believe fixes the same issue, by using pkg-config: see commit
https://github.com/fhunleth/fwup/commit/d770b51ec097480db6d4ddeefd8e2ae21059b090
in fwup upstream.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 1/2 libconfuse: add optional dependency on gettext

In reply to Rahul Bedarkar

Hello,

Quoted 11 lines · Rahul Bedarkar
---
 package/libconfuse/Config.in     | 1 +
 package/libconfuse/libconfuse.mk | 4 ++++
 2 files changed, 5 insertions(+)
package/libconfuse/Config.in +0 -0
index be18cbb..7dedd83 100644

package/libconfuse/Config.in line 3

Quoted 3 lines
package/libconfuse/Config.in +1 -0
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_LIBCONFUSE
 	bool "libconfuse"
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE

This was not correct: libconfuse does not *require* gettext, even if locale support is enabled. It can work fine without it. However, if it's available, it uses it. So I've changed your patch to just:

ifeq ($(BR2_PACKAGE_GETTEXT),y)
LIBCONFUSE_DEPENDENCIES += gettext
endif

which ensures that *if* gettext has been enabled in the configuration, it will be built before libconfuse.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com