Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/avahi: fix gettext dependency handling
@ 2017-02-12 12:46 Bernd Kuhls
  2017-02-12 12:57 ` Baruch Siach
  2017-02-12 14:54 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Bernd Kuhls @ 2017-02-12 12:46 UTC (permalink / raw)
  To: buildroot

Currently avahi only adds -lintl when BR2_NEEDS_GETTEXT_IF_LOCALE is
enabled. This is insufficent for defconfigs where BR2_PACKAGE_GETTEXT
was selected by other packages without BR2_NEEDS_GETTEXT_IF_LOCALE
being enabled at the same time. If gettext was built before avahi,
and avahi uses optional dbus support, avahi configure detects libintl:

checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... no
checking for bindtextdomain in -lintl... yes
checking for ngettext in -lintl... yes
checking for dgettext in -lintl... yes

and breaks at linking stage:

  CCLD     avahi-publish
/home/buildroot/br7_freeswitch/output/host/usr/lib/gcc/i586-buildroot-linux-uclibc/5.4.0/../../../../i586-buildroot-linux-uclibc/bin/ld: avahi_publish-avahi-publish.o: undefined reference to symbol 'libintl_dgettext'
/home/buildroot/br7_freeswitch/output/host/usr/i586-buildroot-linux-uclibc/sysroot/usr/lib32/libintl.so.8: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

To reproduce use this minimal defconfig:

BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_PACKAGE_GETTEXT=y
BR2_PACKAGE_DBUS=y
BR2_PACKAGE_AVAHI=y

and build gettext before avahi.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/avahi/avahi.mk | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index 069b45a96..901beaaba 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -96,9 +96,7 @@ AVAHI_CONF_OPTS = \
 	--with-autoipd-user=avahi \
 	--with-autoipd-group=avahi
 
-AVAHI_DEPENDENCIES = \
-	$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) host-intltool \
-	host-pkgconf host-gettext
+AVAHI_DEPENDENCIES = host-intltool host-pkgconf host-gettext
 
 AVAHI_CFLAGS = $(TARGET_CFLAGS)
 
@@ -168,7 +166,10 @@ endif
 
 AVAHI_CONF_ENV += CFLAGS="$(AVAHI_CFLAGS)"
 
-AVAHI_MAKE_OPTS += $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),LIBS=-lintl)
+ifeq ($(BR2_PACKAGE_GETTEXT),y)
+AVAHI_DEPENDENCIES += gettext
+AVAHI_CONF_ENV += LIBS=-lintl
+endif
 
 define AVAHI_USERS
 	avahi -1 avahi -1 * - - -
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] package/avahi: fix gettext dependency handling
  2017-02-12 12:46 [Buildroot] [PATCH 1/1] package/avahi: fix gettext dependency handling Bernd Kuhls
@ 2017-02-12 12:57 ` Baruch Siach
  2017-02-12 14:54 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Baruch Siach @ 2017-02-12 12:57 UTC (permalink / raw)
  To: buildroot

Hi Bernd,

