[flac-dev] [PATCH 2/2] Update and improve autotools build

Cristian Rodríguez crrodriguez at opensuse.org
Sat Apr 7 15:24:21 PDT 2012


- INCLUDES is deprecated, and CPPFLAGS is an user-defined
  variable, use the proper AM_CPPFLAGS instead

- Remove FLAC__INLINE definition, providing proper
  replacement for MSVC compilers.

- Detect if we have C99 's lround and provide a replacement
  for windows...
---
 configure.ac                               |   32 ++++++++--------------------
 examples/c/decode/file/Makefile.am         |    2 +-
 examples/c/encode/file/Makefile.am         |    2 +-
 examples/cpp/decode/file/Makefile.am       |    2 +-
 examples/cpp/encode/file/Makefile.am       |    2 +-
 include/FLAC++/Makefile.am                 |    2 +-
 src/flac/Makefile.am                       |    2 +-
 src/libFLAC++/Makefile.am                  |    2 +-
 src/libFLAC/Makefile.am                    |    5 +++--
 src/libFLAC/bitreader.c                    |   14 +++++-------
 src/libFLAC/bitwriter.c                    |   16 ++++++--------
 src/libFLAC/ia32/Makefile.am               |    2 +-
 src/libFLAC/include/private/macros.h       |    6 ++++++
 src/libFLAC/lpc.c                          |   28 ++++++++++++------------
 src/libFLAC/stream_encoder.c               |    7 ++----
 src/metaflac/Makefile.am                   |    2 +-
 src/plugin_common/Makefile.am              |    2 +-
 src/plugin_xmms/Makefile.am                |    3 +--
 src/share/getopt/Makefile.am               |    2 +-
 src/share/grabbag/Makefile.am              |    2 +-
 src/share/replaygain_analysis/Makefile.am  |    2 +-
 src/share/replaygain_synthesis/Makefile.am |    2 +-
 src/share/utf8/Makefile.am                 |    2 +-
 src/test_grabbag/cuesheet/Makefile.am      |    1 +
 src/test_grabbag/picture/Makefile.am       |    2 +-
 src/test_libFLAC++/Makefile.am             |    2 +-
 src/test_libFLAC/Makefile.am               |    2 +-
 src/test_libs_common/Makefile.am           |    2 +-
 src/test_seeking/Makefile.am               |    2 +-
 src/test_streams/Makefile.am               |    2 +-
 30 files changed, 68 insertions(+), 86 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7627fb7..e794ca2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,27 +18,18 @@
 # NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__
 # instead of FLAC__ since autoconf triggers off 'AC_' in strings
 
