mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2024-12-04 14:46:31 -05:00
#1398: Make optional components optional. (For real.)
git-svn-id: https://svn.xiph.org/trunk/ezstream@15782 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
parent
90d4a1a6a3
commit
df2b05bb61
@ -7,9 +7,8 @@ dist_doc_DATA = COPYING NEWS README
|
|||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
autogen.sh \
|
autogen.sh \
|
||||||
m4/ccflags.m4 m4/libogg.m4 m4/libshout.m4 m4/libvorbis.m4 \
|
m4/ccflags.m4 m4/libshout.m4 m4/libvorbis.m4 m4/libxml2.m4 \
|
||||||
m4/libxml2.m4 m4/progname.m4 m4/taglib.m4 m4/tree.m4 m4/vacopy.m4 \
|
m4/progname.m4 m4/taglib.m4 m4/tree.m4 m4/vacopy.m4 m4/vars.m4
|
||||||
m4/vars.m4
|
|
||||||
|
|
||||||
CLEANFILES = core *.core *~ .*~
|
CLEANFILES = core *.core *~ .*~
|
||||||
|
|
||||||
|
4
NEWS
4
NEWS
@ -11,6 +11,10 @@ Changes in 0.5.4, released on XXXX-XX-XX:
|
|||||||
- [MISC] Overhaul and modernize the build system. Ezstream is now expected
|
- [MISC] Overhaul and modernize the build system. Ezstream is now expected
|
||||||
to build "out of the box" on more systems without configuration
|
to build "out of the box" on more systems without configuration
|
||||||
tweaks.
|
tweaks.
|
||||||
|
- [FIX] Adjust the build system to better handle optional dependencies.
|
||||||
|
It is now possible to choose between TagLib and libvorbis for
|
||||||
|
reading Ogg Vorbis metadata, or no Vorbis metadata support at
|
||||||
|
all. (Ticket #1398)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
39
README
39
README
@ -31,17 +31,23 @@ PREREQUISITES
|
|||||||
|
|
||||||
|
|
||||||
Ezstream depends on:
|
Ezstream depends on:
|
||||||
* libshout 2.2.x (http://www.icecast.org/)
|
* libshout 2.2.x
|
||||||
* libshout dependencies, such as libogg, libvorbis, libtheora, etc.
|
(http://www.icecast.org/)
|
||||||
(http://www.vorbis.com/ and http://www.theora.org/)
|
|
||||||
* libxml 2.x (http://xmlsoft.org/)
|
* libxml 2.x (http://xmlsoft.org/)
|
||||||
|
|
||||||
Ezstream optionally uses:
|
Ezstream optionally uses:
|
||||||
* TagLib 1.x (1.4 or newer recommended, will be used via the libtag_c
|
- For reading metadata from Ogg Vorbis files:
|
||||||
wrapper)
|
* TagLib 1.x (1.4 or newer recommended, will be used via the libtag_c
|
||||||
(http://developer.kde.org/~wheeler/taglib.html)
|
wrapper)
|
||||||
* Libiconv, if iconv() is not available in the system libc.
|
(http://developer.kde.org/~wheeler/taglib.html)
|
||||||
(http://www.gnu.org/software/libiconv/)
|
OR:
|
||||||
|
* libvorbis 1.x
|
||||||
|
(http://www.vorbis.com)
|
||||||
|
Using TagLib is recommended, as it allows ezstream to read metadata from
|
||||||
|
many additional media file types.
|
||||||
|
- For basic non-ASCII charset support in metadata and filenames:
|
||||||
|
* Libiconv, if iconv() is not available in the system libc.
|
||||||
|
(http://www.gnu.org/software/libiconv/)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -57,19 +63,22 @@ configure script, a couple of additional options are available:
|
|||||||
example configuration files installation directory
|
example configuration files installation directory
|
||||||
(default: DATADIR/examples/ezstream)
|
(default: DATADIR/examples/ezstream)
|
||||||
--enable-debug enable memory debugging (default: no)
|
--enable-debug enable memory debugging (default: no)
|
||||||
|
--with-libvorbis=PFX prefix where the Vorbis library header files and
|
||||||
|
library are installed (default: autodetect)
|
||||||
|
--with-libvorbis-includes=DIR
|
||||||
|
directory where Vorbis library header files are
|
||||||
|
installed (optional)
|
||||||
|
--with-libvorbis-libs=DIR
|
||||||
|
directory where the Vorbis libraries are installed
|
||||||
|
(optional)
|
||||||
--with-taglib=PFX prefix where the TagLib header files and library are
|
--with-taglib=PFX prefix where the TagLib header files and library are
|
||||||
installed (default: autodetect
|
installed (default: autodetect)
|
||||||
--with-taglib-includes=DIR
|
--with-taglib-includes=DIR
|
||||||
directory where TagLib header files are installed
|
directory where TagLib header files are installed
|
||||||
(optional)
|
(optional)
|
||||||
--with-taglib-libs=DIR directory where TagLib is installed (optional)
|
--with-taglib-libs=DIR directory where TagLib is installed (optional)
|
||||||
--with-gnu-ld assume the C compiler uses GNU ld default=no
|
|
||||||
--with-libiconv-prefix[=DIR]
|
|
||||||
search for libiconv in DIR/include and DIR/lib
|
|
||||||
--without-libiconv-prefix
|
|
||||||
don't search for libiconv in includedir and libdir
|
|
||||||
|
|
||||||
The compilation and installation process boils down to the usual
|
The compilation and installation process then boils down to the usual
|
||||||
|
|
||||||
$ ./configure --help | less # Skim over the available options
|
$ ./configure --help | less # Skim over the available options
|
||||||
$ ./configure [options] && make && [sudo] make install
|
$ ./configure [options] && make && [sudo] make install
|
||||||
|
42
configure.in
42
configure.in
@ -129,26 +129,8 @@ dnl ###############
|
|||||||
AC_CHECK_LIB([gen], [basename],
|
AC_CHECK_LIB([gen], [basename],
|
||||||
[ AX_UNIQVAR_PREPEND([EZ_LIBS], [-lgen]) ])
|
[ AX_UNIQVAR_PREPEND([EZ_LIBS], [-lgen]) ])
|
||||||
|
|
||||||
AX_CHECK_LIBOGG([], [],
|
|
||||||
[AC_MSG_ERROR([libogg is required.], [1])])
|
|
||||||
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${LIBOGG_CPPFLAGS}])
|
|
||||||
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${LIBOGG_CFLAGS}])
|
|
||||||
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${LIBOGG_LDFLAGS}])
|
|
||||||
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBOGG_LIBS}])
|
|
||||||
|
|
||||||
AX_CHECK_LIBVORBIS([], [],
|
|
||||||
[AC_MSG_ERROR([libvorbis is required.], [1])])
|
|
||||||
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${VORBIS_CPPFLAGS}])
|
|
||||||
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${VORBIS_CFLAGS}])
|
|
||||||
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${VORBIS_LDFLAGS}])
|
|
||||||
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBVORBIS_LIBS}])
|
|
||||||
|
|
||||||
AX_CHECK_LIBVORBISFILE([], [],
|
|
||||||
[AC_MSG_ERROR([libvorbisfile is required.], [1])])
|
|
||||||
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBVORBISFILE_LIBS}])
|
|
||||||
|
|
||||||
AX_CHECK_LIBSHOUT([], [],
|
AX_CHECK_LIBSHOUT([], [],
|
||||||
[AC_MSG_ERROR([libshout is required.], [1])])
|
[AC_MSG_ERROR([libshout 2.2.x is required.], [1])])
|
||||||
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${LIBSHOUT_CPPFLAGS}])
|
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${LIBSHOUT_CPPFLAGS}])
|
||||||
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${LIBSHOUT_CFLAGS}])
|
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${LIBSHOUT_CFLAGS}])
|
||||||
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${LIBSHOUT_LDFLAGS}])
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${LIBSHOUT_LDFLAGS}])
|
||||||
@ -161,7 +143,7 @@ AX_UNIQVAR_APPEND([EZ_CFLAGS], [${LIBXML2_CFLAGS}])
|
|||||||
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${LIBXML2_LDFLAGS}])
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${LIBXML2_LDFLAGS}])
|
||||||
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBXML2_LIBS}])
|
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBXML2_LIBS}])
|
||||||
|
|
||||||
use_taglib="No"
|
use_metadata="No"
|
||||||
AX_CHECK_TAGLIB_C([], [
|
AX_CHECK_TAGLIB_C([], [
|
||||||
AC_DEFINE([HAVE_TAGLIB], [1],
|
AC_DEFINE([HAVE_TAGLIB], [1],
|
||||||
[Define to 1 if you have the libtag_c library.]
|
[Define to 1 if you have the libtag_c library.]
|
||||||
@ -170,8 +152,18 @@ AX_CHECK_TAGLIB_C([], [
|
|||||||
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${TAGLIB_CPPFLAGS}])
|
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${TAGLIB_CPPFLAGS}])
|
||||||
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${TAGLIB_LDFLAGS}])
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${TAGLIB_LDFLAGS}])
|
||||||
AX_UNIQVAR_PREPEND([EZ_LIBS], [${TAGLIB_C_LIBS}])
|
AX_UNIQVAR_PREPEND([EZ_LIBS], [${TAGLIB_C_LIBS}])
|
||||||
use_taglib="Yes"
|
use_metadata="TagLib"
|
||||||
], [])
|
], [
|
||||||
|
AX_CHECK_LIBVORBISFILE([], [
|
||||||
|
AC_DEFINE([HAVE_VORBISFILE], [1],
|
||||||
|
[Define to 1 if you have the libvorbisfile library.])
|
||||||
|
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${VORBIS_CPPFLAGS}])
|
||||||
|
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${VORBIS_CFLAGS}])
|
||||||
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${VORBIS_LDFLAGS}])
|
||||||
|
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBVORBISFILE_LIBS}])
|
||||||
|
use_metadata="libvorbis"
|
||||||
|
], [])
|
||||||
|
])
|
||||||
|
|
||||||
# Not using AM_ICONV to check for iconv(), with or without libiconv(),
|
# Not using AM_ICONV to check for iconv(), with or without libiconv(),
|
||||||
# is not a viable option. Something in the past went horribly wrong;
|
# is not a viable option. Something in the past went horribly wrong;
|
||||||
@ -293,8 +285,8 @@ cat << __EOT
|
|||||||
${PACKAGE_STRING} has been configured successfully.
|
${PACKAGE_STRING} has been configured successfully.
|
||||||
|
|
||||||
Configuration:
|
Configuration:
|
||||||
TagLib support ............... : ${use_taglib}
|
Ogg Vorbis metadata support ... : ${use_metadata}
|
||||||
Charset conversion support ... : ${use_iconv}
|
Charset conversion support .... : ${use_iconv}
|
||||||
Prefix ....................... : ${prefix}
|
Prefix ........................ : ${prefix}
|
||||||
|
|
||||||
__EOT
|
__EOT
|
||||||
|
103
m4/libvorbis.m4
103
m4/libvorbis.m4
@ -48,22 +48,95 @@ AC_ARG_VAR([VORBIS_CPPFLAGS],
|
|||||||
AC_ARG_VAR([VORBIS_LDFLAGS],
|
AC_ARG_VAR([VORBIS_LDFLAGS],
|
||||||
[linker flags for the Vorbis libraries])
|
[linker flags for the Vorbis libraries])
|
||||||
if test x"${prefix}" = "xNONE"; then
|
if test x"${prefix}" = "xNONE"; then
|
||||||
ax_check_libvorbis_prefix="/usr/local"
|
have_libvorbis_prefix="/usr/local"
|
||||||
else
|
else
|
||||||
ax_check_libvorbis_prefix="${prefix}"
|
have_libvorbis_prefix="${prefix}"
|
||||||
fi
|
fi
|
||||||
|
have_libvorbis_includes=""
|
||||||
|
have_libvorbis_libs=""
|
||||||
|
want_libvorbis="auto"
|
||||||
|
AC_ARG_WITH([libvorbis],
|
||||||
|
[AS_HELP_STRING([--with-libvorbis=PFX],
|
||||||
|
[prefix where the Vorbis library header files and library are installed (default: autodetect)])],
|
||||||
|
[
|
||||||
|
case "${withval}" in
|
||||||
|
yes)
|
||||||
|
want_libvorbis="yes"
|
||||||
|
;;
|
||||||
|
no)
|
||||||
|
want_libvorbis="no"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
have_libvorbis_prefix="${withval}"
|
||||||
|
want_libvorbis="yes"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
]
|
||||||
|
)
|
||||||
|
AC_ARG_WITH([libvorbis-includes],
|
||||||
|
[AS_HELP_STRING([--with-libvorbis-includes=DIR],
|
||||||
|
[directory where Vorbis library header files are installed (optional)]) ],
|
||||||
|
[
|
||||||
|
case "${withval}" in
|
||||||
|
yes|no) ;;
|
||||||
|
*)
|
||||||
|
have_libvorbis_includes="${withval}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
]
|
||||||
|
)
|
||||||
|
AC_ARG_WITH([libvorbis-libs],
|
||||||
|
[AS_HELP_STRING([--with-libvorbis-libs=DIR],
|
||||||
|
[directory where the Vorbis libraries are installed (optional)]) ],
|
||||||
|
[
|
||||||
|
case "${withval}" in
|
||||||
|
yes|no) ;;
|
||||||
|
*)
|
||||||
|
have_libvorbis_libs="${withval}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
]
|
||||||
|
)
|
||||||
|
AC_CACHE_VAL([local_cv_have_lib_libvorbis_opts],
|
||||||
|
[
|
||||||
if test -z "${VORBIS_CFLAGS}"; then
|
if test -z "${VORBIS_CFLAGS}"; then
|
||||||
VORBIS_CFLAGS="`${PKG_CONFIG} --cflags-only-other vorbis`"
|
VORBIS_CFLAGS="`${PKG_CONFIG} --cflags-only-other vorbis`"
|
||||||
fi
|
fi
|
||||||
if test -z "${VORBIS_CPPFLAGS}"; then
|
if test -n "${VORBIS_CPPFLAGS}"; then
|
||||||
VORBIS_CPPFLAGS="`${PKG_CONFIG} --cflags-only-I vorbis`"
|
if test x"${have_libvorbis_includes}" != "x"; then
|
||||||
|
VORBIS_CPPFLAGS="${VORBIS_CPPFLAGS} -I${have_libvorbis_includes}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if test x"${have_libvorbis_includes}" != "x"; then
|
||||||
|
VORBIS_CPPFLAGS="-I${have_libvorbis_includes}"
|
||||||
|
else
|
||||||
|
if test x"${want_libvorbis}" = "xauto"; then
|
||||||
|
VORBIS_CPPFLAGS="`${PKG_CONFIG} --cflags-only-I vorbis`"
|
||||||
|
else
|
||||||
|
VORBIS_CPPFLAGS="-I${have_libvorbis_prefix}/include"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if test -z "${VORBIS_LDFLAGS}"; then
|
if test -n "${VORBIS_LDFLAGS}"; then
|
||||||
VORBIS_LDFLAGS="\
|
if test x"${have_libvorbis_libs}" != "x"; then
|
||||||
`${PKG_CONFIG} --libs-only-L vorbis` \
|
VORBIS_LDFLAGS="-L${have_libvorbis_libs} ${VORBIS_LDFLAGS}"
|
||||||
`${PKG_CONFIG} --libs-only-other vorbis` \
|
fi
|
||||||
"
|
else
|
||||||
|
if test -n "${have_libvorbis_libs}"; then
|
||||||
|
VORBIS_LDFLAGS="-L${have_libvorbis_libs}"
|
||||||
|
else
|
||||||
|
if test x"${want_libvorbis}" = "xauto"; then
|
||||||
|
VORBIS_LDFLAGS=" \
|
||||||
|
`${PKG_CONFIG} --libs-only-L vorbis` \
|
||||||
|
`${PKG_CONFIG} --libs-only-other vorbis` \
|
||||||
|
"
|
||||||
|
else
|
||||||
|
VORBIS_LDFLAGS="-L${have_libvorbis_prefix}/lib"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
local_cv_have_lib_libvorbis_opts=yes
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([AX_CHECK_LIBVORBIS],
|
AC_DEFUN([AX_CHECK_LIBVORBIS],
|
||||||
@ -84,12 +157,12 @@ dnl ####### BEGIN CHECK ######
|
|||||||
PKG_CHECK_EXISTS([vorbis $1], [
|
PKG_CHECK_EXISTS([vorbis $1], [
|
||||||
dnl ##########################
|
dnl ##########################
|
||||||
|
|
||||||
|
if test x"${want_libvorbis}" != "xno"; then # want_libvorbis != no
|
||||||
libvorbis_libs_autodetect=no
|
libvorbis_libs_autodetect=no
|
||||||
if test -z "${LIBVORBIS_LIBS}"; then
|
if test -z "${LIBVORBIS_LIBS}"; then
|
||||||
LIBVORBIS_LIBS="`${PKG_CONFIG} --libs-only-l vorbis`"
|
LIBVORBIS_LIBS="`${PKG_CONFIG} --libs-only-l vorbis`"
|
||||||
libvorbis_libs_autodetect=yes
|
libvorbis_libs_autodetect=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ax_check_libvorbis_save_CFLAGS="${CFLAGS}"
|
ax_check_libvorbis_save_CFLAGS="${CFLAGS}"
|
||||||
ax_check_libvorbis_save_CPPFLAGS="${CPPFLAGS}"
|
ax_check_libvorbis_save_CPPFLAGS="${CPPFLAGS}"
|
||||||
ax_check_libvorbis_save_LDFLAGS="${LDFLAGS}"
|
ax_check_libvorbis_save_LDFLAGS="${LDFLAGS}"
|
||||||
@ -137,13 +210,13 @@ CPPFLAGS="${ax_check_libvorbis_save_CPPFLAGS}"
|
|||||||
LDFLAGS="${ax_check_libvorbis_save_LDFLAGS}"
|
LDFLAGS="${ax_check_libvorbis_save_LDFLAGS}"
|
||||||
LIBS="${ax_check_libvorbis_save_LIBS}"
|
LIBS="${ax_check_libvorbis_save_LIBS}"
|
||||||
AC_LANG_POP([C])
|
AC_LANG_POP([C])
|
||||||
|
fi # want_libvorbis != no
|
||||||
|
|
||||||
dnl ####### END CHECK ########
|
dnl ####### END CHECK ########
|
||||||
], [])
|
], [])
|
||||||
dnl ##########################
|
dnl ##########################
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([for libvorbis $1])
|
AC_MSG_CHECKING([for libvorbis $1])
|
||||||
if test x"${local_cv_have_lib_libvorbis}" = "xyes"; then
|
if test x"${local_cv_have_lib_libvorbis}" = "xyes"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@ -175,12 +248,12 @@ dnl ####### BEGIN CHECK ######
|
|||||||
PKG_CHECK_EXISTS([vorbisfile $1], [
|
PKG_CHECK_EXISTS([vorbisfile $1], [
|
||||||
dnl ##########################
|
dnl ##########################
|
||||||
|
|
||||||
|
if test x"${want_libvorbis}" != "xno"; then # want_libvorbis != no
|
||||||
libvorbisfile_libs_autodetect=no
|
libvorbisfile_libs_autodetect=no
|
||||||
if test -z "${LIBVORBISFILE_LIBS}"; then
|
if test -z "${LIBVORBISFILE_LIBS}"; then
|
||||||
LIBVORBISFILE_LIBS="`${PKG_CONFIG} --libs-only-l vorbisfile`"
|
LIBVORBISFILE_LIBS="`${PKG_CONFIG} --libs-only-l vorbisfile`"
|
||||||
libvorbisfile_libs_autodetect=yes
|
libvorbisfile_libs_autodetect=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ax_check_libvorbisfile_save_CFLAGS="${CFLAGS}"
|
ax_check_libvorbisfile_save_CFLAGS="${CFLAGS}"
|
||||||
ax_check_libvorbisfile_save_CPPFLAGS="${CPPFLAGS}"
|
ax_check_libvorbisfile_save_CPPFLAGS="${CPPFLAGS}"
|
||||||
ax_check_libvorbisfile_save_LDFLAGS="${LDFLAGS}"
|
ax_check_libvorbisfile_save_LDFLAGS="${LDFLAGS}"
|
||||||
@ -217,13 +290,13 @@ CPPFLAGS="${ax_check_libvorbisfile_save_CPPFLAGS}"
|
|||||||
LDFLAGS="${ax_check_libvorbisfile_save_LDFLAGS}"
|
LDFLAGS="${ax_check_libvorbisfile_save_LDFLAGS}"
|
||||||
LIBS="${ax_check_libvorbisfile_save_LIBS}"
|
LIBS="${ax_check_libvorbisfile_save_LIBS}"
|
||||||
AC_LANG_POP([C])
|
AC_LANG_POP([C])
|
||||||
|
fi # want_libvorbis != no
|
||||||
|
|
||||||
dnl ####### END CHECK ########
|
dnl ####### END CHECK ########
|
||||||
], [])
|
], [])
|
||||||
dnl ##########################
|
dnl ##########################
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([for libvorbisfile $1])
|
AC_MSG_CHECKING([for libvorbisfile $1])
|
||||||
if test x"${local_cv_have_lib_libvorbisfile}" = "xyes"; then
|
if test x"${local_cv_have_lib_libvorbisfile}" = "xyes"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
@ -255,12 +328,12 @@ dnl ####### BEGIN CHECK ######
|
|||||||
PKG_CHECK_EXISTS([vorbisenc $1], [
|
PKG_CHECK_EXISTS([vorbisenc $1], [
|
||||||
dnl ##########################
|
dnl ##########################
|
||||||
|
|
||||||
|
if test x"${want_libvorbis}" != "xno"; then # want_libvorbis != no
|
||||||
libvorbisenc_libs_autodetect=no
|
libvorbisenc_libs_autodetect=no
|
||||||
if test -z "${LIBVORBISENC_LIBS}"; then
|
if test -z "${LIBVORBISENC_LIBS}"; then
|
||||||
LIBVORBISENC_LIBS="`${PKG_CONFIG} --libs-only-l vorbisenc`"
|
LIBVORBISENC_LIBS="`${PKG_CONFIG} --libs-only-l vorbisenc`"
|
||||||
libvorbisenc_libs_autodetect=yes
|
libvorbisenc_libs_autodetect=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ax_check_libvorbisenc_save_CFLAGS="${CFLAGS}"
|
ax_check_libvorbisenc_save_CFLAGS="${CFLAGS}"
|
||||||
ax_check_libvorbisenc_save_CPPFLAGS="${CPPFLAGS}"
|
ax_check_libvorbisenc_save_CPPFLAGS="${CPPFLAGS}"
|
||||||
ax_check_libvorbisenc_save_LDFLAGS="${LDFLAGS}"
|
ax_check_libvorbisenc_save_LDFLAGS="${LDFLAGS}"
|
||||||
@ -299,13 +372,13 @@ CPPFLAGS="${ax_check_libvorbisenc_save_CPPFLAGS}"
|
|||||||
LDFLAGS="${ax_check_libvorbisenc_save_LDFLAGS}"
|
LDFLAGS="${ax_check_libvorbisenc_save_LDFLAGS}"
|
||||||
LIBS="${ax_check_libvorbisenc_save_LIBS}"
|
LIBS="${ax_check_libvorbisenc_save_LIBS}"
|
||||||
AC_LANG_POP([C])
|
AC_LANG_POP([C])
|
||||||
|
fi # want_libvorbis != no
|
||||||
|
|
||||||
dnl ####### END CHECK ########
|
dnl ####### END CHECK ########
|
||||||
], [])
|
], [])
|
||||||
dnl ##########################
|
dnl ##########################
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([for libvorbisenc $1])
|
AC_MSG_CHECKING([for libvorbisenc $1])
|
||||||
if test x"${local_cv_have_lib_libvorbisenc}" = "xyes"; then
|
if test x"${local_cv_have_lib_libvorbisenc}" = "xyes"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
|
@ -34,6 +34,7 @@ dnl # [ACTION-IF-NOT-FOUND])
|
|||||||
|
|
||||||
AC_DEFUN([_AX_CHECK_TAGLIB_OPTS],
|
AC_DEFUN([_AX_CHECK_TAGLIB_OPTS],
|
||||||
[
|
[
|
||||||
|
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||||
AC_ARG_VAR([TAGLIB_CFLAGS],
|
AC_ARG_VAR([TAGLIB_CFLAGS],
|
||||||
[C compiler flags for TagLib])
|
[C compiler flags for TagLib])
|
||||||
AC_ARG_VAR([TAGLIB_CPPFLAGS],
|
AC_ARG_VAR([TAGLIB_CPPFLAGS],
|
||||||
@ -50,7 +51,7 @@ have_taglib_libs=""
|
|||||||
want_taglib="auto"
|
want_taglib="auto"
|
||||||
AC_ARG_WITH([taglib],
|
AC_ARG_WITH([taglib],
|
||||||
[AS_HELP_STRING([--with-taglib=PFX],
|
[AS_HELP_STRING([--with-taglib=PFX],
|
||||||
[prefix where the TagLib header files and library are installed (default: autodetect]) ],
|
[prefix where the TagLib header files and library are installed (default: autodetect)])],
|
||||||
[
|
[
|
||||||
case "${withval}" in
|
case "${withval}" in
|
||||||
yes)
|
yes)
|
||||||
@ -134,7 +135,6 @@ local_cv_have_lib_taglib_opts=yes
|
|||||||
|
|
||||||
AC_DEFUN([AX_CHECK_TAGLIB],
|
AC_DEFUN([AX_CHECK_TAGLIB],
|
||||||
[
|
[
|
||||||
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
||||||
AC_REQUIRE([_AX_CHECK_TAGLIB_OPTS])
|
AC_REQUIRE([_AX_CHECK_TAGLIB_OPTS])
|
||||||
AC_ARG_VAR([TAGLIB_LIBS],
|
AC_ARG_VAR([TAGLIB_LIBS],
|
||||||
[libraries to use for TagLib])
|
[libraries to use for TagLib])
|
||||||
@ -232,7 +232,6 @@ fi
|
|||||||
|
|
||||||
AC_DEFUN([AX_CHECK_TAGLIB_C],
|
AC_DEFUN([AX_CHECK_TAGLIB_C],
|
||||||
[
|
[
|
||||||
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
||||||
AC_REQUIRE([_AX_CHECK_TAGLIB_OPTS])
|
AC_REQUIRE([_AX_CHECK_TAGLIB_OPTS])
|
||||||
AC_ARG_VAR([TAGLIB_C_LIBS],
|
AC_ARG_VAR([TAGLIB_C_LIBS],
|
||||||
[libraries to use for the TagLib C wrapper])
|
[libraries to use for the TagLib C wrapper])
|
||||||
|
@ -35,8 +35,10 @@
|
|||||||
|
|
||||||
#ifdef HAVE_TAGLIB
|
#ifdef HAVE_TAGLIB
|
||||||
# include <taglib/tag_c.h>
|
# include <taglib/tag_c.h>
|
||||||
#endif
|
#endif /* HAVE_TAGLIB */
|
||||||
#include <vorbis/vorbisfile.h>
|
#ifdef HAVE_VORBISFILE
|
||||||
|
# include <vorbis/vorbisfile.h>
|
||||||
|
#endif /* HAVE_VORBISFILE */
|
||||||
#include <shout/shout.h>
|
#include <shout/shout.h>
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
@ -188,18 +190,19 @@ metadata_use_self(metadata_t *md, FILE **filep)
|
|||||||
if (strcmp(extension, ".mp3") == 0) {
|
if (strcmp(extension, ".mp3") == 0) {
|
||||||
memset(&id3tag, 0, sizeof(id3tag));
|
memset(&id3tag, 0, sizeof(id3tag));
|
||||||
fseek(*filep, -128L, SEEK_END);
|
fseek(*filep, -128L, SEEK_END);
|
||||||
fread(&id3tag, 1, sizeof(struct ID3Tag), *filep);
|
fread(&id3tag, 1UL, sizeof(struct ID3Tag), *filep);
|
||||||
if (memcmp(id3tag.tag, "TAG", 3) == 0) {
|
if (memcmp(id3tag.tag, "TAG", 3UL) == 0) {
|
||||||
if (strlen(id3tag.artistName) > 0)
|
if (strlen(id3tag.artistName) > 0)
|
||||||
md->artist = CHARtoUTF8(id3tag.artistName, ICONV_REPLACE);
|
md->artist = CHARtoUTF8(id3tag.artistName, ICONV_REPLACE);
|
||||||
if (strlen(id3tag.trackName) > 0)
|
if (strlen(id3tag.trackName) > 0)
|
||||||
md->title = CHARtoUTF8(id3tag.trackName, ICONV_REPLACE);
|
md->title = CHARtoUTF8(id3tag.trackName, ICONV_REPLACE);
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_VORBISFILE
|
||||||
} else if (strcmp(extension, ".ogg") == 0) {
|
} else if (strcmp(extension, ".ogg") == 0) {
|
||||||
OggVorbis_File vf;
|
OggVorbis_File vf;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = ov_open(*filep, &vf, NULL, 0)) != 0) {
|
if ((ret = ov_open(*filep, &vf, NULL, 0L)) != 0) {
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case OV_EREAD:
|
case OV_EREAD:
|
||||||
printf("%s: ov_open(): %s: Media read error\n",
|
printf("%s: ov_open(): %s: Media read error\n",
|
||||||
@ -245,6 +248,7 @@ metadata_use_self(metadata_t *md, FILE **filep)
|
|||||||
ov_clear(&vf);
|
ov_clear(&vf);
|
||||||
*filep = NULL;
|
*filep = NULL;
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_VORBISFILE */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*filep != NULL)
|
if (*filep != NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user