On Sun, Feb 12, 2017 at 01:46:15PM +0100, Bernd Kuhls wrote:
> Currently avahi only adds -lintl when BR2_NEEDS_GETTEXT_IF_LOCALE is
> enabled. This is insufficent for defconfigs where BR2_PACKAGE_GETTEXT
> was selected by other packages without BR2_NEEDS_GETTEXT_IF_LOCALE
> being enabled at the same time. If gettext was built before avahi,
> and avahi uses optional dbus support, avahi configure detects libintl:
> 
> checking libintl.h usability... yes
> checking libintl.h presence... yes
> checking for libintl.h... yes
> checking for ngettext in libc... no
> checking for bindtextdomain in -lintl... yes
> checking for ngettext in -lintl... yes
> checking for dgettext in -lintl... yes
> 
> and breaks at linking stage:
> 
>   CCLD     avahi-publish
> /home/buildroot/br7_freeswitch/output/host/usr/lib/gcc/i586-buildroot-linux-uclibc/5.4.0/../../../../i586-buildroot-linux-uclibc/bin/ld: avahi_publish-avahi-publish.o: undefined reference to symbol 'libintl_dgettext'
> /home/buildroot/br7_freeswitch/output/host/usr/i586-buildroot-linux-uclibc/sysroot/usr/lib32/libintl.so.8: error adding symbols: DSO missing from command line
> collect2: error: ld returned 1 exit status
> 
> To reproduce use this minimal defconfig:
> 
> BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
> BR2_PACKAGE_GETTEXT=y
> BR2_PACKAGE_DBUS=y
> BR2_PACKAGE_AVAHI=y
> 
> and build gettext before avahi.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
>  package/avahi/avahi.mk | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
> index 069b45a96..901beaaba 100644
> --- a/package/avahi/avahi.mk
> +++ b/package/avahi/avahi.mk
> @@ -96,9 +96,7 @@ AVAHI_CONF_OPTS = \
>  	--with-autoipd-user=avahi \
>  	--with-autoipd-group=avahi
>  
> -AVAHI_DEPENDENCIES = \
> -	$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) host-intltool \
> -	host-pkgconf host-gettext
> +AVAHI_DEPENDENCIES = host-intltool host-pkgconf host-gettext
>  
>  AVAHI_CFLAGS = $(TARGET_CFLAGS)
>  
> @@ -168,7 +166,10 @@ endif
>  
>  AVAHI_CONF_ENV += CFLAGS="$(AVAHI_CFLAGS)"
>  
> -AVAHI_MAKE_OPTS += $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),LIBS=-lintl)
> +ifeq ($(BR2_PACKAGE_GETTEXT),y)
> +AVAHI_DEPENDENCIES += gettext
> +AVAHI_CONF_ENV += LIBS=-lintl
> +endif

Why do you switch from AVAHI_MAKE_OPTS to AVAHI_CONF_ENV?

<PKG>_CONF_ENV is arguably better, but this change is not mentioned in the 
commit log.

baruch