-AC_INIT(src/flac/main.c)
-AM_INIT_AUTOMAKE(flac, 1.2.1)
+AC_PREREQ(2.60)
+AC_INIT([flac], [1.2.1])
+AC_CONFIG_SRCDIR([src/flac/main.c])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([foreign -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 
 #Prefer whatever the current ISO standard is.
 AC_PROG_CC_STDC
 AC_USE_SYSTEM_EXTENSIONS
-# Enable the generation of shared libraries under Win32
-AC_LIBTOOL_WIN32_DLL
-
-# We need two libtools, one that builds both shared and static, and
-# one that builds only static.  This is because the resulting libtool
-# does not allow us to choose which to build at runtime.
-AM_PROG_LIBTOOL
-sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
-chmod +x libtool-disable-static
-
-AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
-AC_CONFIG_MACRO_DIR([m4])
-
+LT_INIT([win32-dll disable-static pic-only])
 AM_PROG_AS
 AC_PROG_CXX
 AC_PROG_MAKE_SET
@@ -47,7 +38,7 @@ AC_SYS_LARGEFILE
 AC_FUNC_FSEEKO
 
 AC_CHECK_SIZEOF(void*,0)
-
+AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
 #@@@ new name is AC_CONFIG_HEADERS
 AM_CONFIG_HEADER(config.h)
 
@@ -348,18 +339,13 @@ AC_DEFINE(FLAC__HAS_GAS)
 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
 fi
 
-CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'" $CPPFLAGS"
 if test "x$debug" = xtrue; then
-	CPPFLAGS="-DDEBUG -DFLaC__INLINE= $CPPFLAGS"
+	CPPFLAGS="-DDEBUG $CPPFLAGS"
 	CFLAGS="-g $CFLAGS"
 else
 	CPPFLAGS="-DNDEBUG $CPPFLAGS"
-	# $ac_cv_c_inline from AC_C_INLINE
-	if test "x$ac_cv_c_inline" != xno ; then
-		CPPFLAGS="-DFLaC__INLINE=$ac_cv_c_inline $CPPFLAGS"
-	fi
 	if test "x$GCC" = xyes; then
-		CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
+    CFLAGS="-O3 -funroll-loops -Wall -W -Winline $CFLAGS"
 	fi
 fi
 
diff --git a/examples/c/decode/file/Makefile.am b/examples/c/decode/file/Makefile.am
index 11a48bf..30f8691 100644
--- a/examples/c/decode/file/Makefile.am
+++ b/examples/c/decode/file/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
 	Makefile.lite \
 	example_c_decode_file.dsp \
 	example_c_decode_file.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = example_c_decode_file
 example_c_decode_file_LDADD = \
 	$(top_builddir)/src/libFLAC/libFLAC.la \
diff --git a/examples/c/encode/file/Makefile.am b/examples/c/encode/file/Makefile.am
index 5ae7a63..0ed519a 100644
--- a/examples/c/encode/file/Makefile.am
+++ b/examples/c/encode/file/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
 	Makefile.lite \
 	example_c_encode_file.dsp \
 	example_c_encode_file.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = example_c_encode_file
 example_c_encode_file_LDADD = \
 	$(top_builddir)/src/libFLAC/libFLAC.la \
diff --git a/examples/cpp/decode/file/Makefile.am b/examples/cpp/decode/file/Makefile.am
index 7b807e6..f55555b 100644
--- a/examples/cpp/decode/file/Makefile.am
+++ b/examples/cpp/decode/file/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
 	Makefile.lite \
 	example_cpp_decode_file.dsp \
 	example_cpp_decode_file.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = example_cpp_decode_file
 example_cpp_decode_file_LDADD = \
 	$(top_builddir)/src/libFLAC++/libFLAC++.la \
diff --git a/examples/cpp/encode/file/Makefile.am b/examples/cpp/encode/file/Makefile.am
index 42589f0..d07064f 100644
--- a/examples/cpp/encode/file/Makefile.am
+++ b/examples/cpp/encode/file/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
 	Makefile.lite \
 	example_cpp_encode_file.dsp \
 	example_cpp_encode_file.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = example_cpp_encode_file
 example_cpp_encode_file_LDADD = \
 	$(top_builddir)/src/libFLAC++/libFLAC++.la \
diff --git a/include/FLAC++/Makefile.am b/include/FLAC++/Makefile.am
index 510ed76..bd93790 100644
--- a/include/FLAC++/Makefile.am
+++ b/include/FLAC++/Makefile.am
@@ -29,7 +29,7 @@
 #  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 flaccppincludedir = $(includedir)/FLAC++
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 flaccppinclude_HEADERS = \
 	all.h \
 	decoder.h \
diff --git a/src/flac/Makefile.am b/src/flac/Makefile.am
index 17cfcce..d2c9f07 100644
--- a/src/flac/Makefile.am
+++ b/src/flac/Makefile.am
@@ -18,7 +18,7 @@
 bin_PROGRAMS = flac
 
 AM_CFLAGS = @OGG_CFLAGS@
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 EXTRA_DIST = \
 	Makefile.lite \
 	Makefile.lite.iffscan \
diff --git a/src/libFLAC++/Makefile.am b/src/libFLAC++/Makefile.am
index abc5f9a..06fa6a1 100644
--- a/src/libFLAC++/Makefile.am
+++ b/src/libFLAC++/Makefile.am
@@ -35,7 +35,7 @@ m4data_DATA = libFLAC++.m4
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = flac++.pc
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 EXTRA_DIST = \
 	Makefile.lite \
 	flac++.pc.in \
diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am
index 2deb958..134168e 100644
--- a/src/libFLAC/Makefile.am
+++ b/src/libFLAC/Makefile.am
@@ -28,6 +28,7 @@
 #  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 #  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 lib_LTLIBRARIES = libFLAC.la
 if DEBUG
 DEBUGCFLAGS = -DFLAC__OVERFLOW_DETECT
@@ -77,7 +78,7 @@ endif
 endif
 endif
 
-libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@
+libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ -lm
 
 SUBDIRS = $(ARCH_SUBDIRS) include .
 
@@ -104,7 +105,7 @@ extra_ogg_sources = \
 	ogg_mapping.c
 endif
 # see 'http://www.gnu.org/software/libtool/manual.html#Libtool-versioning' for numbering convention
-libFLAC_la_LDFLAGS = -version-info 10:0:2 -lm $(LOCAL_EXTRA_LDFLAGS) @LT_NO_UNDEFINED@
+libFLAC_la_LDFLAGS = -version-info 10:0:2 $(LOCAL_EXTRA_LDFLAGS) @LT_NO_UNDEFINED@
 libFLAC_la_SOURCES = \
 	bitmath.c \
 	bitreader.c \
diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c
index 7e17fd8..ae515a0 100644
--- a/src/libFLAC/bitreader.c
+++ b/src/libFLAC/bitreader.c
@@ -117,10 +117,6 @@ static const unsigned char byte_to_unary_table[] = {
 #define FLAC__U64L(x) x##LLU
 #endif
 
-#ifndef FLaC__INLINE
-#define FLaC__INLINE
-#endif
-
 /* WATCHOUT: assembly routines rely on the order in which these fields are declared */
 struct FLAC__BitReader {
 	/* any partially-consumed word at the head will stay right-justified as bits are consumed from the left */
@@ -138,7 +134,7 @@ struct FLAC__BitReader {
 	FLAC__CPUInfo cpu_info;
 };
 
-static FLaC__INLINE void crc16_update_word_(FLAC__BitReader *br, uint32_t word)
+static inline void crc16_update_word_(FLAC__BitReader *br, uint32_t word)
 {
 	register unsigned crc = br->read_crc16;
 #if FLAC__BYTES_PER_WORD == 4
@@ -373,17 +369,17 @@ FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br)
 	return br->read_crc16;
 }
 
-FLaC__INLINE FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br)
+inline FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br)
 {
 	return ((br->consumed_bits & 7) == 0);
 }
 
-FLaC__INLINE unsigned FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br)
+inline unsigned FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br)
 {
 	return 8 - (br->consumed_bits & 7);
 }
 
