From f4f4a908bbc8c128e6383e9f45124dce83b1c391 Mon Sep 17 00:00:00 2001
From: Avuton Olrich <avuton@gmail.com>
Date: Thu, 22 Apr 2010 19:10:37 -0700
Subject: [PATCH] configure.ac: When compiling FLAC with ogg API, linking with
 ogg is mandatory.

---
 configure.ac | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configure.ac b/configure.ac
index 45bff8948..583659426 100644
--- a/configure.ac
+++ b/configure.ac
@@ -766,6 +766,12 @@ if test x$enable_flac = xyes; then
 	fi
 	CFLAGS="$oldcflags"
 	LIBS="$oldlibs"
+
+	if test x$enable_oggflac = xflac; then
+		PKG_CHECK_MODULES(OGG, [ogg], FLAC_LIBS="${FLAC_LIBS} -logg",
+			enable_oggflac=yes; 
+			AC_MSG_WARN("FLAC has the ogg API built in, but couldn't find ogg. Disabling oggflac."))
+	fi
 fi
 
 AM_CONDITIONAL(HAVE_FLAC, test x$enable_flac = xyes)