diff options
author | Max Kellermann <max@duempel.org> | 2008-11-16 20:04:49 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-16 20:04:49 +0100 |
commit | 9c4e97a61b59105c9b539faca272305bbb234c17 (patch) | |
tree | db659e51b1fdf1893475d4fb4af4702bbb71a954 /configure.ac | |
parent | acfba02310a1b8159440dd71bdf7c7fefb7ef8fb (diff) | |
download | mpd-9c4e97a61b59105c9b539faca272305bbb234c17.tar.gz mpd-9c4e97a61b59105c9b539faca272305bbb234c17.tar.xz mpd-9c4e97a61b59105c9b539faca272305bbb234c17.zip |
aac: detect whether to pass "uint32_t*" to NeAACDecInit2()
neaacdec.h declares all arguments as "unsigned long", but internally
expects uint32_t pointers. This triggers gcc warnings on 64 bit
architectures. To avoid that, make configure.ac detect whether we're
using Debian's corrected headers or the original libfaad headers. In
any case, pass a pointer to an uint32_t, conditionally casted to
"unsigned long*".
Diffstat (limited to '')
-rw-r--r-- | configure.ac | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 007658ab8..944c1c153 100644 --- a/configure.ac +++ b/configure.ac @@ -623,6 +623,37 @@ fi AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes) if test x$enable_aac = xyes; then + oldcflags=$CFLAGS + oldlibs=$LIBS + oldcppflags=$CPPFLAGS + CFLAGS="$CFLAGS $MPD_CFLAGS $FAAD_CFLAGS -Werror" + LIBS="$LIBS $MPD_LIBS $FAAD_LIBS" + CPPFLAGS=$CFLAGS + + AC_MSG_CHECKING(for broken libfaad headers) + AC_COMPILE_IFELSE([ +#include <faad.h> +#include <stddef.h> +#include <stdint.h> + +int main() { + unsigned char channels; + uint32_t sample_rate; + + faacDecInit2(NULL, NULL, 0, &sample_rate, &channels); + return 0; +} + ], + [AC_MSG_RESULT(correct)], + [AC_MSG_RESULT(broken); + AC_DEFINE(HAVE_FAAD_LONG, 1, [Define if faad.h uses the broken "unsigned long" pointers])]) + + CFLAGS=$oldcflags + LIBS=$oldlibs + CPPFLAGS=$oldcppflags +fi + +if test x$enable_aac = xyes; then enable_mp4=yes MP4FF_LIBS="-lmp4ff" |