Skip to contentSkip to conversation

package/libshout: add patches to fix static linking

PATCH Superseded Jörg Krause 2 participants 2 messages Aug 27, 2016 – Aug 28, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libshout: add patches to fix static linking

This series includes two patches to fix static linking with libshout.

The first patch fixes two typos resulting in an uninterpretable library propagation and is mainly needed for the follow-up patch.

The second patch adds the field 'Libs.private' to the pkg-config file so when static linking with libshout the needed libraries are correctly propagated.

Note that autoreconf is enabled as the first patch touches configure.ac.

Fixes:
http://autobuild.buildroot.net/results/b82/b82408fccbf816575125dcc1a1de7260f66f62e8/
http://autobuild.buildroot.net/results/360/3605750023267e4cd35d98451bd283f9e70a6106/
http://autobuild.buildroot.net/results/03b/03b98b313dd6ed2909607cdc0c4f6fb87be3ccfe/
http://autobuild.buildroot.net/results/70b/70ba47e04d1fc0d2379bf1ac7aab4c52d6193001/

---
 .../0001-Fix-THEORA-SPEEX-_LDFLAGS-typo.patch      | 45 ++++++++++++++++
 ...Add-Libs.private-field-to-pkg-config-file.patch | 61 ++++++++++++++++++++++
 package/libshout/libshout.mk                       |  3 ++
 3 files changed, 109 insertions(+)
 create mode 100644 package/libshout/0001-Fix-THEORA-SPEEX-_LDFLAGS-typo.patch
 create mode 100644 package/libshout/0002-Add-Libs.private-field-to-pkg-config-file.patch
package/libshout/0001-Fix-THEORA-SPEEX-_LDFLAGS-typo.patch new file +45 -0
new file mode 100644
index 0000000..4d173c5
@@ -0,0 +1,45 @@
+From d96a3cafeebeb80b4796bacbe0e6da0bbd3ee48e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Krause?= <[email protected]>
+Date: Sun, 28 Aug 2016 00:39:55 +0200
+Subject: [PATCH 1/2] Fix {THEORA,SPEEX}_LDFLAGS typo
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Needed to properly link against libshout, otherwise the build fails with:
+
+  error: LDFLAGS: No such file or directory
+
+Upstream status: pending
+https://github.com/xiph/Icecast-libshout/pull/4
+
+Signed-off-by: J?rg Krause <[email protected]>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 87a7f55..85f18ad 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -134,7 +134,7 @@ PKG_CHECK_MODULES(THEORA, theora, [
+   ])
+ fi
+ XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$THEORA_CFLAGS])
+-XIPH_VAR_PREPEND([XIPH_LIBS],[$THEORA LDFLAGS $THEORA_LIBS])
++XIPH_VAR_PREPEND([XIPH_LIBS],[$THEORA_LDFLAGS $THEORA_LIBS])
+ AM_CONDITIONAL([HAVE_THEORA], [test -n "$THEORA_LIBS"])
+ if test -n "$THEORA_LIBS"
+ then
+@@ -153,7 +153,7 @@ PKG_CHECK_MODULES(SPEEX, speex, [
+   ])
+ fi
+ XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$SPEEX_CFLAGS])
+-XIPH_VAR_PREPEND([XIPH_LIBS],[$SPEEX LDFLAGS $SPEEX_LIBS])
++XIPH_VAR_PREPEND([XIPH_LIBS],[$SPEEX_LDFLAGS $SPEEX_LIBS])
+ AM_CONDITIONAL([HAVE_SPEEX], [test -n "$SPEEX_LIBS"])
+ if test -n "$SPEEX_LIBS"
+ then
+-- 
+2.9.3
+
package/libshout/0002-Add-Libs.private-field-to-pkg-config-file.patch new file +61 -0

61 lines not on this page · raw message

package/libshout/libshout.mk +3 -0
index 029c134..9f54463 100644
@@ -11,6 +11,9 @@ LIBSHOUT_LICENSE_FILES = COPYING
 LIBSHOUT_INSTALL_STAGING = YES
 LIBSHOUT_DEPENDENCIES = host-pkgconf libogg libvorbis
 
+# patching congigure.ac
+LIBSHOUT_AUTORECONF = YES
+
 ifeq ($(BR2_PACKAGE_LIBTHEORA),y)
 LIBSHOUT_CONF_OPTS += --enable-theora
 LIBSHOUT_DEPENDENCIES += libtheora
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 package/libshout: add patches to fix static linking

Hello,

Quoted 21 lines · J?rg Krause
package/libshout/0002-Add-Libs.private-field-to-pkg-config-file.patch new file +21 -0
+The Libs.private field is specifically designed for such usage:
+
+From pkg-config documentation:
+
+  Libs.private:
+
+     This line should list any private libraries in use. Private
+     libraries are libraries which are not exposed through your
+     library, but are needed in the case of static linking.
+
+Therefore, this patch adds a reference to vorbis and speex in the Libs.private
+field of libshouts pkg-config file.
+
+Upstream status: pending
+https://github.com/xiph/Icecast-libshout/pull/5
+
+Signed-off-by: J?rg Krause <[email protected]>
+---
+ shout.pc.in | 1 +
+ 1 file changed, 1 insertion(+)
+

package/libshout/0002-Add-Libs.private-field-to-pkg-config-file.patch line 58

Quoted 10 lines
package/libshout/0002-Add-Libs.private-field-to-pkg-config-file.patch new file +10 -0
+diff --git a/shout.pc.in b/shout.pc.in
+index 867a0be..4827295 100644
+--- a/shout.pc.in
++++ b/shout.pc.in
+@@ -12,4 +12,5 @@ Description: Audio streaming library for icecast encoders
+ Version: @VERSION@
+ Requires.private: @SHOUT_REQUIRES@
+ Libs: -L${libdir} -lshout
++Libs.private: @VORBIS_LIBS@ @XIPH_LIBS@
+ Cflags: -I${includedir} @PTHREAD_CPPFLAGS@ @SHOUT_CFLAGS@

Since OpenSSL installs its own .pc files, you should rather look at using the Requires.private field rather than the Libs.private field.

Requires.private is a list of pkg-config packages that you need to link with, when static linking.

In other words, you need to make sure that @SHOUT_REQUIRES@ contains the right list of pkg-config packages.

Best regards,

Thomas

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