-FLaC__INLINE unsigned FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br)
+inline unsigned FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br)
 {
 	return (br->words-br->consumed_words)*FLAC__BITS_PER_WORD + br->bytes*8 - br->consumed_bits;
 }
@@ -499,7 +495,7 @@ FLAC__bool FLAC__bitreader_read_raw_uint64(FLAC__BitReader *br, FLAC__uint64 *va
 	return true;
 }
 
-FLaC__INLINE FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val)
+inline FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val)
 {
 	FLAC__uint32 x8, x32 = 0;
 
diff --git a/src/libFLAC/bitwriter.c b/src/libFLAC/bitwriter.c
index 44914d1..1f005a3 100644
--- a/src/libFLAC/bitwriter.c
+++ b/src/libFLAC/bitwriter.c
@@ -75,10 +75,6 @@ static const unsigned FLAC__BITWRITER_DEFAULT_INCREMENT = 4096u / sizeof(uint32_
 #define FLAC__U64L(x) x##LLU
 #endif
 
-#ifndef FLaC__INLINE
-#define FLaC__INLINE
-#endif
-
 struct FLAC__BitWriter {
 	uint32_t *buffer;
 	uint32_t accum; /* accumulator; bits are right-justified; when full, accum is appended to buffer */
@@ -270,7 +266,7 @@ void FLAC__bitwriter_release_buffer(FLAC__BitWriter *bw)
 	(void)bw;
 }
 
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsigned bits)
+inline FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsigned bits)
 {
 	unsigned n;
 
@@ -308,7 +304,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsign
 	return true;
 }
 
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits)
+inline FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits)
 {
 	register unsigned left;
 
@@ -347,7 +343,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FL
 	return true;
 }
 
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, unsigned bits)
+inline FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, unsigned bits)
 {
 	/* zero-out unused bits */
 	if(bits < 32)
@@ -356,7 +352,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLA
 	return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, bits);
 }
 
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, unsigned bits)
+inline FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, unsigned bits)
 {
 	/* this could be a little faster but it's not used for much */
 	if(bits > 32) {
@@ -368,7 +364,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FL
 		return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, bits);
 }
 
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val)
+inline FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val)
 {
 	/* this doesn't need to be that fast as currently it is only used for vorbis comments */
 
@@ -384,7 +380,7 @@ FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__Bit
 	return true;
 }
 
