2004-02-24 17:16:54 +01:00
dnl AC_INIT(src/main.c)
2007-05-30 22:12:32 +02:00
dnl AM_INIT_AUTOMAKE(mpd, 0.14.0)
2004-02-24 17:16:54 +01:00
2007-06-01 20:32:25 +02:00
AC_PREREQ(2.60)
2008-08-28 20:40:17 +02:00
AC_INIT(mpd, 0.14.0, musicpd-dev-team@lists.sourceforge.net)
2004-02-24 17:16:54 +01:00
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
2004-02-24 00:41:20 +01:00
AC_SUBST(MPD_LIBS)
AC_SUBST(MPD_CFLAGS)
2006-07-26 05:05:50 +02:00
AC_SUBST(MP4FF_LIB)
AC_SUBST(MP4FF_SUBDIR)
2004-02-24 00:41:20 +01:00
2008-04-12 06:16:22 +02:00
AC_LANG(C)
2004-03-17 19:13:29 +01:00
AC_PROG_CC
2007-02-02 04:51:07 +01:00
AM_PROG_CC_C_O
2004-03-17 19:13:29 +01:00
AC_PROG_INSTALL
AC_PROG_LIBTOOL
2004-05-18 22:27:12 +02:00
AC_PROG_MAKE_SET
2004-03-17 19:13:29 +01:00
2004-03-18 04:29:25 +01:00
AM_CONFIG_HEADER(config.h)
2007-05-30 22:12:32 +02:00
AC_DEFINE(PROTOCOL_VERSION, "0.14.0", [The mpd protocol version])
2004-03-18 04:29:25 +01:00
2006-07-18 11:55:15 +02:00
MPD_LIBS=""
2004-05-29 14:38:54 +02:00
MPD_CFLAGS=""
2008-04-12 06:16:22 +02:00
if test x$GCC = xyes
then
MPD_CHECK_FLAG([-Wall])
MPD_CHECK_FLAG([-Wextra])
MPD_CHECK_FLAG([-Wno-deprecated-declarations])
MPD_CHECK_FLAG([-Wmissing-prototypes])
MPD_CHECK_FLAG([-Wdeclaration-after-statement])
MPD_CHECK_FLAG([-Wshadow])
2008-08-26 08:27:02 +02:00
MPD_CHECK_FLAG([-Wpointer-arith])
MPD_CHECK_FLAG([-Wstrict-prototypes])
2008-09-07 18:37:29 +02:00
MPD_CHECK_FLAG([-Wcast-qual])
MPD_CHECK_FLAG([-Wwrite-strings])
2007-01-14 05:25:21 +01:00
fi
2006-07-18 11:55:15 +02:00
2006-07-23 01:28:30 +02:00
if test -z "$prefix" || test "x$prefix" = xNONE; then
local_lib=
local_include=
# aren't autotools supposed to be smart enough to figure this out? oh
# well, the git-core Makefile managed to do some of the work for us :)
case "$host_os" in
darwin*)
local_lib='/sw/lib /opt/local/lib'
local_include='/sw/include /opt/local/include'
;;
freebsd* | openbsd*)
local_lib=/usr/local/lib
local_include=/usr/local/include
;;
netbsd*)
local_lib=/usr/pkg/lib
local_include=/usr/pkg/include
LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/pkg/lib"
;;
esac
2006-07-18 11:55:15 +02:00
2006-07-23 01:28:30 +02:00
for d in $local_lib; do
if test -d "$d"; then
LDFLAGS="$LDFLAGS -L$d"
break
fi
done
for d in $local_include; do
if test -d "$d"; then
CFLAGS="$CFLAGS -I$d"
break
fi
done
fi
2004-02-24 00:41:20 +01:00
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(ao,[ --enable-ao enable support for libao (default: disable)],[enable_ao=$enableval],[enable_ao=no])
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
AC_ARG_ENABLE(shout_ogg,[ --disable-shout_ogg disable support for ogg streaming through shout (default: enable)],[enable_shout_ogg=$enableval],[enable_shout_ogg=yes])
2008-09-12 16:05:23 +02:00
AC_ARG_ENABLE(shout_mp3,[ --disable-shout_mp3 disable support for mp3 streaming through shout (default: enable)],[enable_shout_mp3=$enableval],[enable_shout_mp3=yes])
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(iconv,[ --disable-iconv disable iconv support (default: enable)],[enable_iconv=$enableval],[enable_iconv=yes])
AC_ARG_ENABLE(ipv6,[ --disable-ipv6 disable IPv6 support (default: enable)],[enable_ipv6=$enableval],[enable_ipv6=yes])
2008-04-12 06:07:24 +02:00
AC_ARG_ENABLE(tcp,[ --disable-tcp disable support for clients connecting via TCP (default: enable)],[enable_tcp=$enableval],[enable_tcp=yes])
AC_ARG_ENABLE(un,[ --enable-un enable support for clients connecting via unix domain sockets (default: disable)],[enable_un=$enableval],[enable_un=no])
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(oss,[ --disable-oss disable OSS support (default: enable)],[enable_oss=$enableval],[enable_oss=yes])
AC_ARG_ENABLE(alsa,[ --disable-alsa disable ALSA support (default: enable)],[enable_alsa=$enableval],[enable_alsa=yes])
2006-10-18 04:49:13 +02:00
AC_ARG_ENABLE(jack,[ --disable-jack disable jack support (default: enable)],[enable_jack=$enableval],[enable_jack=yes])
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(pulse,[ --disable-pulse disable support for the PulseAudio sound server (default: enable)],[enable_pulse=$enableval],[enable_pulse=yes])
2007-06-13 16:15:30 +02:00
AC_ARG_ENABLE(fifo,[ --disable-fifo disable support for writing audio to a FIFO (default: enable)],[enable_fifo=$enableval],[enable_fifo=yes])
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(mvp,[ --enable-mvp enable support for Hauppauge Media MVP (default: disable)],[enable_mvp=$enableval],[enable_mvp=no])
2006-03-16 07:52:46 +01:00
AC_ARG_ENABLE(oggvorbis,[ --disable-oggvorbis disable Ogg Vorbis support (default: enable)],[enable_oggvorbis=$enableval],enable_oggvorbis=yes)
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(oggflac,[ --disable-oggflac disable OggFLAC support (default: enable)],[enable_oggflac=$enableval],enable_oggflac=yes)
AC_ARG_ENABLE(flac,[ --disable-flac disable flac support (default: enable)],[enable_flac=$enableval],[enable_flac=yes])
AC_ARG_ENABLE(mp3,[ --disable-mp3 disable mp3 support (default: enable)],[enable_mp3=$enableval],[enable_mp3=yes])
2008-09-12 16:05:23 +02:00
AC_ARG_ENABLE(lame,[ --disable-lame disable lame support (default: enable)],[enable_lame=$enableval],[enable_lame=yes])
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(aac,[ --disable-aac disable AAC support (default: enable)],[enable_aac=$enableval],[enable_aac=yes])
AC_ARG_ENABLE(audiofile,[ --disable-audiofile disable audiofile support, disables wave support (default: enable)],[enable_audiofile=$enableval],[enable_audiofile=yes])
2007-06-24 23:26:44 +02:00
AC_ARG_ENABLE(mod,[ --enable-mod enable MOD support (default: disable)],[enable_mod=$enableval],[enable_mod=yes])
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(mpc,[ --disable-mpc disable musepack (MPC) support (default: enable)],[enable_mpc=$enableval],[enable_mpc=yes])
2007-06-24 23:26:44 +02:00
AC_ARG_ENABLE(wavpack,[ --disable-wavpack disable WavPack support (default: enable)],[enable_wavpack=$enableval],[enable_wavpack=yes])
2006-07-22 03:48:36 +02:00
AC_ARG_ENABLE(id3,[ --disable-id3 disable id3 support (default: enable)],[enable_id3=$enableval],[enable_id3=yes])
2007-02-02 04:51:07 +01:00
AC_ARG_ENABLE(lsr,[ --disable-lsr disable libsamplerate support (default: enable)],[enable_lsr=$enableval],[enable_lsr=yes])
2006-07-22 03:48:36 +02:00
AC_ARG_WITH(tremor,[[ --with-tremor[=PFX] Use Tremor(vorbisidec) integer Ogg-Vorbis decoder (with optional prefix)]], use_tremor=yes; test x$withval != xyes && tremor_prefix="$withval",)
AC_ARG_WITH(tremor-libraries,[ --with-tremor-libraries=DIR Directory where Tremor library is installed (optional)], tremor_libraries="$withval", tremor_libraries="")
AC_ARG_WITH(tremor-includes,[ --with-tremor-includes=DIR Directory where Tremor header files are installed (optional)], tremor_includes="$withval", tremor_includes="")
AC_ARG_WITH(iconv,[ --with-iconv=PFX Prefix where iconv is installed (optional)], iconv_prefix="$withval", iconv_prefix="")
AC_ARG_WITH(iconv-libraries,[ --with-iconv-libraries=DIR Directory where libiconv library is installed (optional)], iconv_libraries="$withval", iconv_libraries="")
2004-03-21 07:17:32 +01:00
AC_ARG_WITH(iconv-includes,[ --with-iconv-includes=DIR Directory where libiconv header files are installed (optional)], iconv_includes="$withval", iconv_includes="")
2006-07-22 03:48:36 +02:00
AC_ARG_WITH(id3tag,[ --with-id3tag=PFX Prefix where libid3tag is installed (optional)], id3tag_prefix="$withval", id3tag_prefix="")
AC_ARG_WITH(id3tag-libraries,[ --with-id3tag-libraries=DIR Directory where libid3tag library is installed (optional)], id3tag_libraries="$withval", id3tag_libraries="")
AC_ARG_WITH(id3tag-includes,[ --with-id3tag-includes=DIR Directory where libid3tag header files are installed (optional)], id3tag_includes="$withval", id3tag_includes="")
2004-02-24 00:41:20 +01:00
2006-07-22 03:48:36 +02:00
AC_ARG_WITH(mad,[ --with-mad=PFX Prefix where libmad is installed (optional)], mad_prefix="$withval", mad_prefix="")
AC_ARG_WITH(mad-libraries,[ --with-mad-libraries=DIR Directory where libmad library is installed (optional)], mad_libraries="$withval", mad_libraries="")
AC_ARG_WITH(mad-includes,[ --with-mad-includes=DIR Directory where mad header files are installed (optional)], mad_includes="$withval", mad_includes="")
2004-02-24 00:41:20 +01:00
2006-07-22 03:48:36 +02:00
AC_ARG_WITH(faad,[ --with-faad=PFX Prefix where faad2 is installed], faad_prefix="$withval", faad_prefix="")
2004-03-18 04:29:25 +01:00
AC_ARG_WITH(faad-libraries,[ --with-faad-libraries=DIR Directory where faad2 library is installed (optional)], faad_libraries="$withval", faad_libraries="")
2006-07-22 03:48:36 +02:00
AC_ARG_WITH(faad-includes,[ --with-faad-includes=DIR Directory where faad2 header files are installed (optional)], faad_includes="$withval", faad_includes="")
2007-01-11 21:41:17 +01:00
AC_ARG_WITH(zeroconf,[[ --with-zeroconf=[auto|avahi|bonjour|no] Enable zeroconf backend (default=auto)]], with_zeroconf="$withval", with_zeroconf="auto")
2004-03-17 04:10:17 +01:00
2007-02-02 04:51:07 +01:00
AC_ARG_WITH(lsr,[ --with-src=PFX Prefix where libsamplerate is installed], src_prefix="$withval", src_prefix="")
AC_ARG_WITH(lsr-libraries,[ --with-lsr-libraries=DIR Directory where libsamplerate library is installed (optional)], lsr_libraries="$withval", lsr_libraries="")
AC_ARG_WITH(lsr-includes,[ --with-lsr-includes=DIR Directory where libsamplerate header files are installed (optional)], lsr_includes="$withval", lsr_includes="")
2004-02-24 00:41:20 +01:00
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
2006-08-04 09:40:53 +02:00
AC_CHECK_HEADER(sys/inttypes.h,AC_DEFINE(HAVE_SYS_INTTYPES_H,1,[Define if sys/inttypes.h present]),)
2004-03-25 04:06:56 +01:00
2007-05-30 22:08:24 +02:00
AC_TYPE_INT64_T
2007-05-30 18:52:56 +02:00
AC_TYPE_UINT64_T
2004-02-24 00:41:20 +01:00
AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
2004-03-03 19:17:14 +01:00
AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)
2006-06-04 13:36:06 +02:00
AC_CHECK_FUNCS(setenv)
2004-03-03 19:17:14 +01:00
2005-11-16 15:43:04 +01:00
2004-05-11 17:17:20 +02:00
dnl doesn't work for systems that don't have CODESET like OpenBSD
dnl AC_CHECK_HEADER(langinfo.h,[enable_langinfo=yes;AC_DEFINE(HAVE_LANGINFO,1,[Define if nl_langinfo.h is present])],enable_langinfo=no)
AM_LANGINFO_CODESET
2004-03-24 00:20:21 +01:00
AC_CHECK_HEADER(locale.h,[enable_locale=yes;AC_DEFINE(HAVE_LOCALE,1,[Define if locale.h is present])],enable_locale=no)
2004-02-24 00:41:20 +01:00
2008-04-12 06:07:24 +02:00
if test x$enable_tcp = xno; then
# if we don't support TCP, we don't need IPv6 either
enable_ipv6=no
fi
2004-02-24 00:41:20 +01:00
if test x$enable_ipv6 = xyes; then
AC_MSG_CHECKING(for ipv6)
AC_EGREP_CPP([AP_maGiC_VALUE],
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#ifdef PF_INET6
#ifdef AF_INET6
AP_maGiC_VALUE
#endif
#endif
],
2004-03-18 04:29:25 +01:00
AC_DEFINE(HAVE_IPV6, 1, [Define if IPv6 support present])
2004-02-24 00:41:20 +01:00
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
)
fi
2008-04-12 06:07:24 +02:00
if test x$enable_tcp = xyes; then
AC_DEFINE(HAVE_TCP, 1, [Define if TCP socket support is enabled])
fi
if test x$enable_un = xyes; then
AC_DEFINE(HAVE_UN, 1, [Define if unix domain socket support is enabled])
fi
2005-03-13 20:23:09 +01:00
enable_osx=no
case $host in
*-darwin*)
AC_DEFINE(HAVE_OSX, 1, [Define for compiling OS X support])
2005-03-17 03:33:40 +01:00
MPD_LIBS="$MPD_LIBS -framework AudioUnit -framework CoreServices"
2005-03-13 20:23:09 +01:00
enable_osx=yes ;;
esac
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
if test x$enable_shout_ogg = xyes || x$enable_shout_mp3 = xyes; then
XIPH_PATH_SHOUT([enable_shout=yes;AC_DEFINE(HAVE_SHOUT, 1, [Define to enable libshout support]) MPD_LIBS="$MPD_LIBS $SHOUT_LIBS" MPD_CFLAGS="$MPD_CFLAGS $SHOUT_CFLAGS"], [AC_MSG_WARN(libshout not found -- disabling shout support);enable_shout=no])
fi
if test x$enable_shout_ogg = xyes; then
2006-09-12 01:41:07 +02:00
if test x$enable_oggvorbis = xno; then
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
AC_MSG_WARN([disabling ogg shout streaming support because vorbis is not enabled])
enable_shout_ogg=no
2006-09-12 01:41:07 +02:00
fi
if test x$use_tremor = xyes; then
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
AC_MSG_WARN([disabling ogg shout streaming support because tremor does not support vorbis encoding])
enable_shout_ogg=no
fi
if test x$enable_shout = xno; then
AC_MSG_WARN([disabling ogg shout streaming support because libshout is not found])
enable_shout_ogg=no
fi
if test x$enable_shout_ogg = xyes; then
AC_DEFINE(HAVE_SHOUT_OGG, 1, [Define to enable ogg streaming support])
2006-09-12 01:41:07 +02:00
fi
2004-11-02 18:20:07 +01:00
fi
2008-09-12 16:05:23 +02:00
if test x$enable_shout_mp3 = xyes; then
if test x$enable_lame = xno; then
AC_MSG_WARN([disabling mp3 shout streaming support because lame is not enabled])
enable_shout_mp3=no
fi
if test x$enable_shout = xno; then
AC_MSG_WARN([disabling mp3 shout streaming support because libshout is not found])
enable_shout_mp3=no
fi
if test x$enable_shout_mp3 = xyes; then
AC_DEFINE(HAVE_SHOUT_MP3, 1, [Define to enable mp3 streaming support])
fi
fi
2004-04-11 06:49:27 +02:00
if test x$enable_ao = xyes; then
2005-03-13 16:36:46 +01:00
XIPH_PATH_AO([AC_DEFINE(HAVE_AO, 1, [Define to play with ao]) MPD_LIBS="$MPD_LIBS $AO_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AO_CFLAGS"], enable_ao=no)
2004-04-11 06:49:27 +02:00
fi
2005-02-02 11:27:24 +01:00
if test x$enable_oss = xyes; then
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
AC_CHECK_HEADER(sys/soundcard.h,[enable_oss=yes;AC_DEFINE(HAVE_OSS,1,[Define to enable OSS])],[AC_MSG_WARN(Soundcard headers not found -- disabling OSS support);enable_oss=no])
2005-02-02 11:27:24 +01:00
fi
2007-06-24 23:31:08 +02:00
PKG_PROG_PKG_CONFIG
2006-12-18 00:42:36 +01:00
2006-07-13 21:03:49 +02:00
if test x$enable_pulse = xyes; then
PKG_CHECK_MODULES([PULSE], [libpulse-simple],
2006-12-17 22:30:24 +01:00
[enable_pulse=yes;AC_DEFINE([HAVE_PULSE], 1, [Define to enable PulseAudio support])] MPD_LIBS="$MPD_LIBS $PULSE_LIBS" MPD_CFLAGS="$MPD_CFLAGS $PULSE_CFLAGS",
2006-07-13 21:03:49 +02:00
[enable_pulse=no;AC_MSG_WARN([PulseAudio not found -- disabling])])
fi
2007-02-02 04:51:07 +01:00
if test x$enable_lsr = xyes; then
PKG_CHECK_MODULES([SAMPLERATE], [samplerate >= 0.0.15],
[enable_lsr=yes;AC_DEFINE([HAVE_LIBSAMPLERATE], 1, [Define to enable libsamplerate])] MPD_LIBS="$MPD_LIBS $SAMPLERATE_LIBS" MPD_CFLAGS="$MPD_CFLAGS $SAMPLERATE_CFLAGS",
[enable_lsr=no;AC_MSG_WARN([libsamplerate not found -- disabling])])
fi
2007-06-13 16:15:30 +02:00
if test x$enable_fifo = xyes; then
AC_CHECK_FUNC([mkfifo],
[enable_fifo=yes;AC_DEFINE([HAVE_FIFO], 1, [Define to enable support for writing audio to a FIFO])],
[enable_fifo=no;AC_MSG_WARN([mkfifo not found -- disabling support for writing audio to a FIFO])])
fi
2005-08-25 02:08:41 +02:00
if test x$enable_mvp = xyes; then
AC_DEFINE(HAVE_MVP,1,[Define to enable Hauppauge Media MVP support])
fi
2004-03-30 23:18:03 +02:00
if test x$enable_alsa = xyes; then
2005-02-03 05:33:52 +01:00
AM_PATH_ALSA(0.9.0,[AC_DEFINE(HAVE_ALSA,1,[Define to enable ALSA support]) MPD_LIBS="$MPD_LIBS $ALSA_LIBS" MPD_CFLAGS="$MPD_CFLAGS $ALSA_CFLAGS"],enable_alsa=no)
2004-03-24 00:20:21 +01:00
fi
2006-12-17 22:30:24 +01:00
if test x$enable_jack = xyes; then
PKG_CHECK_MODULES([JACK], [jack >= 0.4],
[enable_jack=yes;AC_DEFINE([HAVE_JACK], 1, [Define to enable JACK support])] MPD_LIBS="$MPD_LIBS $JACK_LIBS" MPD_CFLAGS="$MPD_CFLAGS $JACK_CFLAGS",
[enable_jack=no;AC_MSG_WARN([JACK not found -- disabling])])
2006-10-18 04:49:13 +02:00
fi
2004-03-21 07:17:32 +01:00
if test x$enable_iconv = xyes; then
if test "x$iconv_libraries" != "x" ; then
ICONV_LIBS="-L$iconv_libraries"
elif test "x$iconv_prefix" != "x" ; then
ICONV_LIBS="-L$iconv_prefix/lib"
fi
ICONV_LIBS="$ICONV_LIBS -liconv"
if test "x$iconv_includes" != "x" ; then
ICONV_CFLAGS="-I$iconv_includes"
elif test "x$iconv_prefix" != "x" ; then
ICONV_CFLAGS="-I$iconv_prefix/include"
fi
oldcflags=$CFLAGS
oldlibs=$LIBS
2004-03-24 04:42:24 +01:00
oldcppflags=$CPPFLAGS
2004-03-21 07:17:32 +01:00
CFLAGS="$CFLAGS $MPD_CFLAGS $ICONV_CFLAGS"
LIBS="$LIBS $MPD_LIBS $ICONV_LIBS"
2004-03-24 04:42:24 +01:00
CPPFLAGS=$CFLAGS
2004-03-21 07:17:32 +01:00
AC_CHECK_HEADER(iconv.h,MPD_CFLAGS="$MPD_CFLAGS $ICONV_CFLAGS",enable_iconv=no)
if test x$enable_iconv = xyes; then
2004-05-11 18:16:52 +02:00
AC_CHECK_LIB(iconv,main,MPD_LIBS="$MPD_LIBS $ICONV_LIBS",)
2004-03-21 07:17:32 +01:00
AC_DEFINE(HAVE_ICONV,1,[Define to use iconv])
fi
CFLAGS=$oldcflags
LIBS=$oldlibs
2004-03-24 04:42:24 +01:00
CPPFLAGS=$oldcppflags
2004-03-21 07:17:32 +01:00
fi
2004-02-24 00:41:20 +01:00
ID3_SUBDIR=""
if test x$enable_id3 = xyes; then
2006-07-16 19:49:15 +02:00
if test "x$id3tag_libraries" != "x" ; then
ID3TAG_LIBS="-L$id3tag_libraries"
elif test "x$id3tag_prefix" != "x" ; then
ID3TAG_LIBS="-L$id3tag_prefix/lib"
fi
ID3TAG_LIBS="$ID3TAG_LIBS -lid3tag -lz"
if test "x$id3tag_includes" != "x" ; then
ID3TAG_CFLAGS="-I$id3tag_includes"
elif test "x$id3tag_prefix" != "x" ; then
ID3TAG_CFLAGS="-I$id3tag_prefix/include"
2004-02-24 00:41:20 +01:00
fi
2006-07-16 19:49:15 +02:00
ID3TAG_CFLAGS="$ID3TAG_CFLAGS"
oldcflags=$CFLAGS
oldlibs=$LIBS
oldcppflags=$CPPFLAGS
CFLAGS="$CFLAGS $MPD_CFLAGS $ID3TAG_CFLAGS"
LIBS="$LIBS $MPD_LIBS $ID3TAG_LIBS"
CPPFLAGS=$CFLAGS
AC_CHECK_HEADERS(id3tag.h,use_libid3tag=yes,
[use_libid3tag=no])
if test x$use_libid3tag = xyes; then
AC_CHECK_LIB(id3tag,id3_file_open,
2006-07-23 01:28:26 +02:00
[MPD_LIBS="$MPD_LIBS $ID3TAG_LIBS";
2006-07-16 19:49:15 +02:00
MPD_CFLAGS="$MPD_CFLAGS $ID3TAG_CFLAGS";
use_libid3tag=yes],
[use_libid3tag=no])
2004-02-24 00:41:20 +01:00
fi
2006-07-16 19:49:15 +02:00
CFLAGS=$oldcflags
LIBS=$oldlibs
CPPFLAGS=$oldcppflags
2006-07-17 10:37:57 +02:00
if test x$use_libid3tag = xyes; then
2006-07-17 10:22:50 +02:00
AC_DEFINE(HAVE_ID3TAG,1,[Define to use id3tag])
else
enable_id3=no
fi
2004-02-24 00:41:20 +01:00
fi
MAD_SUBDIR=""
if test x$enable_mp3 = xyes; then
2006-07-16 19:49:15 +02:00
if test "x$mad_libraries" != "x" ; then
MAD_LIBS="-L$mad_libraries"
elif test "x$mad_prefix" != "x" ; then
MAD_LIBS="-L$mad_prefix/lib"
2004-02-24 00:41:20 +01:00
fi
2006-07-16 19:49:15 +02:00
MAD_LIBS="$MAD_LIBS -lmad"
if test "x$mad_includes" != "x" ; then
MAD_CFLAGS="-I$mad_includes"
elif test "x$mad_prefix" != "x" ; then
MAD_CFLAGS="-I$mad_prefix/include"
fi
oldcflags=$CFLAGS
oldlibs=$LIBS
oldcppflags=$CPPFLAGS
CFLAGS="$CFLAGS $MPD_CFLAGS $MAD_CFLAGS"
LIBS="$LIBS $MPD_LIBS $MAD_LIBS"
CPPFLAGS=$CFLAGS
AC_CHECK_HEADERS(mad.h,use_libmad=yes,
[use_libmad=no])
if test x$use_libmad = xyes; then
2006-07-23 01:28:26 +02:00
AC_CHECK_LIB(mad,mad_stream_init,[MPD_LIBS="$MPD_LIBS $MAD_LIBS";
2006-07-16 19:49:15 +02:00
MPD_CFLAGS="$MPD_CFLAGS $MAD_CFLAGS";
use_libmad=yes],[use_libmad=no])
2004-02-24 00:41:20 +01:00
fi
2006-07-16 19:49:15 +02:00
CFLAGS=$oldcflags
LIBS=$oldlibs
CPPFLAGS=$oldcppflags
2006-07-17 10:22:50 +02:00
if test x$use_libmad = xyes; then
AC_DEFINE(HAVE_MAD,1,[Define to use libmad])
else
enable_mp3=no
fi
2004-02-24 00:41:20 +01:00
fi
2008-09-12 16:05:23 +02:00
if test x$enable_lame = xyes; then
AM_PATH_LAME([MPD_LIBS="$MPD_LIBS $LAME_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LAME_CFLAGS"],
[enable_lame=no;AC_MSG_WARN(You need lame -- disabling lame support)])
fi
2005-02-01 05:15:41 +01:00
if test x$enable_mpc = xyes; then
2005-07-30 12:28:43 +02:00
if test "x$mpcdec_libraries" != "x" ; then
MPCDEC_LIBS="-L$mpcdec_libraries"
elif test "x$mpcdec_prefix" != "x" ; then
2006-09-06 11:29:06 +02:00
MPCDEC_LIBS="-L$mpcdec_prefix/lib"
2005-02-01 05:15:41 +01:00
fi
2005-07-30 12:28:43 +02:00
MPCDEC_LIBS="$MPCDEC_LIBS -lmpcdec"
2005-02-01 05:15:41 +01:00
2005-07-30 12:28:43 +02:00
if test "x$mpcdec_includes" != "x" ; then
MPCDEC_CFLAGS="-I$mpcdec_includes"
elif test "x$mpcdec_prefix" != "x" ; then
MPCDEC_CFLAGS="-I$mpcdec_prefix/include"
2005-02-01 05:15:41 +01:00
fi
oldcflags=$CFLAGS
oldlibs=$LIBS
oldcppflags=$CPPFLAGS
2005-07-30 12:28:43 +02:00
CFLAGS="$CFLAGS $MPD_CFLAGS $MPCDEC_CFLAGS -I."
LIBS="$LIBS $MPD_LIBS $MPCDEC_LIBS"
2005-02-01 05:15:41 +01:00
CPPFLAGS=$CFLAGS
2005-07-30 12:28:43 +02:00
AC_CHECK_HEADER(mpcdec/mpcdec.h,,enable_mpc=no)
2005-02-01 05:15:41 +01:00
if test x$enable_mpc = xyes; then
2005-07-30 12:28:43 +02:00
AC_CHECK_LIB(mpcdec,main,[MPD_LIBS="$MPD_LIBS $MPCDEC_LIBS";MPD_CFLAGS="$MPD_CFLAGS $MPCDEC_CFLAGS";],enable_mpc=no)
2005-02-01 05:15:41 +01:00
fi
if test x$enable_mpc = xyes; then
2005-07-30 12:28:43 +02:00
AC_DEFINE(HAVE_MPCDEC,1,[Define to use libmpcdec for MPC decoding])
2005-02-01 05:15:41 +01:00
else
2005-07-30 12:28:43 +02:00
AC_MSG_WARN([mpcdec lib needed for MPC support -- disabling MPC support])
2005-02-01 05:15:41 +01:00
fi
CFLAGS=$oldcflags
LIBS=$oldlibs
CPPFLAGS=$oldcppflags
fi
2007-06-24 22:40:04 +02:00
if test x$enable_wavpack = xyes; then
PKG_CHECK_MODULES([WAVPACK], [wavpack],
[enable_wavpack=yes;AC_DEFINE([HAVE_WAVPACK], 1, [Define to enable WavPack support])] MPD_LIBS="$MPD_LIBS $WAVPACK_LIBS" MPD_CFLAGS="$MPD_CFLAGS $WAVPACK_CFLAGS",
[enable_wavpack=no;AC_MSG_WARN([WavPack not found -- disabling])])
fi
2006-07-26 05:05:50 +02:00
MP4FF_SUBDIR=""
2004-03-17 04:10:17 +01:00
if test x$enable_aac = xyes; then
2006-07-19 17:54:53 +02:00
if test "x$faad_libraries" != "x" ; then
FAAD_LIBS="-L$faad_libraries"
elif test "x$faad_prefix" != "x" ; then
FAAD_LIBS="-L$faad_prefix/lib"
fi
2004-03-17 04:10:17 +01:00
2006-07-26 05:05:50 +02:00
FAAD_LIBS="$FAAD_LIBS -lfaad"
2004-03-17 04:10:17 +01:00
2006-07-19 17:54:53 +02:00
if test "x$faad_includes" != "x" ; then
FAAD_CFLAGS="-I$faad_includes"
elif test "x$faad_prefix" != "x" ; then
FAAD_CFLAGS="-I$faad_prefix/include"
fi
2004-03-17 04:10:17 +01:00
oldcflags=$CFLAGS
oldlibs=$LIBS
2004-03-24 04:42:24 +01:00
oldcppflags=$CPPFLAGS
2004-03-18 04:29:25 +01:00
CFLAGS="$CFLAGS $MPD_CFLAGS $FAAD_CFLAGS -I."
2004-03-17 04:10:17 +01:00
LIBS="$LIBS $MPD_LIBS $FAAD_LIBS"
2004-03-24 04:42:24 +01:00
CPPFLAGS=$CFLAGS
2004-03-17 04:10:17 +01:00
AC_CHECK_HEADER(faad.h,,enable_aac=no)
2004-03-25 02:08:13 +01:00
if test x$enable_aac = xyes; then
AC_CHECK_DECL(FAAD2_VERSION,,enable_aac=no,[#include <faad.h>])
fi
2004-03-17 18:19:52 +01:00
if test x$enable_aac = xyes; then
2004-03-21 14:47:45 +01:00
AC_CHECK_DECL(faacDecInit2,,enable_aac=no,[#include <faad.h>])
2004-03-18 04:29:25 +01:00
fi
if test x$enable_aac = xyes; then
2006-07-26 05:05:50 +02:00
AC_CHECK_LIB(faad,faacDecInit2,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS";MP4FF_SUBDIR="mp4ff";MP4FF_LIB="mp4ff/libmp4ff.la"],enable_aac=no)
2006-07-05 00:07:34 +02:00
if test x$enable_aac = xno; then
enable_aac=yes
2006-07-26 05:05:50 +02:00
AC_CHECK_LIB(faad,NeAACDecInit2,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS";MP4FF_SUBDIR="mp4ff";MP4FF_LIB="mp4ff/libmp4ff.la"],enable_aac=no)
2006-07-05 00:07:34 +02:00
fi
2004-03-21 14:47:45 +01:00
fi
if test x$enable_aac = xyes; then
2006-07-26 05:05:50 +02:00
AC_MSG_CHECKING(that FAAD2 uses buffer and bufferlen)
2004-03-25 02:08:13 +01:00
AC_COMPILE_IFELSE([
#include <faad.h>
int main() {
char buffer;
long bufferlen = 0;
faacDecHandle decoder;
faacDecFrameInfo frameInfo;
faacDecConfigurationPtr config;
unsigned char channels;
long sampleRate;
mp4AudioSpecificConfig mp4ASC;
decoder = faacDecOpen();
config = faacDecGetCurrentConfiguration(decoder);
config->outputFormat = FAAD_FMT_16BIT;
faacDecSetConfiguration(decoder,config);
AudioSpecificConfig(&buffer, bufferlen, &mp4ASC);
faacDecInit(decoder,&buffer,bufferlen,&sampleRate,&channels);
faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
faacDecDecode(decoder,&frameInfo,&buffer,bufferlen);
return 0;
}
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FAAD_BUFLEN_FUNCS,1,[Define if FAAD2 uses buflen in function calls])],[AC_MSG_RESULT(no);
AC_MSG_CHECKING(that FAAD2 can even be used)
AC_COMPILE_IFELSE([
#include <faad.h>
int main() {
char buffer;
faacDecHandle decoder;
faacDecFrameInfo frameInfo;
faacDecConfigurationPtr config;
unsigned char channels;
long sampleRate;
long bufferlen = 0;
unsigned long dummy1_32;
unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
dummy7_8, dummy8_8;
decoder = faacDecOpen();
config = faacDecGetCurrentConfiguration(decoder);
config->outputFormat = FAAD_FMT_16BIT;
faacDecSetConfiguration(decoder,config);
AudioSpecificConfig(&buffer,&dummy1_32,&dummy2_8,
&dummy3_8,&dummy4_8,&dummy5_8,
&dummy6_8,&dummy7_8,&dummy8_8);
faacDecInit(decoder,&buffer,&sampleRate,&channels);
faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
faacDecDecode(decoder,&frameInfo,&buffer);
faacDecClose(decoder);
return 0;
}
],AC_MSG_RESULT(yes),[AC_MSG_RESULT(no);enable_aac=no])
])
fi
if test x$enable_aac = xyes; then
AC_CHECK_TYPES(mp4AudioSpecificConfig,,,[#include <faad.h>])
AC_CHECK_MEMBERS([faacDecConfiguration.downMatrix,faacDecConfiguration.dontUpSampleImplicitSBR,faacDecFrameInfo.samplerate],,,[#include <faad.h>])
2004-03-18 04:29:25 +01:00
AC_DEFINE(HAVE_FAAD,1,[Define to use FAAD2 for AAC decoding])
2004-03-19 16:56:31 +01:00
else
AC_MSG_WARN([faad2 lib needed for MP4/AAC support -- disabling MP4/AAC support])
2004-03-17 04:10:17 +01:00
fi
CFLAGS=$oldcflags
LIBS=$oldlibs
2004-03-24 04:42:24 +01:00
CPPFLAGS=$oldcppflags
2004-03-17 04:10:17 +01:00
fi
2005-08-25 10:07:28 +02:00
if test x$use_tremor = xyes; then
2006-07-19 17:54:53 +02:00
if test "x$tremor_libraries" != "x" ; then
TREMOR_LIBS="-L$tremor_libraries"
elif test "x$tremor_prefix" != "x" ; then
TREMOR_LIBS="-L$tremor_prefix/lib"
fi
TREMOR_LIBS="$TREMOR_LIBS -lvorbisidec"
if test "x$tremor_includes" != "x" ; then
TREMOR_CFLAGS="-I$tremor_includes"
elif test "x$tremor_prefix" != "x" ; then
TREMOR_CFLAGS="-I$tremor_prefix/include"
fi
2005-08-25 10:07:28 +02:00
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $TREMOR_CFLAGS"
LIBS="$LIBS $TREMOR_LIBS"
2006-09-12 01:41:07 +02:00
AC_CHECK_LIB(vorbisidec,ov_read,enable_oggvorbis=yes,enable_oggvorbis=no;AC_MSG_WARN([vorbisidec lib needed for ogg support with tremor -- disabling ogg support]))
if test x$enable_oggvorbis = xno; then
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
2005-08-25 10:07:28 +02:00
fi
2006-09-12 01:41:07 +02:00
elif test x$enable_oggvorbis = xyes; then
XIPH_PATH_OGG(,enable_oggvorbis=no)
XIPH_PATH_VORBIS(,enable_oggvorbis=no)
2006-03-16 07:52:46 +01:00
if test x$enable_oggvorbis = xyes; then
2006-09-12 01:41:07 +02:00
MPD_LIBS="$MPD_LIBS $OGG_LIBS $VORBIS_LIBS $VORBISFILE_LIBS"
MPD_CFLAGS="$MPD_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS"
2004-02-24 00:41:20 +01:00
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
if test x$enable_shout_ogg = xyes; then
2006-09-12 01:41:07 +02:00
MPD_LIBS="$MPD_LIBS $VORBISENC_LIBS"
2007-01-14 05:25:21 +01:00
MPD_CFLAGS="$MPD_CFLAGS $VORBISFILE_CFLAGS $VORBISENC_CFLAGS"
2005-08-25 10:07:28 +02:00
fi
2004-02-24 00:41:20 +01:00
fi
fi
2006-03-16 07:52:46 +01:00
if test x$enable_oggvorbis = xyes; then
AC_DEFINE(HAVE_OGGVORBIS,1,[Define for Ogg Vorbis support])
2004-02-24 00:41:20 +01:00
fi
2005-08-25 10:07:28 +02:00
if test x$use_tremor = xyes; then
AC_DEFINE(HAVE_TREMOR,1,[Define to use tremor (libvorbisidec) for ogg support])
2006-09-12 01:41:07 +02:00
if test x$enable_oggflac = xyes; then
AC_MSG_WARN([disabling OggFLAC support because it is incompatible with tremor])
enable_oggflac=no
fi
fi
2005-08-25 10:07:28 +02:00
2004-02-24 00:41:20 +01:00
if test x$enable_flac = xyes; then
oldmpdcflags="$MPD_CFLAGS"
oldmpdlibs="$MPD_LIBS"
AM_PATH_LIBFLAC(MPD_LIBS="$MPD_LIBS $LIBFLAC_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LIBFLAC_CFLAGS",enable_flac=no)
fi
2006-03-16 07:52:46 +01:00
2004-02-24 00:41:20 +01:00
if test x$enable_flac = xyes; then
oldcflags="$CFLAGS"
oldlibs="$LIBS"
CFLAGS="$CFLAGS $MPD_CFLAGS"
LIBS="$LIBS $MPD_LIBS"
AC_CHECK_LIB(FLAC, FLAC__metadata_object_vorbiscomment_find_entry_from,
,[enable_flac=no;AC_MSG_WARN(You need FLAC 1.1 -- disabling flac support)])
if test x$enable_flac = xno; then
MPD_CFLAGS="$oldmpdcflags"
MPD_LIBS="$oldmpdlibs"
2007-01-14 05:25:19 +01:00
else
AC_CHECK_DECL(FLAC_API_SUPPORTS_OGG_FLAC,
[enable_oggflac=flac], [],
[#include <FLAC/export.h>])
2004-02-24 00:41:20 +01:00
fi
CFLAGS="$oldcflags"
LIBS="$oldlibs"
fi
if test x$enable_flac = xyes; then
2004-03-18 04:29:25 +01:00
AC_DEFINE(HAVE_FLAC,1,[Define for FLAC support])
2004-02-24 00:41:20 +01:00
fi
2006-03-16 07:52:46 +01:00
if test x$enable_oggflac = xyes; then
oldmpdcflags="$MPD_CFLAGS"
oldmpdlibs="$MPD_LIBS"
AM_PATH_LIBOGGFLAC(MPD_LIBS="$MPD_LIBS $LIBOGGFLAC_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LIBOGGFLAC_CFLAGS",enable_oggflac=no)
fi
if test x$enable_oggflac = xyes; then
AC_DEFINE(HAVE_OGGFLAC,1,[Define for OggFLAC support])
fi
2004-02-24 00:41:20 +01:00
if test x$enable_audiofile = xyes; then
2004-03-18 04:29:25 +01:00
AM_PATH_AUDIOFILE(0.1.7, MPD_LIBS="$MPD_LIBS $AUDIOFILE_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AUDIOFILE_CFLAGS",
2004-02-24 00:41:20 +01:00
[enable_audiofile=no;AC_MSG_WARN(You need audiofile -- disabling audiofile support)])
fi
2004-03-18 04:29:25 +01:00
if test x$enable_audiofile = xyes; then
AC_DEFINE(HAVE_AUDIOFILE,1,[Define for audiofile support])
fi
2004-05-31 22:59:55 +02:00
if test x$enable_mod = xyes; then
AM_PATH_LIBMIKMOD(3.1.7, MPD_CFLAGS="$MPD_CFLAGS $LIBMIKMOD_CFLAGS"
2004-06-17 13:11:06 +02:00
MPD_LIBS="$MPD_LIBS $LIBMIKMOD_LIBS $LIBMIKMOD_LDADD", enable_mod=no)
2004-05-31 22:59:55 +02:00
if test x$enable_mod = xyes; then
AC_DEFINE(HAVE_MIKMOD, 1, [Define for mikmod support])
fi
fi
2007-01-14 03:08:03 +01:00
case $with_zeroconf in
no|avahi|bonjour)
;;
*)
2007-01-11 21:41:17 +01:00
with_zeroconf=auto
2007-01-14 03:08:03 +01:00
;;
esac
2007-01-11 21:41:17 +01:00
if test x$with_zeroconf != xno; then
2007-06-03 02:03:20 +02:00
if test x$with_zeroconf = xavahi || test x$with_zeroconf = xauto; then
2007-01-11 21:41:17 +01:00
PKG_CHECK_MODULES([AVAHI], [avahi-client],
2007-06-03 02:03:20 +02:00
[found_avahi=1;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])]
MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS",
[found_avahi=0])
2007-01-11 21:41:17 +01:00
fi
2007-06-02 19:06:08 +02:00
if test x$found_avahi = x1; then
with_zeroconf=avahi
2007-06-03 02:03:20 +02:00
elif test x$with_zeroconf = xavahi; then
2008-06-16 15:43:03 +02:00
AC_MSG_ERROR([Avahi support requested but not found])
2007-06-02 19:06:08 +02:00
fi
2007-06-03 02:03:20 +02:00
if test x$with_zeroconf = xbonjour || test x$with_zeroconf = xauto; then
AC_CHECK_HEADER(dns_sd.h,
2007-06-03 21:44:19 +02:00
[found_bonjour=1;AC_DEFINE([HAVE_BONJOUR], 1, [Define to enable Bonjour Zeroconf support])],
2007-06-03 02:03:20 +02:00
[found_bonjour=0])
AC_CHECK_LIB(dns_sd, DNSServiceRegister,
MPD_LIBS="$MPD_LIBS -ldns_sd")
2007-06-02 19:06:08 +02:00
fi
if test x$found_bonjour = x1; then
with_zeroconf=bonjour
2007-06-03 02:03:20 +02:00
elif test x$with_zeroconf = xbonjour; then
2008-06-16 15:43:03 +02:00
AC_MSG_ERROR([Bonjour support requested but not found])
2007-01-11 21:41:17 +01:00
fi
2008-06-16 15:43:03 +02:00
if test x$with_zeroconf = xauto; then
2007-01-11 21:41:17 +01:00
AC_MSG_WARN([No supported Zeroconf backend found, disabling Zeroconf])
with_zeroconf=no
2007-06-03 21:44:19 +02:00
else
AC_DEFINE([HAVE_ZEROCONF], 1, [Define to enable Zeroconf support])
2007-01-11 21:41:17 +01:00
fi
fi
2006-07-26 05:05:50 +02:00
AC_OUTPUT(src/mp4ff/Makefile doc/Makefile src/Makefile Makefile )
2004-03-17 19:13:29 +01:00
echo ""
echo "########### MPD CONFIGURATION ############"
2004-03-24 00:20:21 +01:00
echo ""
2008-04-12 06:07:24 +02:00
echo " Client Support:"
if test x$enable_tcp = xyes; then
echo " TCP support ...................enabled"
else
echo " TCP support ...................disabled"
fi
2008-04-12 06:07:31 +02:00
if test x$enable_ipv6 = xyes; then
echo " IPv6 support ..................enabled"
else
echo " IPv6 support ..................disabled"
fi
2008-04-12 06:07:24 +02:00
if test x$enable_un = xyes; then
echo " Unix domain socket support ....enabled"
else
echo " Unix domain socket support ....disabled"
fi
echo ""
if
test x$enable_tcp = xno &&
test x$enable_un = xno; then
AC_MSG_ERROR([No client interfaces configured!])
fi
2005-03-24 01:10:14 +01:00
echo " Playback Support:"
2004-04-11 06:49:27 +02:00
if test x$enable_ao = xyes; then
2005-03-24 01:10:14 +01:00
echo " libao support .................enabled"
2005-01-16 17:03:14 +01:00
else
2005-03-24 01:10:14 +01:00
echo " libao support .................disabled"
2005-01-16 17:03:14 +01:00
fi
if test x$enable_oss = xyes; then
2005-03-24 01:10:14 +01:00
echo " OSS support ...................enabled"
2004-04-11 06:49:27 +02:00
else
2005-03-24 01:10:14 +01:00
echo " OSS support ...................disabled"
2004-04-11 06:49:27 +02:00
fi
2005-03-05 13:29:00 +01:00
if test x$enable_alsa = xyes; then
2005-03-24 01:10:14 +01:00
echo " ALSA support ..................enabled"
2005-03-05 13:29:00 +01:00
else
2005-03-24 01:10:14 +01:00
echo " ALSA support ..................disabled"
2005-03-05 13:29:00 +01:00
fi
2006-10-18 04:49:13 +02:00
if test x$enable_jack = xyes; then
echo " JACK support ..................enabled"
else
echo " JACK support ..................disabled"
fi
2005-03-13 20:23:09 +01:00
if test x$enable_osx = xyes; then
2005-03-24 01:10:14 +01:00
echo " OS X support ..................enabled"
2005-03-13 20:23:09 +01:00
else
2005-03-24 01:10:14 +01:00
echo " OS X support ..................disabled"
2005-03-13 20:23:09 +01:00
fi
2006-07-13 21:03:49 +02:00
if test x$enable_pulse = xyes; then
echo " PulseAudio support ............enabled"
else
echo " PulseAudio support ............disabled"
fi
2007-06-13 16:15:30 +02:00
if test x$enable_fifo = xyes; then
echo " FIFO support ..................enabled"
else
echo " FIFO support ..................disabled"
fi
2005-08-25 02:08:41 +02:00
if test x$enable_mvp = xyes; then
echo " Media MVP support .............enabled"
else
echo " Media MVP support .............disabled"
fi
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
if test x$enable_shout_ogg = xyes; then
echo " Shout ogg streaming support ...enabled"
2004-08-20 15:57:11 +02:00
else
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
echo " Shout ogg streaming support ...disabled"
2004-08-20 15:57:11 +02:00
fi
2008-09-12 16:05:23 +02:00
if test x$enable_shout_mp3 = xyes; then
echo " Shout mp3 streaming support ...enabled"
else
echo " Shout mp3 streaming support ...disabled"
fi
2005-03-05 13:29:00 +01:00
echo ""
2005-03-17 01:56:31 +01:00
if test x$enable_ao = xno &&
test x$enable_oss = xno &&
shout: introduce pluggable encoder API
I've perhaps gone a bit overboard, but here's the current rundown:
Both Ogg and MP3 use the "shout" audio output plugin. The shout audio
output plugin itself has two new plugins, one for the Ogg encoder,
and another for the MP3 (LAME) encoder.
Configuration for an Ogg stream doesn't change. For an MP3 stream,
configuration is the same as Ogg, with two exceptions. First, you must
specify the optional "encoding" parameter, which should be set to "mp3".
See mpd.conf(5) for more details. Second, the "quality" parameter is
reversed for LAME, such that 1 is high quality for LAME, whereas 10 is
high quality for Ogg.
I've decomposed the code so that all libshout related operations
are done in audioOutput_shout.c, all Ogg specific functions are in
audioOutput_shout_ogg.c, and of course then all LAME specific functions
are handled in audioOutput_shout_mp3.c.
To develop encoder plugins for the shout audio output plugin, I basically
just mimicked the plugin system used for audio outputs. This might be
overkill, but hopefully if anyone ever wants to support some other sort
of stream, like maybe AAC, FLAC, or WMA (hey it could happen), they will
hopefully be all set.
The Ogg encoder is slightly less optimal under this configuration.
It used to send shout data directly out of its ogg_page structures. Now,
in the interest of encapsulation, it copies the data from its ogg_page
structures into a buffer provided by the shout audio output plugin (see
audioOutput_shout_ogg.c, line 77.) I suspect the performance impact
is negligible.
As for metadata, I'm pretty sure they'll both work. I wrote up a test
scaffold that would create a fake tag, and tell the plugin to send it
out to the stream every few seconds. It seemed to work fine. Of course,
if something does break, I'll be glad to fix it.
Lastly, I've renamed lots of things into snake_case, in keeping with
normalperson's wishes in that regard.
[mk: moved the MP3 patch after this one. Splitted this patch into
several parts; the others were already applied before this one. Fixed
a bunch GCC warnings and wrong whitespace modifications. Made it
compile with mpd-mk by adapting to its prototypes]
2008-09-12 16:04:40 +02:00
test x$enable_shout_ogg = xno &&
2008-09-12 16:05:23 +02:00
test x$enable_shout_mp3 = xno &&
2005-03-17 01:56:31 +01:00
test x$enable_alsa = xno &&
2005-08-25 02:08:41 +02:00
test x$enable_osx = xno &&
2006-07-13 21:03:49 +02:00
test x$enable_pulse = xno &&
2006-10-18 04:49:13 +02:00
test x$enable_jack = xno &&
2007-06-13 16:15:30 +02:00
test x$enable_fifo = xno &&
2005-08-25 02:08:41 +02:00
test x$enable_mvp = xno; then
2006-09-13 10:03:37 +02:00
AC_MSG_ERROR([No Audio Output types configured!])
2005-03-17 01:56:31 +01:00
fi
2005-03-24 01:10:14 +01:00
echo " File Format Support:"
2005-03-05 13:29:00 +01:00
2004-03-17 19:13:29 +01:00
if test x$enable_id3 = xyes; then
2005-03-24 01:10:14 +01:00
echo " ID3 tag support ...............enabled"
2004-03-17 19:13:29 +01:00
else
2005-03-24 01:10:14 +01:00
echo " ID3 tag support ...............disabled"
2004-03-17 19:13:29 +01:00
fi
if test x$enable_mp3 = xyes; then
2005-03-24 01:10:14 +01:00
echo " mp3 support ...................enabled"
2004-03-17 19:13:29 +01:00
else
2005-03-24 01:10:14 +01:00
echo " mp3 support ...................disabled"
2004-03-17 19:13:29 +01:00
fi
2008-09-12 16:05:23 +02:00
if test x$enable_lame = xyes; then
echo " lame support ..................enabled"
else
echo " lame support ..................disabled"
fi
2006-03-16 07:52:46 +01:00
if test x$enable_oggvorbis = xyes; then
2005-03-24 01:10:14 +01:00
echo " Ogg Vorbis support ............enabled"
2005-08-25 10:07:28 +02:00
if test x$use_tremor = xyes; then
echo " using tremor.................yes"
else
echo " using tremor.................no"
fi
2004-03-17 19:13:29 +01:00
else
2005-03-24 01:10:14 +01:00
echo " Ogg Vorbis support ............disabled"
2004-03-17 19:13:29 +01:00
fi
if test x$enable_flac = xyes; then
2005-03-24 01:10:14 +01:00
echo " FLAC support ..................enabled"
2004-03-17 19:13:29 +01:00
else
2005-03-24 01:10:14 +01:00
echo " FLAC support ..................disabled"
2004-03-17 19:13:29 +01:00
fi
2007-01-14 05:25:19 +01:00
case $enable_oggflac in
yes)
2006-03-16 07:52:46 +01:00
echo " OggFLAC support ...............enabled"
2007-01-14 05:25:19 +01:00
;;
flac)
echo " OggFLAC support ...............enabled(FLAC 1.1.3)"
;;
*)
2006-03-16 07:52:46 +01:00
echo " OggFLAC support ...............disabled"
2007-01-14 05:25:19 +01:00
;;
esac
2006-03-16 07:52:46 +01:00
2004-03-17 19:13:29 +01:00
if test x$enable_audiofile = xyes; then
2005-03-24 01:10:14 +01:00
echo " Wave file support .............enabled"
2004-03-17 19:13:29 +01:00
else
2005-03-24 01:10:14 +01:00
echo " Wave file support .............disabled"
2004-03-17 19:13:29 +01:00
fi
if test x$enable_aac = xyes; then
2005-03-24 01:10:14 +01:00
echo " MP4/AAC support ...............enabled"
2004-03-17 19:13:29 +01:00
else
2005-03-24 01:10:14 +01:00
echo " MP4/AAC support ...............disabled"
2004-03-17 19:13:29 +01:00
fi
2005-02-01 05:15:41 +01:00
if test x$enable_mpc = xyes; then
2005-03-24 01:10:14 +01:00
echo " Musepack (MPC) support ........enabled"
2005-02-01 05:15:41 +01:00
else
2005-03-24 01:10:14 +01:00
echo " Musepack (MPC) support ........disabled"
2005-02-01 05:15:41 +01:00
fi
2007-06-24 22:40:04 +02:00
if test x$enable_wavpack = xyes; then
echo " WavPack support ...............enabled"
else
echo " WavPack support ...............disabled"
fi
2004-05-31 22:59:55 +02:00
if test x$enable_mod = xyes; then
2005-03-24 01:10:14 +01:00
echo " MOD support ...................enabled"
2004-05-31 22:59:55 +02:00
else
2005-03-24 01:10:14 +01:00
echo " MOD support ...................disabled"
2004-05-31 22:59:55 +02:00
fi
2006-07-16 23:58:52 +02:00
if
test x$enable_mp3 = xno &&
test x$enable_oggvorbis = xno &&
test x$enable_flac = xno &&
test x$enable_oggflac = xno &&
test x$enable_audiofile = xno &&
test x$enable_aac = xno &&
test x$enable_mpc = xno &&
2007-06-24 22:40:04 +02:00
test x$enable_wavpack = xno &&
2006-07-16 23:58:52 +02:00
test x$enable_mod = xno; then
2006-09-13 10:03:37 +02:00
AC_MSG_ERROR([No input plugins supported!])
2006-07-16 23:58:52 +02:00
fi
2007-01-11 21:41:17 +01:00
echo ""
echo " Other features:"
2007-02-02 04:51:07 +01:00
if test x$enable_lsr = xyes; then
echo " libsamplerate support .........enabled"
else
echo " libsamplerate support .........disabled"
fi
2007-01-11 21:41:17 +01:00
if test x$with_zeroconf != xno; then
echo " Zeroconf support ..............$with_zeroconf"
else
echo " Zeroconf support ..............disabled"
fi
2004-03-24 00:20:21 +01:00
echo ""
echo "##########################################"
2004-03-17 19:13:29 +01:00
echo ""
echo "You are now ready to compile MPD"
echo "Type \"make\" to compile MPD"