# 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
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)
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
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 \
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 \
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 \
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 \
# 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 \
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 \
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 \
# 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
endif
endif
-libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@
+libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ -lm
SUBDIRS = $(ARCH_SUBDIRS) include .
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 \
#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 */
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
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;
}
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;
#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 */
(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;
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;
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)
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) {
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 */
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;
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 $@
#define flac_min(a,b) __min(a,b)
#endif
+#if !defined(__cplusplus) && defined(_MSC_VER)
+#ifndef inline
+#define inline __inline
+#endif
+#endif
+
#endif
#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
#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)
{
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]);
#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]);
#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
}
#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
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
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 \
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
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
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
AUTOMAKE_OPTIONS = foreign
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
noinst_LTLIBRARIES = libgrabbag.la
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
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
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
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
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
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 \
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 = \
# 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
AM_CFLAGS = @OGG_CFLAGS@
-INCLUDES =
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
noinst_PROGRAMS = test_seeking
test_seeking_LDADD = \
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