From b8c1375e6b71974ec00206905a30ee7d88a61065 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Sat, 2 Jun 2018 11:05:48 -0700 Subject: [PATCH] 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. --- contrib/libopus/A00-static-pkg-config.patch | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 contrib/libopus/A00-static-pkg-config.patch 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 -- 2.40.0