summaryrefslogtreecommitdiffstats
path: root/contrib/libopus
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2018-06-02 11:05:48 -0700
committerGitHub <[email protected]>2018-06-02 11:05:48 -0700
commitb8c1375e6b71974ec00206905a30ee7d88a61065 (patch)
treece35fd89eb4a9e0f618ce08863bc71f5c07b9af8 /contrib/libopus
parent18e183a99205b7761846199894031da107febee9 (diff)
opus: fix opus.pc pkg-config file for static builds (#1380)
The generated opus.pc file results in undefined symbols during ffmpeg's configure tests. libm is not getting added to the link line as required. The opus.pc file needs to include -lm in the Libs instead of Libs.private when generating *only* a static library.
Diffstat (limited to 'contrib/libopus')
-rw-r--r--contrib/libopus/A00-static-pkg-config.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/libopus/A00-static-pkg-config.patch b/contrib/libopus/A00-static-pkg-config.patch
new file mode 100644
index 000000000..70ef32699
--- /dev/null
+++ b/contrib/libopus/A00-static-pkg-config.patch
@@ -0,0 +1,38 @@
+diff -ur opus-1.2.1.orig/configure.ac opus-1.2.1/configure.ac
+--- opus-1.2.1.orig/configure.ac 2017-06-26 11:06:46.000000000 -0700
++++ opus-1.2.1/configure.ac 2018-06-01 17:00:15.140159087 -0700
+@@ -812,6 +812,13 @@
+ AC_DEFINE([ENABLE_UPDATE_DRAFT], [1], [Enable bitstream changes from draft-ietf-codec-opus-update])
+ ])
+
++AS_IF([test "$enable_shared" = "no"], [
++ LIBM_SHARED=""
++ LIBM_STATIC="$LIBM"
++], [
++ LIBM_SHARED="$LIBM"
++ LIBM_STATIC=""
++])
+
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+@@ -843,6 +850,8 @@
+ AC_CHECK_FUNCS([__malloc_hook])
+
+ AC_SUBST([PC_BUILD])
++AC_SUBST([LIBM_SHARED])
++AC_SUBST([LIBM_STATIC])
+
+ AC_CONFIG_FILES([
+ Makefile
+diff -ur opus-1.2.1.orig/opus.pc.in opus-1.2.1/opus.pc.in
+--- opus-1.2.1.orig/opus.pc.in 2017-06-15 15:24:07.000000000 -0700
++++ opus-1.2.1/opus.pc.in 2018-06-01 17:00:26.500350502 -0700
+@@ -11,6 +11,6 @@
+ Version: @VERSION@
+ Requires:
+ Conflicts:
+-Libs: -L${libdir} -lopus
+-Libs.private: @LIBM@
++Libs: -L${libdir} -lopus @LIBM_STATIC@
++Libs.private: @LIBM_SHARED@
+ Cflags: -I${includedir}/opus