Commit ac5caa2c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mad: clean up build rules

parent 908ae074
......@@ -2199,29 +2199,40 @@ fi
dnl
dnl mad plugin
dnl
have_mad="no"
MAD_CFLAGS=""
MAD_LIBS=""
AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
enable_mad="yes"
], [
with_mad="no"
])
AS_IF([test "${with_mad}" != "no"], [
MAD_CFLAGS="-I${with_mad}/include"
MAD_LIBS="-L${with_mad}/lib"
])
AC_ARG_ENABLE(mad,
[ --enable-mad libmad module (default enabled)])
if test "${enable_mad}" != "no"
then
AC_ARG_WITH(mad,
[ --with-mad=PATH path to libmad],[],[])
if test "${with_mad}" != "no" -a -n "${with_mad}"
then
VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${with_mad}/include])
VLC_ADD_LIBS([mpgatofixed32],[-L${with_mad}/lib])
fi
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_mpgatofixed32}"
LDFLAGS="${LDFLAGS} ${LIBS_mpgatofixed32}"
AC_CHECK_HEADERS(mad.h, ,
[ AC_MSG_ERROR([Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin.]) ])
AS_IF([test "${enable_mad}" != "no"], [
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
AC_CHECK_HEADERS(mad.h, [
AC_CHECK_LIB(mad, mad_bit_init, [
VLC_ADD_PLUGIN([mpgatofixed32])
VLC_ADD_LIBS([mpgatofixed32],[-lmad])],
[ AC_MSG_ERROR([Cannot find libmad library...]) ])
VLC_RESTORE_FLAGS
fi
have_mad="yes"
MAD_LIBS="${MAD_LIBS} -lmad"
])
])
VLC_RESTORE_FLAGS
AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
])
])
AC_SUBST(MAD_CFLAGS)
AC_SUBST(MAD_LIBS)
AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
AC_ARG_ENABLE(merge-ffmpeg,
......
......@@ -202,6 +202,7 @@ $Id$
* lua: Lua scripting inteface
* macosx: Video output, and interface module for Mac OS X
* macosx_dialog_provider: Minimal Dialog Provider for Mac OS X
* mad: MPEG-1 & 2 audio layer I,II,III audio decoder using MAD
* magnify: zoom video filter
* marq: Overlays a marquee on the video
* mediacodec: Android Jelly Bean MediaCodec decoder module
......@@ -224,7 +225,6 @@ $Id$
* mp4: MP4 file input module
* mpc: Musepack decoder
* mpeg_audio: MPEG audio parser/packetizer
* mpgatofixed32: MPEG-1 & 2 audio layer I,II,III audio decoder using MAD
* mpgv: MPEG-I/II Video demuxer
* mtp: MTP interface module
* mux_asf: ASF muxer
......
......@@ -50,7 +50,14 @@ SOURCES_a52tospdif = converter/a52tospdif.c
SOURCES_a52tofloat32 = converter/a52tofloat32.c
SOURCES_dtstospdif = converter/dtstospdif.c
SOURCES_dtstofloat32 = converter/dtstofloat32.c
SOURCES_mpgatofixed32 = converter/mpgatofixed32.c
libmad_plugin_la_SOURCES = converter/mpgatofixed32.c
libmad_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(MAD_CFLAGS)
libmad_plugin_la_LIBADD = $(AM_LIBADD) $(MAD_LIBS)
if HAVE_MAD
audio_filter_LTLIBRARIES += libmad_plugin.la
endif
libaudio_format_plugin_la_SOURCES = converter/format.c
libaudio_format_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
libaudio_format_plugin_la_LIBADD = $(LIBM)
......
......@@ -161,7 +161,7 @@ static int Open( vlc_object_t *p_this )
static int OpenDecoder( vlc_object_t *p_this )
{
/* HACK: Don't use this codec if we don't have an mpga audio filter */
if( !module_exists( "mpgatofixed32" ) )
if( !module_exists( "mad" ) )
return VLC_EGENERIC;
return Open( p_this );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment