minidlna: Fix automagic dependency to libiconv
authorMarkos Chandras <markos.chandras@imgtec.com>
Fri, 23 Aug 2013 17:26:34 +0000 (18:26 +0100)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 27 Aug 2013 22:16:25 +0000 (00:16 +0200)
minidlna will detect and use the libiconv library if
the package is selected. In that case, we need to link
against -liconv.

Fixes the following linking problem:

tagutils/tagutils.o: In function `do_iconv.constprop.6':
tagutils.c:(.text+0x4d5c): undefined reference to `libiconv_open'
tagutils.c:(.text+0x4da0): undefined reference to `libiconv'
tagutils.c:(.text+0x4e08): undefined reference to `libiconv_close'

[Peter: wrap COMMON_LIBS line]
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/minidlna/minidlna.mk

index 10e3b33b67d643631ebe21ebcc3e14aaf97ace4b..077e2572c02e5fca730fce7ce28367920e6138d9 100644 (file)
@@ -19,12 +19,23 @@ MINIDLNA_CFLAGS=$(TARGET_CFLAGS) \
        -I"$(STAGING_DIR)/usr/include/libavcodec" \
        -I"$(STAGING_DIR)/usr/include/libavformat"
 
+MINIDLNA_COMMON_LIBS = \
+       -lpthread -lexif -ljpeg -lsqlite3 -lavformat -lavutil -lavcodec \
+       -lid3tag -lFLAC -logg -lvorbis
+
 ifeq ($(BR2_PACKAGE_GETTEXT),y)
 MINIDLNA_DEPENDENCIES += gettext
 # we need to link with libintl
-MINIDLNA_MAKE_OPTS += LIBS='-lpthread -lexif -ljpeg -lsqlite3 -lavformat -lavutil -lavcodec -lid3tag -lFLAC -logg -lvorbis -lintl'
+MINIDLNA_COMMON_LIBS += -lintl
+endif
+
+ifeq ($(BR2_PACKAGE_LIBICONV),y)
+MINIDLNA_DEPENDENCIES += libiconv
+MINIDLNA_COMMON_LIBS += -liconv
 endif
 
+MINIDLNA_MAKE_OPTS += LIBS='$(MINIDLNA_COMMON_LIBS)'
+
 define MINIDLNA_BUILD_CMDS
        PREFIX=$(STAGING_DIR)/usr \
                $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \