[beast/devel: 5/28] BSE: FLAC: fix includes: .h -> .hh; support old & new flac versions in configure



commit 334a63f1aac1edd0d0052f2321a029a6b19f68da
Author: Stefan Westerfeld <stefan space twc de>
Date:   Fri Mar 8 14:26:26 2013 +0100

    BSE: FLAC: fix includes: .h -> .hh; support old & new flac versions in configure

 bse/bsedatahandle-flac.cc |    8 ++++----
 bse/bseloader-flac.cc     |   14 +++++++-------
 configure.in              |    6 ++++++
 3 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/bse/bsedatahandle-flac.cc b/bse/bsedatahandle-flac.cc
index c4ce0ce..428f8fb 100644
--- a/bse/bsedatahandle-flac.cc
+++ b/bse/bsedatahandle-flac.cc
@@ -14,16 +14,16 @@
  * A copy of the GNU Lesser General Public License should ship along
  * with this library; if not, see http://www.gnu.org/copyleft/.
  */
-#include "gsldatahandle.h"
-#include "gsldatautils.h"
-#include "gslfilter.h"
+#include "gsldatahandle.hh"
+#include "gsldatautils.hh"
+#include "gslfilter.hh"
 #include "bseblockutils.hh"
 #include <complex>
 #include <vector>
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
-#include "stream_decoder.h"
+#include <FLAC/stream_decoder.h>
 
 namespace Bse {
 
diff --git a/bse/bseloader-flac.cc b/bse/bseloader-flac.cc
index 3a58df5..688cd24 100644
--- a/bse/bseloader-flac.cc
+++ b/bse/bseloader-flac.cc
@@ -1,10 +1,10 @@
-  #include "bseloader.h"
-  #include <stdio.h>
-  #include <errno.h>
-  #include <string.h>
-  #include <vector>
-  #include <string>
-  #include <FLAC/stream_decoder.h>
+#include "bseloader.hh"
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <vector>
+#include <string>
+#include <FLAC/stream_decoder.h>
 
 namespace {
 
diff --git a/configure.in b/configure.in
index 4eacc9f..ec59916 100644
--- a/configure.in
+++ b/configure.in
@@ -237,6 +237,12 @@ AC_DEFUN([AC_BSE_REQUIREMENTS],
     dnl # --- FLAC check ---
     PKG_CHECK_MODULES(FLAC, flac)
 
+    dnl # old FLAC versions use "-I/usr/.../include/FLAC" as pkg-config --cflags
+    dnl # new FLAC versions use "-I/usr/.../include" as pkg-config --cflags
+    dnl #
+    dnl # to support both, we strip /FLAC from FLAC_CFLAGS and use #include <FLAC/foo.h>
+    FLAC_CFLAGS=`echo $FLAC_CLFAGS | $SED "s/FLAC$//"`
+
     dnl # --- libmad MPEG decoder check ---
     dnl # libmad doesn't come with a mad.pc file (just its debian package)
     dnl # PKG_CHECK_MODULES(MAD, mad >= 0.14.2,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]