shithub: opus-tools

Download patch

ref: 27fd96db7bbd9285234a7a1e637225a73314779a
parent: 3b57d674ed62ccb7adf36a033f3b620ab33e537d
author: Ralph Giles <giles@mozilla.com>
date: Thu Feb 7 08:18:14 EST 2013

Don't clobber FLAC_CFLAGS and FLAC_LIBS from the command line.

PKG_CHECK_MODULES() inserts help text about being able to override
the pkg-config output with appropriate environment flags, and indeed
the macro respects this and does nothing if they're both set.

The subsequent fallback checks for system libFLAC were variously
clobbering and ignoring any previous values for the flags variables,
making the help text incorrect and preventing their use to build
against an uninstalled flac library.

Note that PKG_CHECK_MODULES() actually reports 'yes' that it's
found flac if both FLAC_CFLAGS and FLAC_LIBS are non-empty strings,
without verifying that they work.

Thanks to Nekit1234007 for reporting the issue.

--- a/configure.ac
+++ b/configure.ac
@@ -198,7 +198,7 @@
   if test "x$HAVE_FLAC" = "xno"
   then
     dnl fall back to AC_CHECK_LIB
-    AC_CHECK_LIB(m,log,FLAC_LIBS="-lm")
+    AC_CHECK_LIB(m,log,FLAC_LIBS="$FLAC_LIBS -lm")
     AC_CHECK_LIB(FLAC, [FLAC__stream_decoder_init_ogg_stream],
       [
         HAVE_FLAC="yes"
@@ -222,7 +222,7 @@
         ])
         HAVE_FLAC="no"
       ],
-      []
+      [$FLAC_CFLAGS]
     )
   fi
   CFLAGS="$FLAC_CFLAGS $CFLAGS"