-- 
     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 -

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] package/avahi: fix gettext dependency handling
  2017-02-12 12:46 [Buildroot] [PATCH 1/1] package/avahi: fix gettext dependency handling Bernd Kuhls
  2017-02-12 12:57 ` Baruch Siach
@ 2017-02-12 14:54 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-02-12 14:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 12 Feb 2017 13:46:15 +0100, Bernd Kuhls wrote:
> Currently avahi only adds -lintl when BR2_NEEDS_GETTEXT_IF_LOCALE is
> enabled. This is insufficent for defconfigs where BR2_PACKAGE_GETTEXT
> was selected by other packages without BR2_NEEDS_GETTEXT_IF_LOCALE
> being enabled at the same time. If gettext was built before avahi,
> and avahi uses optional dbus support, avahi configure detects libintl:
> 
> checking libintl.h usability... yes
> checking libintl.h presence... yes
> checking for libintl.h... yes
> checking for ngettext in libc... no
> checking for bindtextdomain in -lintl... yes
> checking for ngettext in -lintl... yes
> checking for dgettext in -lintl... yes
> 
> and breaks at linking stage:
> 
>   CCLD     avahi-publish
> /home/buildroot/br7_freeswitch/output/host/usr/lib/gcc/i586-buildroot-linux-uclibc/5.4.0/../../../../i586-buildroot-linux-uclibc/bin/ld: avahi_publish-avahi-publish.o: undefined reference to symbol 'libintl_dgettext'
> /home/buildroot/br7_freeswitch/output/host/usr/i586-buildroot-linux-uclibc/sysroot/usr/lib32/libintl.so.8: error adding symbols: DSO missing from command line
> collect2: error: ld returned 1 exit status
> 
> To reproduce use this minimal defconfig:
> 
> BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
> BR2_PACKAGE_GETTEXT=y
> BR2_PACKAGE_DBUS=y
> BR2_PACKAGE_AVAHI=y
> 
> and build gettext before avahi.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

I haven't looked at your patch yet, but there is another patch pending
in patchwork for what looks like the same issue, and some discussion
took place on it: http://patchwork.ozlabs.org/patch/683732/.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] package/avahi: fix gettext dependency handling
@ 2017-06-10 19:29 Bernd Kuhls
  0 siblings, 0 replies; 4+ messages in thread
From: Bernd Kuhls @ 2017-06-10 19:29 UTC (permalink / raw)
  To: buildroot

Currently avahi only adds -lintl when BR2_NEEDS_GETTEXT_IF_LOCALE is
enabled. This is insufficent for defconfigs where BR2_PACKAGE_GETTEXT
was selected by other packages without BR2_NEEDS_GETTEXT_IF_LOCALE
being enabled at the same time. If gettext was built before avahi,
and avahi uses optional dbus support, avahi configure detects libintl:

checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... no
checking for bindtextdomain in -lintl... yes
checking for ngettext in -lintl... yes
checking for dgettext in -lintl... yes

and build breaks when linking avahi-utils, which depend on dbus, see
avahi-utils/Makefile.am, line 25:

  CCLD     avahi-publish
/home/buildroot/buildroot/output/host/usr/lib/gcc/i586-buildroot-linux-uclibc/5.4.0/../../../../i586-buildroot-linux-uclibc/bin/ld: avahi_publish-avahi-publish.o:
 undefined reference to symbol 'libintl_dgettext'
/home/buildroot/buildroot/output/host/usr/i586-buildroot-linux-uclibc/sysroot/usr/lib32/libintl.so.8: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

To reproduce use this minimal defconfig:

BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_PACKAGE_GETTEXT=y
BR2_PACKAGE_DBUS=y
BR2_PACKAGE_AVAHI=y

$ grep -i gettext .config
BR2_NEEDS_GETTEXT=y
BR2_PACKAGE_GETTEXT=y
  # BR2_PACKAGE_GETTEXT_TOOLS is not set
  # BR2_PACKAGE_GETTEXT_STATIC is not set

and build gettext before avahi.

This patch makes sure that -lintl is added when gettext is enabled and,
at the same time, BR2_NEEDS_GETTEXT is enabled. The later is only
enabled for uclibc-based toolchains, for them gettext also provides
libintl while glibc/musl provide it themselves.

Patch also tested with this defconfig:

BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_PACKAGE_GETTEXT=y
BR2_PACKAGE_DBUS=y
BR2_PACKAGE_AVAHI=y

$ grep -i gettext .config
BR2_PACKAGE_GETTEXT=y
  # BR2_PACKAGE_GETTEXT_TOOLS is not set
  # BR2_PACKAGE_GETTEXT_STATIC is not set

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
This patch superseeds http://patchwork.ozlabs.org/patch/726955/ and
replaces http://patchwork.ozlabs.org/patch/683732/

 package/avahi/avahi.mk | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index 0ec38d390..57a35b476 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -89,9 +89,7 @@ AVAHI_CONF_OPTS = \
 	--with-autoipd-user=avahi \
 	--with-autoipd-group=avahi
 
-AVAHI_DEPENDENCIES = \
-	$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) host-intltool \
-	host-pkgconf host-gettext
+AVAHI_DEPENDENCIES = host-intltool host-pkgconf host-gettext
 
 AVAHI_CFLAGS = $(TARGET_CFLAGS)
 
@@ -161,7 +159,10 @@ endif
 
 AVAHI_CONF_ENV += CFLAGS="$(AVAHI_CFLAGS)"
 
-AVAHI_MAKE_OPTS += $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),LIBS=-lintl)
+ifeq ($(BR2_NEEDS_GETTEXT)$(BR2_PACKAGE_GETTEXT),yy)
+AVAHI_DEPENDENCIES += gettext
+AVAHI_MAKE_OPTS += LIBS=-lintl
+endif
 
 define AVAHI_USERS
 	avahi -1 avahi -1 * - - -
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-10 19:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-12 12:46 [Buildroot] [PATCH 1/1] package/avahi: fix gettext dependency handling Bernd Kuhls
2017-02-12 12:57 ` Baruch Siach
2017-02-12 14:54 ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2017-06-10 19:29 Bernd Kuhls

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox