Skip to contentSkip to conversation

minidlna: fix static link

PATCH New Vicente Olivert Riera 2 participants 2 messages Jul 9, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 minidlna: fix static link

minidlna needs to be linked with -lintl when gettext is needed (with locales), and also needs to be linked with -lvorbis, -lvorbisenc and -lswresample, otherwise it will cause link failures with lots of undefined references:

/br/output/build/libexif-0.6.21/libexif/exif-data.c:1197:
undefined reference to `libintl_dgettext'

/br/output/build/ffmpeg-2.6.2/libavcodec/libvorbisenc.c:311:
undefined reference to `vorbis_analysis'

/br/output/build/ffmpeg-2.6.2/libavcodec/libvorbisenc.c:113:
undefined reference to `vorbis_encode_ctl'

/br/output/build/ffmpeg-2.6.2/libavcodec/opusdec.c:374:
undefined reference to `swr_is_initialized'

---
v1 -> v2: remove unnecessary -lexif

 package/minidlna/minidlna.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
package/minidlna/minidlna.mk +6 -1
index 7adb832..37543d6 100644
@@ -17,8 +17,13 @@ MINIDLNA_DEPENDENCIES = \
 ifeq ($(BR2_STATIC_LIBS),y)
 # the configure script / Makefile forgets to link with some of the dependent
 # libraries breaking static linking, so help it along
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 MINIDLNA_CONF_ENV = \
-	LIBS='-lavformat -lavcodec -lavutil -logg -lz -lpthread -lm'
+	LIBS='-lavformat -lavcodec -lavutil -logg -lvorbis -lvorbisenc -lswresample -lz -lpthread -lm -lintl'
+else
+MINIDLNA_CONF_ENV = \
+	LIBS='-lavformat -lavcodec -lavutil -logg -lvorbis -lvorbisenc -lswresample -lz -lpthread -lm'
+endif
 else
 MINIDLNA_CONF_OPTS = \
 	--disable-static
Signature · 1 line
2.3.6
#1 lore raw

PATCH v2 1/1 minidlna: fix static link

Dear Vicente Olivert Riera,

Quoted 30 lines · Vicente Olivert Riera

minidlna needs to be linked with -lintl when gettext is needed (with locales), and also needs to be linked with -lvorbis, -lvorbisenc and -lswresample, otherwise it will cause link failures with lots of undefined references:

/br/output/build/libexif-0.6.21/libexif/exif-data.c:1197:
undefined reference to `libintl_dgettext'

/br/output/build/ffmpeg-2.6.2/libavcodec/libvorbisenc.c:311:
undefined reference to `vorbis_analysis'

/br/output/build/ffmpeg-2.6.2/libavcodec/libvorbisenc.c:113:
undefined reference to `vorbis_encode_ctl'

/br/output/build/ffmpeg-2.6.2/libavcodec/opusdec.c:374:
undefined reference to `swr_is_initialized'

---
v1 -> v2: remove unnecessary -lexif

 package/minidlna/minidlna.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
package/minidlna/minidlna.mk +0 -0
index 7adb832..37543d6 100644
@@ -17,8 +17,13 @@ MINIDLNA_DEPENDENCIES = \
 ifeq ($(BR2_STATIC_LIBS),y)

package/minidlna/minidlna.mk MINIDLNA_DEPENDENCIES = \ · line 26

Quoted 10 lines
package/minidlna/minidlna.mk +6 -1
 # the configure script / Makefile forgets to link with some of the dependent
 # libraries breaking static linking, so help it along
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 MINIDLNA_CONF_ENV = \
-	LIBS='-lavformat -lavcodec -lavutil -logg -lz -lpthread -lm'
+	LIBS='-lavformat -lavcodec -lavutil -logg -lvorbis -lvorbisenc -lswresample -lz -lpthread -lm -lintl'
+else
+MINIDLNA_CONF_ENV = \
+	LIBS='-lavformat -lavcodec -lavutil -logg -lvorbis -lvorbisenc -lswresample -lz -lpthread -lm'
+endif

Sorry, but this is really getting ridiculous. Please use pkg-config to find at least some of these dependencies and avoid such conditions in Buildroot .mk files.

Thomas

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