-FLaC__INLINE FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], unsigned nvals)
+inline FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], unsigned nvals)
 {
 	unsigned i;
 
diff --git a/src/libFLAC/ia32/Makefile.am b/src/libFLAC/ia32/Makefile.am
index 2e85f75..f3ff943 100644
--- a/src/libFLAC/ia32/Makefile.am
+++ b/src/libFLAC/ia32/Makefile.am
@@ -31,7 +31,7 @@
 SUFFIXES = .nasm .lo
 
 STRIP_NON_ASM = sh $(top_srcdir)/strip_non_asm_libtool_args.sh
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 .nasm.lo:
 	$(LIBTOOL) --tag=CC --mode=compile $(STRIP_NON_ASM) $(NASM) -f $(OBJ_FORMAT) -d OBJ_FORMAT_$(OBJ_FORMAT) -i$(srcdir)/ $< -o $@
 
diff --git a/src/libFLAC/include/private/macros.h b/src/libFLAC/include/private/macros.h
index b9989e1..5104dc9 100644
--- a/src/libFLAC/include/private/macros.h
+++ b/src/libFLAC/include/private/macros.h
@@ -57,4 +57,10 @@
 #define flac_min(a,b) __min(a,b)
 #endif
 
+#if !defined(__cplusplus) && defined(_MSC_VER)
+#ifndef inline
+#define inline __inline
+#endif
+#endif
+
 #endif
diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c
index e3842c5..02cda9a 100644
--- a/src/libFLAC/lpc.c
+++ b/src/libFLAC/lpc.c
@@ -38,6 +38,7 @@
 #include "FLAC/format.h"
 #include "private/bitmath.h"
 #include "private/lpc.h"
+#include "private/macros.h"
 #if defined DEBUG || defined FLAC__OVERFLOW_DETECT || defined FLAC__OVERFLOW_DETECT_VERBOSE
 #include <stdio.h>
 #endif
@@ -52,6 +53,18 @@
 #define M_LN2 0.69314718055994530942
 #endif
 
+#if !defined(HAVE_LROUND)
+#if defined(_MSC_VER)
+#include <float.h>
+#define copysign _copysign
+#elif defined(__GNUC__)
+#define copysign __builtin_copysign
+#endif
+static inline long int lround(double x) {
+    return (long)(x + copysign (0.5, x));
+}
+//If this fails, we are in the precence of a mid 90's compiler..move along...
+#endif
 
 void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], unsigned data_len)
 {
@@ -199,14 +212,8 @@ int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order,
 		FLAC__int32 q;
 		for(i = 0; i < order; i++) {
 			error += lp_coeff[i] * (1 << *shift);
-#if 1 /* unfortunately lround() is C99 */
-			if(error >= 0.0)
-				q = (FLAC__int32)(error + 0.5);
-			else
-				q = (FLAC__int32)(error - 0.5);
-#else
 			q = lround(error);
-#endif
+
 #ifdef FLAC__OVERFLOW_DETECT
 			if(q > qmax+1) /* we expect q==qmax+1 occasionally due to rounding */
 				fprintf(stderr,"FLAC__lpc_quantize_coefficients: quantizer overflow: q>qmax %d>%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmax,*shift,cmax,precision+1,i,lp_coeff[i]);
@@ -234,14 +241,7 @@ int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order,
 #endif
 		for(i = 0; i < order; i++) {
 			error += lp_coeff[i] / (1 << nshift);
-#if 1 /* unfortunately lround() is C99 */
-			if(error >= 0.0)
-				q = (FLAC__int32)(error + 0.5);
-			else
-				q = (FLAC__int32)(error - 0.5);
-#else
 			q = lround(error);
-#endif
 #ifdef FLAC__OVERFLOW_DETECT
 			if(q > qmax+1) /* we expect q==qmax+1 occasionally due to rounding */
 				fprintf(stderr,"FLAC__lpc_quantize_coefficients: quantizer overflow: q>qmax %d>%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmax,*shift,cmax,precision+1,i,lp_coeff[i]);
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index ce0c8da..7e102a5 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -68,9 +68,6 @@
 #include "private/stream_encoder_framing.h"
 #include "private/window.h"
 
-#ifndef FLaC__INLINE
-#define FLaC__INLINE
-#endif
 
 /* Exact Rice codeword length calculation is off by default.  The simple
  * (and fast) estimation (of how many bits a residual value will be
@@ -3886,7 +3883,7 @@ void precompute_partition_info_escapes_(
 }
 
 #ifdef EXACT_RICE_BITS_CALCULATION
-static FLaC__INLINE unsigned count_rice_bits_in_partition_(
+static inline unsigned count_rice_bits_in_partition_(
 	const unsigned rice_parameter,
 	const unsigned partition_samples,
 	const FLAC__int32 *residual
@@ -3901,7 +3898,7 @@ static FLaC__INLINE unsigned count_rice_bits_in_partition_(
 	return partition_bits;
 }
 #else
-static FLaC__INLINE unsigned count_rice_bits_in_partition_(
+static inline unsigned count_rice_bits_in_partition_(
 	const unsigned rice_parameter,
 	const unsigned partition_samples,
 	const FLAC__uint64 abs_residual_partition_sum
diff --git a/src/metaflac/Makefile.am b/src/metaflac/Makefile.am
index 76feb38..c7deb9e 100644
--- a/src/metaflac/Makefile.am
+++ b/src/metaflac/Makefile.am
@@ -18,7 +18,7 @@
 bin_PROGRAMS = metaflac
 
 AM_CFLAGS = @OGG_CFLAGS@
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 EXTRA_DIST = \
 	Makefile.lite \
 	metaflac.dsp \
diff --git a/src/plugin_common/Makefile.am b/src/plugin_common/Makefile.am
index 147ee15..0f557fd 100644
--- a/src/plugin_common/Makefile.am
+++ b/src/plugin_common/Makefile.am
@@ -17,7 +17,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 
 noinst_LTLIBRARIES = libplugin_common.la
 
diff --git a/src/plugin_xmms/Makefile.am b/src/plugin_xmms/Makefile.am
index b9c4f8b..f96b3ae 100644
--- a/src/plugin_xmms/Makefile.am
+++ b/src/plugin_xmms/Makefile.am
@@ -31,8 +31,7 @@ noinst_HEADERS = \
 	tag.h
 
 AM_CFLAGS = @OGG_CFLAGS@ @XMMS_CFLAGS@
-
-INCLUDES = -I$(top_srcdir)/src
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src
 if FLaC__INSTALL_XMMS_PLUGIN_LOCALLY
 xmmsinputplugindir = $(HOME)/.xmms/Plugins
 else
diff --git a/src/share/getopt/Makefile.am b/src/share/getopt/Makefile.am
index f40464e..70ea506 100644
--- a/src/share/getopt/Makefile.am
+++ b/src/share/getopt/Makefile.am
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-INCLUDES = -I$(top_srcdir)/include/share
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -I$(top_srcdir)/include/share
 
 noinst_LIBRARIES = libgetopt.a
 
diff --git a/src/share/grabbag/Makefile.am b/src/share/grabbag/Makefile.am
index c59ddca..d871b83 100644
--- a/src/share/grabbag/Makefile.am
+++ b/src/share/grabbag/Makefile.am
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 
 noinst_LTLIBRARIES = libgrabbag.la
 
diff --git a/src/share/replaygain_analysis/Makefile.am b/src/share/replaygain_analysis/Makefile.am
index de841aa..083b5f8 100644
--- a/src/share/replaygain_analysis/Makefile.am
+++ b/src/share/replaygain_analysis/Makefile.am
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-INCLUDES = -I$(top_srcdir)/include/share
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -I$(top_srcdir)/include/share
 
 noinst_LTLIBRARIES = libreplaygain_analysis.la
 
diff --git a/src/share/replaygain_synthesis/Makefile.am b/src/share/replaygain_synthesis/Makefile.am
index 4ea9e8a..c8de600 100644
--- a/src/share/replaygain_synthesis/Makefile.am
+++ b/src/share/replaygain_synthesis/Makefile.am
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = foreign
 
 SUBDIRS = include .
 
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/include/share
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -I$(top_srcdir)/include/share
 
 noinst_LTLIBRARIES = libreplaygain_synthesis.la
 
diff --git a/src/share/utf8/Makefile.am b/src/share/utf8/Makefile.am
index bc42c2d..9e2c0c9 100644
--- a/src/share/utf8/Makefile.am
+++ b/src/share/utf8/Makefile.am
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-INCLUDES = -I$(top_srcdir)/include/share
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -I$(top_srcdir)/include/share
 
 noinst_LTLIBRARIES = libutf8.la
 
diff --git a/src/test_grabbag/cuesheet/Makefile.am b/src/test_grabbag/cuesheet/Makefile.am
index 533a861..98f8324 100644
--- a/src/test_grabbag/cuesheet/Makefile.am
+++ b/src/test_grabbag/cuesheet/Makefile.am
@@ -20,6 +20,7 @@ EXTRA_DIST = \
 	test_cuesheet.dsp \
 	test_cuesheet.vcproj
 
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = test_cuesheet
 test_cuesheet_SOURCES = \
 	main.c
diff --git a/src/test_grabbag/picture/Makefile.am b/src/test_grabbag/picture/Makefile.am
index cce0cdf..8e86be6 100644
--- a/src/test_grabbag/picture/Makefile.am
+++ b/src/test_grabbag/picture/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
 	Makefile.lite \
 	test_picture.dsp \
 	test_picture.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = test_picture
 test_picture_SOURCES = \
 	main.c
diff --git a/src/test_libFLAC++/Makefile.am b/src/test_libFLAC++/Makefile.am
index 0713221..870ca97 100644
--- a/src/test_libFLAC++/Makefile.am
+++ b/src/test_libFLAC++/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
 	Makefile.lite \
 	test_libFLAC++.dsp \
 	test_libFLAC++.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = test_libFLAC++
 test_libFLAC___LDADD = \
 	$(top_builddir)/src/share/grabbag/libgrabbag.la \
diff --git a/src/test_libFLAC/Makefile.am b/src/test_libFLAC/Makefile.am
index 8eb9cfa..91a57fb 100644
--- a/src/test_libFLAC/Makefile.am
+++ b/src/test_libFLAC/Makefile.am
@@ -20,7 +20,7 @@ EXTRA_DIST = \
 	test_libFLAC.dsp \
 	test_libFLAC.vcproj
 
-INCLUDES = -I$(top_srcdir)/src/libFLAC/include
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src/libFLAC/include
 
 noinst_PROGRAMS = test_libFLAC
 test_libFLAC_LDADD = \
diff --git a/src/test_libs_common/Makefile.am b/src/test_libs_common/Makefile.am
index 0021459..41d71c2 100644
--- a/src/test_libs_common/Makefile.am
+++ b/src/test_libs_common/Makefile.am
@@ -15,7 +15,7 @@
 #  along with this program; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 
 noinst_LTLIBRARIES = libtest_libs_common.la
 
diff --git a/src/test_seeking/Makefile.am b/src/test_seeking/Makefile.am
index 8be7579..8e315e4 100644
--- a/src/test_seeking/Makefile.am
+++ b/src/test_seeking/Makefile.am
@@ -22,7 +22,7 @@ EXTRA_DIST = \
 
 AM_CFLAGS = @OGG_CFLAGS@
 
-INCLUDES =
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 
 noinst_PROGRAMS = test_seeking
 test_seeking_LDADD = \
diff --git a/src/test_streams/Makefile.am b/src/test_streams/Makefile.am
index ec9ec4f..90d568b 100644
--- a/src/test_streams/Makefile.am
+++ b/src/test_streams/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
 	Makefile.lite \
 	test_streams.dsp \
 	test_streams.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = test_streams
 test_streams_SOURCES = \
 	main.c
-- 
1.7.9.2



More information about the flac-dev mailing list