From 1265fe643e57401530edd0c607988f1aef8a1db0 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 3 Jun 2014 19:03:32 +0200 Subject: [PATCH] build: Convert mad detection to new macros. --- configure.ac | 47 ++++++++++------------------------------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/configure.ac b/configure.ac index 7224e4e6..593efefc 100644 --- a/configure.ac +++ b/configure.ac @@ -326,40 +326,13 @@ AC_CHECK_LIB([faad], [NeAACDecOpen], [], HAVE_FAAD=no) LIB_SUBST_FLAGS(faad) UNSTASH_FLAGS ########################################################################### mad -have_mad="yes" -OLD_CPPFLAGS="$CPPFLAGS" -OLD_LDFLAGS="$LDFLAGS" -OLD_LIBS="$LIBS" - -AC_ARG_WITH(mad_headers, [AS_HELP_STRING(--with-mad-headers=dir, - [look for mad.h also in dir])]) -if test -n "$with_mad_headers"; then - mad_cppflags="-I$with_mad_headers" - CPPFLAGS="$CPPFLAGS $mad_cppflags" -fi -AC_ARG_WITH(mad_libs, [AS_HELP_STRING(--with-mad-libs=dir, - [look for libmad also in dir])]) -if test -n "$with_mad_libs"; then - mad_libs="-L$with_mad_libs" - LDFLAGS="$LDFLAGS $mad_libs" -fi -AC_CHECK_HEADERS([mad.h], [], [ - have_mad="no" -]) -AC_CHECK_LIB([mad], [mad_stream_init], [], [ - have_mad="no" -]) -if test "$have_mad" = "yes"; then - AC_DEFINE(HAVE_MAD, 1, define to 1 if you want to build the mp3dec filter) - AC_SUBST(mad_cppflags) - mad_ldflags="$mad_libs -lmad" - AC_SUBST(mad_ldflags) -else - AC_MSG_WARN([no mp3dec support in para_audiod/para_filter]) -fi -CPPFLAGS="$OLD_CPPFLAGS" -LDFLAGS="$OLD_LDFLAGS" -LIBS="$OLD_LIBS" +STASH_FLAGS +LIB_ARG_WITH([mad], [-lmad]) +HAVE_MAD=yes +AC_CHECK_HEADER(mad.h, [], HAVE_MAD=no) +AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no) +LIB_SUBST_FLAGS(mad) +UNSTASH_FLAGS ###################################################################### libid3tag OLD_CPPFLAGS="$CPPFLAGS" OLD_LDFLAGS="$LDFLAGS" @@ -821,7 +794,7 @@ if test -n "$CRYPTOLIB"; then audiod_errlist_objs="$audiod_errlist_objs aacdec_filter aac_common" audiod_audio_formats="$audiod_audio_formats aac" fi - if test "$have_mad" = "yes"; then + if test $HAVE_MAD = yes; then audiod_audio_formats="$audiod_audio_formats mp3" audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter" audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter" @@ -989,7 +962,7 @@ if test $HAVE_FAAD = yes; then filter_errlist_objs="$filter_errlist_objs aacdec_filter aac_common" filters="$filters aacdec" fi -if test "$have_mad" = "yes"; then +if test $HAVE_MAD = yes; then filter_cmdline_objs="$filter_cmdline_objs mp3dec_filter" filter_errlist_objs="$filter_errlist_objs mp3dec_filter" filters="$filters mp3dec" @@ -1172,7 +1145,7 @@ NEED_OPUS_OBJECTS && if test $HAVE_FAAD = yes; then play_errlist_objs="$play_errlist_objs aacdec_filter aac_afh aac_common" fi -if test "$have_mad" = "yes"; then +if test $HAVE_MAD = yes; then play_cmdline_objs="$play_cmdline_objs mp3dec_filter" play_errlist_objs="$play_errlist_objs mp3dec_filter" fi -- 2.39.2