* [Buildroot] [PATCH v2] minidlna: fix static link
@ 2015-07-09 10:00 Vicente Olivert Riera
2015-07-09 12:09 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Vicente Olivert Riera @ 2015-07-09 10:00 UTC (permalink / raw)
To: buildroot
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'
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
v1 -> v2: remove unnecessary -lexif
package/minidlna/minidlna.mk | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/package/minidlna/minidlna.mk b/package/minidlna/minidlna.mk
index 7adb832..37543d6 100644
--- a/package/minidlna/minidlna.mk
+++ b/package/minidlna/minidlna.mk
@@ -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
--
2.3.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH v2] minidlna: fix static link
2015-07-09 10:00 [Buildroot] [PATCH v2] minidlna: fix static link Vicente Olivert Riera
@ 2015-07-09 12:09 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2015-07-09 12:09 UTC (permalink / raw)
To: buildroot
Dear Vicente Olivert Riera,
On Thu, 9 Jul 2015 12:00:04 +0200, Vicente Olivert Riera wrote:
> 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'
>
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> ---
> v1 -> v2: remove unnecessary -lexif
>
> package/minidlna/minidlna.mk | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/package/minidlna/minidlna.mk b/package/minidlna/minidlna.mk
> index 7adb832..37543d6 100644
> --- a/package/minidlna/minidlna.mk
> +++ b/package/minidlna/minidlna.mk
> @@ -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
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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-09 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-09 10:00 [Buildroot] [PATCH v2] minidlna: fix static link Vicente Olivert Riera
2015-07-09 12:09 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox