Skip to contentSkip to conversation

popt: add to the "popt.pc" the dependency libintl

PATCH Superseded Fabio Porcedda 1 participant 2 messages Feb 24, 2015

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 popt: add to the "popt.pc" the dependency libintl

This change permits through pkg-config to retrive even the depenencies that is useful for a static linking.

---
 package/popt/popt.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
package/popt/popt.mk +9 -0
index 8ce64d4..e6d51c0 100644
@@ -15,10 +15,19 @@ POPT_GETTEXTIZE = YES
 
 POPT_CONF_ENV = ac_cv_va_copy=yes
 
+define POPT_POST_PATCH_FIX_PC
+	$(SED) "s/Libs:/Libs.private: -lintl\nLibs:/" $(@D)/popt.pc.in
+endef
+
 ifeq ($(BR2_PACKAGE_LIBICONV),y)
 POPT_CONF_ENV += am_cv_lib_iconv=yes
 POPT_CONF_OPTS += --with-libiconv-prefix=$(STAGING_DIR)/usr
 endif
 
+ifeq ($(BR2_PACKAGE_GETTEXT),y)
+ POPT_DEPENDENCIES += gettext
+ POPT_POST_PATCH_HOOKS += POPT_POST_PATCH_FIX_PC
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.3.0
#1 lore raw

PATCH v2 2/2 logrotate: use pkg-config for the opt library

Without using the pkg-config the dependencies are not included for a static linking so it fails to build.
These failures are fixed by linking the libintl library that is a dependency of the opt library.

Fixes:
http://autobuild.buildroot.net/results/159bf5730414ca7f73dcdae95090177355193636
http://autobuild.buildroot.net/results/ebe6ab7fc0f2cff98de06b3dc374730da9e9e4f2

---

Notes:
v2:
- instead of adding a patch just overwrite from the command line the LOADLIBES variable

 package/logrotate/logrotate.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
package/logrotate/logrotate.mk +4 -2
index dc26d85..c1bca48 100644
@@ -9,10 +9,12 @@ LOGROTATE_SITE = https://www.fedorahosted.org/releases/l/o/logrotate
 LOGROTATE_LICENSE = GPLv2+
 LOGROTATE_LICENSE_FILES = COPYING
 
-LOGROTATE_DEPENDENCIES = popt
+LOGROTATE_DEPENDENCIES = popt host-pkgconf
 
 define LOGROTATE_BUILD_CMDS
-	$(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS)" LDFLAGS="$(LDFLAGS)" -C $(@D)
+	$(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+		LOADLIBES="$(shell $(PKG_CONFIG_HOST_BINARY) --libs popt)" \
+		-C $(@D)
 endef
 
 define LOGROTATE_INSTALL_TARGET_CMDS
Signature · 1 line
2.3.0