build: Convert mad detection to new macros.
authorAndre Noll <maan@systemlinux.org>
Tue, 3 Jun 2014 17:03:32 +0000 (19:03 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 Mar 2015 16:45:41 +0000 (16:45 +0000)
configure.ac

index 7224e4e..593efef 100644 (file)
@@ -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