Patchwork usbutils: Patch to detect iconv support

login
register
mail settings
Submitter Khem Raj
Date Feb. 15, 2014, 2:54 a.m.
Message ID <1392432877-15003-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/66787/
State Accepted
Commit 94ba45932c2fcd15aa894c8dc4063a261e993b96
Headers show

Comments

Khem Raj - Feb. 15, 2014, 2:54 a.m.
Fixes build failures on uclibc

| lsusb-usbmisc.o: In function `usb_string_to_native':
|
/home/kraj/work/angstrom-repo/build/tmp-angstrom_next-uclibc/work/armv7at2hf-vfp-neon-angstrom-linux-uclibceabi/usbutils/007-r0/usbutils-007/usbmisc.c:190:
undefined reference to `libiconv_open'
|
/home/kraj/work/angstrom-repo/build/tmp-angstrom_next-uclibc/work/armv7at2hf-vfp-neon-angstrom-linux-uclibceabi/usbutils/007-r0/usbutils-007/usbmisc.c:199:
undefined reference to `libiconv'
|
/home/kraj/work/angstrom-repo/build/tmp-angstrom_next-uclibc/work/armv7at2hf-vfp-neon-angstrom-linux-uclibceabi/usbutils/007-r0/usbutils-007/usbmisc.c:202:
undefined reference to `libiconv_close'
| collect2: error: ld returned 1 exit status
| make[2]: *** [lsusb] Error 1

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-bsp/usbutils/usbutils/iconv.patch |   40 ++++++++++++++++++++++++
 meta/recipes-bsp/usbutils/usbutils_007.bb      |    8 +++--
 2 files changed, 45 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-bsp/usbutils/usbutils/iconv.patch
Bernhard Reutner-Fischer - Feb. 16, 2014, 1:41 p.m.
On 15 February 2014 03:54:25 Khem Raj <raj.khem@gmail.com> wrote:

> Fixes build failures on uclibc

Does this also handle SDK images?
I had to divert iconv.h ..
Thanks && cheers,


Sent with AquaMail for Android
http://www.aqua-mail.com
Khem Raj - Feb. 16, 2014, 4:32 p.m.
On Feb 16, 2014, at 5:41 AM, Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> wrote:

> On 15 February 2014 03:54:25 Khem Raj <raj.khem@gmail.com> wrote:
> 
>> Fixes build failures on uclibc
> 
> Does this also handle SDK images?
> I had to divert iconv.h ..
> Thanks && cheers,
> 
> 

I am able to generate SDK images yes.

> Sent with AquaMail for Android
> http://www.aqua-mail.com
> 
>

Patch

diff --git a/meta/recipes-bsp/usbutils/usbutils/iconv.patch b/meta/recipes-bsp/usbutils/usbutils/iconv.patch
new file mode 100644
index 0000000..c557334
--- /dev/null
+++ b/meta/recipes-bsp/usbutils/usbutils/iconv.patch
@@ -0,0 +1,40 @@ 
+This patch adds support for detecting iconv support using autotools
+uclibc does not have iconv implementation inside libc like glibc, therefore
+the existing checks were not sufficient, it worked for glibc but not for
+uclibc. The new patch portably detects the iconv support and adds the
+libiconv to linker cmdline
+
+This patch should be submitted upstream too
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: usbutils-007/configure.ac
+===================================================================
+--- usbutils-007.orig/configure.ac
++++ usbutils-007/configure.ac
+@@ -10,7 +10,9 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+ 
+ AC_CHECK_HEADERS([byteswap.h])
+-AC_CHECK_FUNCS([nl_langinfo iconv])
++
++AM_GNU_GETTEXT
++AM_ICONV
+ 
+ AC_ARG_ENABLE(zlib,
+ 	AS_HELP_STRING(--disable-zlib,disable support for zlib))
+Index: usbutils-007/Makefile.am
+===================================================================
+--- usbutils-007.orig/Makefile.am
++++ usbutils-007/Makefile.am
+@@ -27,7 +27,7 @@ lsusb_CPPFLAGS = \
+ 	-DDATADIR=\"$(datadir)\"
+ 
+ lsusb_LDADD = \
+-	$(LIBUSB_LIBS)
++	$(LIBUSB_LIBS) $(LIBICONV)
+ 
+ if HAVE_ZLIB
+ lsusb_CPPFLAGS += -DHAVE_LIBZ
diff --git a/meta/recipes-bsp/usbutils/usbutils_007.bb b/meta/recipes-bsp/usbutils/usbutils_007.bb
index 45f829f..3cb19c9 100644
--- a/meta/recipes-bsp/usbutils/usbutils_007.bb
+++ b/meta/recipes-bsp/usbutils/usbutils_007.bb
@@ -6,16 +6,18 @@  SECTION = "base"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
-DEPENDS = "libusb zlib"
+DEPENDS = "libusb zlib virtual/libiconv"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \
            file://usb-devices-avoid-dependency-on-bash.patch \
-           file://Fix-NULL-pointer-crash.patch"
+           file://Fix-NULL-pointer-crash.patch \
+           file://iconv.patch \
+          "
 
 SRC_URI[md5sum] = "be6c42294be5c940f208190d3479d50c"
 SRC_URI[sha256sum] = "e65c234cadf7c81b6b1567c440e3b9b31b44f51c27df3e45741b88848d8b37d3"
 
-inherit autotools
+inherit autotools gettext
 
 do_install_append() {
 	# We only need the compressed copy, remove the uncompressed version