1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-26 15:20:21 +01:00

Upgrades libsndfile to 1.0.24.

This commit is contained in:
lllucius
2011-04-03 03:08:57 +00:00
parent dbf2cdf605
commit fa00dd005f
267 changed files with 13363 additions and 14998 deletions

View File

@@ -1,9 +1,10 @@
# Copyright (C) 1999-2008 Erik de Castro Lopo (erikd AT mega-nerd DOT com).
# Copyright (C) 1999-2011 Erik de Castro Lopo (erikd AT mega-nerd DOT com).
dnl Require autoconf version
AC_PREREQ(2.57)
AC_INIT([libsndfile],[1.0.18],[erikd@mega-nerd.com])
AC_INIT([libsndfile],[1.0.24],[sndfile@mega-nerd.com],
[libsndfile],[http://www.mega-nerd.com/libsndfile/])
# Put config stuff in Cfg.
AC_CONFIG_AUX_DIR(Cfg)
@@ -12,19 +13,37 @@ AC_CONFIG_SRCDIR([src/sndfile.c])
AC_CANONICAL_TARGET([])
AC_CONFIG_MACRO_DIR([M4])
AC_CONFIG_HEADERS([src/config.h])
AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION)
AM_SILENT_RULES([yes])
dnl Audacity policy: don't enable automatic rebuild of configure et al if
dnl sources change
AM_MAINTAINER_MODE([enable])
AC_CONFIG_HEADERS([src/config.h])
dnl Add parameters for aclocal
AC_SUBST(ACLOCAL_AMFLAGS, "-I M4")
AC_LANG([C])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_SED
# Do not check for F77.
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AM_PROG_LIBTOOL
LT_PROG_RC
AC_CHECK_PROG(HAVE_AUTOGEN, autogen, yes, no)
AC_CHECK_PROG(HAVE_WINE, wine, yes, no)
AC_PROG_INSTALL
AC_PROG_LN_S
#------------------------------------------------------------------------------------
# Rules for library version information:
#
@@ -41,22 +60,12 @@ AC_LANG([C])
# 6. If any interfaces have been removed since the last public release, then set age
# to 0.
SHARED_VERSION_INFO="1:18:0"
CLEAN_VERSION=`echo $PACKAGE_VERSION | $SED "s/p.*//"`
VERSION_MINOR=`echo $CLEAN_VERSION | $SED "s/.*\.//"`
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
SHARED_VERSION_INFO="1:$VERSION_MINOR:0"
# Do not check for F77.
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AM_PROG_LIBTOOL
AC_CHECK_PROG(HAVE_AUTOGEN, autogen, yes, no)
AC_CHECK_PROG(HAVE_WINE, wine, yes, no)
AC_PROG_INSTALL
AC_PROG_LN_S
#------------------------------------------------------------------------------------
AC_HEADER_STDC
@@ -80,7 +89,7 @@ AM_CONDITIONAL([LINUX_MINGW_CROSS_TEST],
#====================================================================================
# Check for support of the struct hack.
AC_C99_FLEXIBLE_ARRAY
MN_C99_FLEXIBLE_ARRAY
if test x$ac_cv_c99_flexible_array = xyes ; then
AC_DEFINE([HAVE_FLEXIBLE_ARRAY],1, [Set to 1 if the compile supports the struct hack.])
@@ -129,7 +138,7 @@ AC_ARG_ENABLE(alsa,
AC_HELP_STRING([--disable-alsa], [disable use of ALSA]))
AC_ARG_ENABLE(external-libs,
AC_HELP_STRING([--disable-external-libs], [disable use of FLAC, Ogg and Vorbis]))
AC_HELP_STRING([--disable-external-libs], [disable use of FLAC, Ogg and Vorbis [[default=no]]]))
AC_ARG_ENABLE(octave,
AC_HELP_STRING([--enable-octave], [disable building of GNU Octave module]))
@@ -141,6 +150,7 @@ AM_CONDITIONAL([ENABLE_TEST_COVERAGE], [test "$enable_test_coverage" = yes])
#====================================================================================
# Check types and their sizes.
AC_CHECK_SIZEOF(wchar_t,4)
AC_CHECK_SIZEOF(short,2)
AC_CHECK_SIZEOF(int,4)
AC_CHECK_SIZEOF(long,4)
@@ -162,15 +172,16 @@ unset ac_cv_sizeof_off_t
AC_CHECK_SIZEOF(off_t,1) # Fake default value.
case "$host_os" in
mingw*)
mingw32msvc | mingw32)
TYPEOF_SF_COUNT_T="__int64"
SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
SIZEOF_SF_COUNT_T=8
AC_DEFINE([__USE_MINGW_ANSI_STDIO],1,[Set to 1 to use C99 printf/snprintf in MinGW.])
;;
*)
if test "x$ac_cv_sizeof_off_t" = "x8" ; then
# If sizeof (off_t) is 8, no further checking is needed.
TYPEOF_SF_COUNT_T="off_t"
TYPEOF_SF_COUNT_T="int64_t"
SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
SIZEOF_SF_COUNT_T=8
else
@@ -180,10 +191,10 @@ case "$host_os" in
TYPEOF_SF_COUNT_T="unknown"
if test "x$ac_cv_sizeof_loff_t" = "x8" ; then
TYPEOF_SF_COUNT_T="loff_t"
TYPEOF_SF_COUNT_T="int64_t"
SIZEOF_SF_COUNT_T=8
elif test "x$ac_cv_sizeof_off64_t" = "x8" ; then
TYPEOF_SF_COUNT_T="off64_t"
TYPEOF_SF_COUNT_T="int64_t"
SIZEOF_SF_COUNT_T=8
fi
@@ -245,7 +256,7 @@ AC_CHECK_SIZEOF(ssize_t,4)
#====================================================================================
# Determine endian-ness of target processor.
AC_C_FIND_ENDIAN
MN_C_FIND_ENDIAN
AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
[Target processor is big endian.])
@@ -264,12 +275,13 @@ AC_CHECK_FUNCS(snprintf vsnprintf)
AC_CHECK_FUNCS(gmtime gmtime_r localtime localtime_r gettimeofday)
AC_CHECK_FUNCS(mmap getpagesize)
AC_CHECK_FUNCS(setlocale)
AC_CHECK_FUNCS(pipe waitpid)
AC_CHECK_LIB([m],floor)
AC_CHECK_FUNCS(floor ceil fmod)
AC_C99_FUNC_LRINT
AC_C99_FUNC_LRINTF
MN_C99_FUNC_LRINT
MN_C99_FUNC_LRINTF
#====================================================================================
# Check for requirements for building plugins for other languages/enviroments.
@@ -295,27 +307,41 @@ EXTERNAL_LIBS=""
# Check for pkg-config outside the if statement.
PKG_PROG_PKG_CONFIG
if test x$enable_external_libs = xno ; then
AC_MSG_WARN([[*** External libs (FLAC, Ogg, Vorbis) disabled. ***]])
else
PKG_CHECK_MOD_VERSION(FLAC, flac >= 1.2.1, ac_cv_flac=yes, ac_cv_flac=no)
PKG_CHECK_MOD_VERSION(OGG, ogg >= 1.1.3, ac_cv_ogg=yes, ac_cv_ogg=no)
if test -n "$PKG_CONFIG" ; then
if test x$enable_external_libs = xno ; then
AC_MSG_WARN([[*** External libs (FLAC, Ogg, Vorbis) disabled. ***]])
else
PKG_CHECK_MOD_VERSION(FLAC, flac >= 1.2.1, ac_cv_flac=yes, ac_cv_flac=no)
PKG_CHECK_MOD_VERSION(OGG, ogg >= 1.1.3, ac_cv_ogg=yes, ac_cv_ogg=no)
# Yes we really do need vorbis >= 1.2.1 because earlier versions are
# not const correct at the API level.
PKG_CHECK_MOD_VERSION(VORBIS, vorbis >= 1.2.1, ac_cv_vorbis=yes, ac_cv_vorbis=no)
PKG_CHECK_MOD_VERSION(VORBISENC, vorbisenc >= 1.2.1, ac_cv_vorbisenc=yes, ac_cv_vorbisenc=no)
fi
# Vorbis versions earlier than 1.2.3 have bugs that cause the libsndfile
# test suite to fail on MIPS, PowerPC and others.
# See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549899
PKG_CHECK_MOD_VERSION(VORBIS, vorbis >= 1.2.3, ac_cv_vorbis=yes, ac_cv_vorbis=no)
PKG_CHECK_MOD_VERSION(VORBISENC, vorbisenc >= 1.2.3, ac_cv_vorbisenc=yes, ac_cv_vorbisenc=no)
enable_external_libs=yes
fi
if test x$ac_cv_flac$ac_cv_ogg$ac_cv_vorbis$ac_cv_vorbisenc = "xyesyesyesyes" ; then
HAVE_EXTERNAL_LIBS=1
enable_external_libs=yes
HAVE_EXTERNAL_LIBS=1
enable_external_libs=yes
EXTERNAL_CFLAGS="$FLAC_CFLAGS $OGG_CFLAGS $VORBISENC_CFLAGS"
EXTERNAL_LIBS="$FLAC_LIBS $VORBISENC_LIBS"
EXTERNAL_LIBS="$FLAC_LIBS $VORBISENC_LIBS"
else
echo
AC_MSG_WARN([[*** One or more of the external libraries (ie libflac, libogg and]])
AC_MSG_WARN([[*** libvorbis) is either missing (possibly only the development]])
AC_MSG_WARN([[*** headers) or is of an unsupported version.]])
AC_MSG_WARN([[***]])
AC_MSG_WARN([[*** Unfortunately, for ease of maintenance, the external libs]])
AC_MSG_WARN([[*** are an all or nothing affair.]])
echo
enable_external_libs=no
fi
fi
AC_DEFINE_UNQUOTED([HAVE_EXTERNAL_LIBS],$HAVE_EXTERNAL_LIBS,[Will be set to 1 if flac, ogg and vorbis are available.])
AC_DEFINE_UNQUOTED([HAVE_EXTERNAL_LIBS], $HAVE_EXTERNAL_LIBS, [Will be set to 1 if flac, ogg and vorbis are available.])
#====================================================================================
# Check for libsqlite3 (only used in regtest).
@@ -333,24 +359,11 @@ else
AC_DEFINE_UNQUOTED([HAVE_SQLITE3],$HAVE_SQLITE3,[Set to 1 if you have libsqlite3.])
#====================================================================================
# Check for JACK (only used for examples/sndfile-jackplay).
PKG_CHECK_MOD_VERSION(JACK, jack >= 0.100, ac_cv_jack=yes, ac_cv_jack=no)
if test x$ac_cv_jack = "xyes" ; then
HAVE_JACK=1
else
HAVE_JACK=0
fi
AC_DEFINE_UNQUOTED([HAVE_JACK],$HAVE_JACK,[Set to 1 if you have JACK.])
#====================================================================================
# Determine if the processor can do clipping on float to int conversions.
if test x$enable_cpu_clip != "xno" ; then
AC_C_CLIP_MODE
MN_C_CLIP_MODE
else
echo "checking processor clipping capabilities... disabled"
ac_cv_c_clip_positive=0
@@ -374,7 +387,7 @@ use_windows_api=0
case "$host_os" in
darwin* | rhapsody*)
os_is_macosx=1
OS_SPECIFIC_CFLAGS="-fpascal-strings -I/Developer/Headers/FlatCarbon"
OS_SPECIFIC_CFLAGS="-I/Developer/Headers/FlatCarbon"
OS_SPECIFIC_LINKS="-framework CoreAudio"
;;
mingw*)
@@ -388,6 +401,8 @@ AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32
AC_DEFINE_UNQUOTED(OS_IS_MACOSX, ${os_is_macosx}, [Set to 1 if compiling for MacOSX])
AC_DEFINE_UNQUOTED(USE_WINDOWS_API, ${use_windows_api}, [Set to 1 to use the native windows API])
AM_CONDITIONAL(USE_WIN_VERSION_FILE, test ${use_windows_api} -eq 1)
#====================================================================================
# Check for ALSA.
@@ -401,6 +416,15 @@ if test x$enable_alsa != xno ; then
fi
fi
#====================================================================================
# Check for OpenBSD's sndio.
SNDIO_LIBS=""
AC_CHECK_HEADERS(sndio.h)
if test x$ac_cv_header_sndio_h = xyes ; then
SNDIO_LIBS="-lsndio"
fi
#====================================================================================
# Test for sanity when cross-compiling.
@@ -467,9 +491,9 @@ win32_target_dll=0
COMPILER_IS_GCC=0
if test x$ac_cv_c_compiler_gnu = xyes ; then
AC_ADD_CFLAGS(-std=gnu99)
MN_ADD_CFLAGS(-std=gnu99)
AC_GCC_VERSION
MN_GCC_VERSION
if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
AC_MSG_WARN([****************************************************************])
@@ -478,21 +502,21 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
AC_MSG_WARN([** See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 **])
AC_MSG_WARN([** Using -fgnu-inline to avoid this stupidity. **])
AC_MSG_WARN([****************************************************************])
AC_ADD_CFLAGS([-fgnu89-inline])
MN_ADD_CFLAGS([-fgnu89-inline])
fi
CFLAGS="$CFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall"
AC_ADD_CFLAGS([-Wextra])
MN_ADD_CFLAGS([-Wextra])
AC_LANG_PUSH([C++])
AC_ADD_CXXFLAGS([-Wextra])
MN_ADD_CXXFLAGS([-Wextra])
AC_LANG_POP([C++])
AC_ADD_CFLAGS([-Wdeclaration-after-statement])
AC_ADD_CFLAGS([-Wpointer-arith])
AC_ADD_CFLAGS([-funsigned-char])
MN_ADD_CFLAGS([-Wdeclaration-after-statement])
MN_ADD_CFLAGS([-Wpointer-arith])
MN_ADD_CFLAGS([-funsigned-char])
if test x$enable_gcc_werror = "xyes" ; then
CFLAGS="-Werror $CFLAGS"
@@ -500,8 +524,8 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
fi
if test x$enable_test_coverage = "xyes" ; then
# AC_ADD_CFLAGS([-ftest-coverage])
AC_ADD_CFLAGS([-coverage])
# MN_ADD_CFLAGS([-ftest-coverage])
MN_ADD_CFLAGS([-coverage])
fi
CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings "
@@ -509,7 +533,7 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
CXXFLAGS="$CXXFLAGS -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-promo "
if test "x$enable_gcc_opt" = "xno" ; then
temp_CFLAGS=`echo $CFLAGS | sed "s/O2/O0/"`
temp_CFLAGS=`echo $CFLAGS | $SED "s/O2/O0/"`
CFLAGS=$temp_CFLAGS
AC_MSG_WARN([[*** Compiler optimisations switched off. ***]])
fi
@@ -519,12 +543,12 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
darwin* | rhapsody*)
# Disable -Wall, -pedantic and -Wshadow for Apple Darwin/Rhapsody.
# System headers on these systems are broken.
temp_CFLAGS=`echo $CFLAGS | sed "s/-Wall -pedantic//" | sed "s/-Wshadow//" | sed "s/-Waggregate-return//"`
temp_CFLAGS=`echo $CFLAGS | $SED "s/-Wall -pedantic//" | $SED "s/-Wshadow//" | $SED "s/-Waggregate-return//"`
CFLAGS=$temp_CFLAGS
SHLIB_VERSION_ARG="-Wl,-exported_symbols_list -Wl,\$(srcdir)/Symbols.darwin"
;;
linux*)
SHLIB_VERSION_ARG="-Wl,--version-script=\$(srcdir)/Symbols.linux"
linux*|kfreebsd*-gnu*|gnu*)
SHLIB_VERSION_ARG="-Wl,--version-script=\$(srcdir)/Symbols.gnu-binutils"
;;
mingw*)
# Linker flag '-Wl,--out-implib' does not work with mingw cross compiler
@@ -558,40 +582,54 @@ if test x"$CFLAGS" = x ; then
exit
fi
HOST_TRIPLET="${host_cpu}-${host_vendor}-${host_os}"
if test "$HOST_TRIPLET" = "x86_64-w64-mingw32" ; then
OS_SPECIFIC_LINKS=" -static-libgcc $OS_SPECIFIC_LINKS"
fi
WIN_RC_VERSION=`echo $PACKAGE_VERSION | $SED -e "s/p.*//" -e "s/\./,/g"`
#-------------------------------------------------------------------------------
AC_SUBST(HOST_TRIPLET)
AC_SUBST(htmldocdir)
AC_SUBST(HTML_BGCOLOUR)
AC_SUBST(HTML_FGCOLOUR)
AC_SUBST(SHLIB_VERSION_ARG)
AC_SUBST(SHARED_VERSION_INFO)
AC_SUBST(CLEAN_VERSION)
AC_SUBST(WIN_RC_VERSION)
AC_SUBST(OS_SPECIFIC_CFLAGS)
AC_SUBST(OS_SPECIFIC_LINKS)
AC_SUBST(ALSA_LIBS)
AC_SUBST(ENABLE_EXPERIMENTAL_CODE)
AC_SUBST(SNDIO_LIBS)
AC_SUBST(EXTERNAL_CFLAGS)
AC_SUBST(EXTERNAL_LIBS)
AC_SUBST(COMPILER_IS_GCC)
AC_SUBST(GCC_MAJOR_VERSION)
AC_SUBST(HAVE_JACK)
dnl The following line causes the libtool distributed with the source
dnl to be replaced if the build system has a more recent version.
AC_SUBST(LIBTOOL_DEPS)
AC_CONFIG_FILES([ \
src/sndfile.h src/Makefile src/GSM610/Makefile src/G72x/Makefile \
src/version-metadata.rc \
man/Makefile examples/Makefile tests/Makefile regtest/Makefile \
M4/Makefile doc/Makefile Win32/Makefile Octave/Makefile \
programs/Makefile doc/libsndfile.css \
Makefile libsndfile.spec sndfile.pc \
tests/test_wrapper.sh tests/pedantic-header-test.sh \
build-test-tarball.mk \
])
AC_OUTPUT
# Make sure these are executable.
chmod u+x tests/test_wrapper.sh build-test-tarball.mk
#====================================================================================
AC_MSG_RESULT([
@@ -599,19 +637,34 @@ AC_MSG_RESULT([
Configuration summary :
Version : ............................. ${VERSION}
libsndfile version : .................. ${VERSION}
Host CPU : ............................ ${host_cpu}
Host Vendor : ......................... ${host_vendor}
Host OS : ............................. ${host_os}
Experimental code : ................... ${enable_experimental:-no}
Using ALSA in example programs : ...... ${enable_alsa:-no}
External FLAC/Ogg/Vorbis : ............ ${enable_external_libs:-no}
])
if test -z "$PKG_CONFIG" ; then
echo " *****************************************************************"
echo " *** The pkg-config program is missing. ***"
echo " *** External FLAC/Ogg/Vorbis libs cannot be found without it. ***"
echo " *** http://pkg-config.freedesktop.org/wiki/ ***"
echo " *****************************************************************"
echo
fi
if test x$ac_cv_c_compiler_gnu = xyes ; then
echo -e " Tools :\n"
echo " Tools :"
echo
echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
echo " GCC version : ......................... ${GCC_VERSION}"
if test $GCC_MAJOR_VERSION -lt 3 ; then
echo -e "\n ** This compiler version allows applications to write"
echo "\n"
echo " ** This compiler version allows applications to write"
echo " ** to static strings within the library."
echo " ** Compile with GCC version 3.X or above to avoid this problem."
fi
@@ -636,8 +689,9 @@ AC_MSG_RESULT([[
if test x$prefix != "x/usr" ; then
echo "Compiling some other packages against libsndfile may require"
echo -e "the addition of \"$libdir/pkgconfig\" to the"
echo -e "PKG_CONFIG_PATH environment variable.\n"
echo "the addition of '$libdir/pkgconfig' to the"
echo "PKG_CONFIG_PATH environment variable."
echo
fi
(cd src && make genfiles)