configure.ac: add macro MPD_ENABLE_AUTO_LIB

This commit is contained in:
Max Kellermann 2014-12-09 21:07:05 +01:00
parent 8583689fa4
commit 0f0245625a
6 changed files with 24 additions and 51 deletions

View File

@ -738,7 +738,7 @@ ARCHIVE_LIBS = \
$(ISO9660_LIBS) \
$(ZZIP_LIBS)
if HAVE_BZ2
if ENABLE_BZ2
libarchive_a_SOURCES += \
src/archive/plugins/Bzip2ArchivePlugin.cxx \
src/archive/plugins/Bzip2ArchivePlugin.hxx
@ -889,7 +889,7 @@ libdecoder_a_SOURCES += \
src/decoder/plugins/Mpg123DecoderPlugin.hxx
endif
if HAVE_MPCDEC
if ENABLE_MPCDEC
libdecoder_a_SOURCES += \
src/decoder/plugins/MpcdecDecoderPlugin.cxx \
src/decoder/plugins/MpcdecDecoderPlugin.hxx
@ -1068,7 +1068,7 @@ libencoder_plugins_a_SOURCES += \
src/encoder/plugins/OpusEncoderPlugin.hxx
endif
if ENABLE_LAME_ENCODER
if ENABLE_LAME
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/LameEncoderPlugin.cxx \
src/encoder/plugins/LameEncoderPlugin.hxx

View File

@ -295,11 +295,6 @@ else
database_auto=no
fi
AC_ARG_ENABLE(bzip2,
AS_HELP_STRING([--enable-bzip2],
[enable bzip2 archive support (default: auto)]),,
enable_bzip2=auto)
default_enable_daemon=yes
if test x$host_is_android = xyes || test x$host_is_android = xyes; then
default_enable_daemon=no
@ -360,11 +355,6 @@ AC_ARG_ENABLE(soundcloud,
[enable support for soundcloud.com]),,
[enable_soundcloud=auto])
AC_ARG_ENABLE(lame-encoder,
AS_HELP_STRING([--enable-lame-encoder],
[enable the LAME mp3 encoder]),,
enable_lame_encoder=auto)
AC_ARG_ENABLE([libwrap],
AS_HELP_STRING([--enable-libwrap], [use libwrap]),,
[enable_libwrap=auto])
@ -374,11 +364,6 @@ AC_ARG_ENABLE(mikmod,
[enable the mikmod decoder (default: disable)]),,
enable_mikmod=no)
AC_ARG_ENABLE(mpc,
AS_HELP_STRING([--enable-mpc],
[disable musepack (MPC) support (default: auto)]),,
enable_mpc=auto)
AC_ARG_ENABLE(openal,
AS_HELP_STRING([--enable-openal],
[enable OpenAL support (default: auto)]),,
@ -449,11 +434,6 @@ AC_ARG_ENABLE(werror,
[treat warnings as errors (default: disabled)]),,
enable_werror=no)
AC_ARG_ENABLE(wildmidi,
AS_HELP_STRING([--enable-wildmidi],
[enable MIDI support via wildmidi (default: auto)]),,
enable_wildmidi=auto)
AC_ARG_WITH(zeroconf,
AS_HELP_STRING([--with-zeroconf=@<:@auto|avahi|bonjour|no@:>@],
[enable zeroconf backend (default=auto)]),,
@ -823,13 +803,10 @@ MPD_ENABLE_AUTO_PKG(zlib, ZLIB, [zlib],
dnl ---------------------------------- libbz2 ---------------------------------
MPD_AUTO_LIB(bzip2, BZ2, bz2, BZ2_bzDecompressInit, [-lbz2], [],
[bzip2], [libbz2 not found])
MPD_ENABLE_AUTO_LIB(bzip2, BZ2, bz2, BZ2_bzDecompressInit, [-lbz2], [],
[bzip2 archive plugin], [libbz2 not found])
AM_CONDITIONAL(HAVE_BZ2, test x$enable_bzip2 = xyes)
if test x$enable_bzip2 = xyes; then
AC_DEFINE(HAVE_BZ2, 1, [Define to have bz2 archive support])
AC_PATH_PROG(BZIP2, bzip2, no)
else
BZIP2="no"
@ -973,12 +950,8 @@ MPD_ENABLE_AUTO_PKG(sndfile, SNDFILE, [sndfile],
dnl --------------------------------- musepack --------------------------------
MPD_AUTO_LIB(mpc, MPCDEC, mpcdec, mpc_demux_init, [-lmpcdec], [],
[mpcdec], [libmpcdec not found])
if test x$enable_mpc = xyes; then
AC_DEFINE(HAVE_MPCDEC, 1, [Define to use libmpcdec for MPC decoding])
fi
AM_CONDITIONAL(HAVE_MPCDEC, test x$enable_mpc = xyes)
MPD_ENABLE_AUTO_LIB(mpc, MPCDEC, mpcdec, mpc_demux_init, [-lmpcdec], [],
[Musepack decoder plugin], [libmpcdec not found])
dnl -------------------------------- Ogg Tremor -------------------------------
@ -1080,13 +1053,8 @@ MPD_ENABLE_AUTO_PKG(wavpack, WAVPACK, [wavpack],
[WavPack decoder plugin], [libwavpack not found])
dnl --------------------------------- WildMidi --------------------------------
MPD_AUTO_LIB(wildmidi, WILDMIDI, WildMidi, WildMidi_Init, [-lWildMidi], [],
[wildmidi], [libwildmidi not found])
if test x$enable_wildmidi = xyes; then
AC_DEFINE(ENABLE_WILDMIDI, 1, [Define for wildmidi support])
fi
AM_CONDITIONAL(ENABLE_WILDMIDI, test x$enable_wildmidi = xyes)
MPD_ENABLE_AUTO_LIB(wildmidi, WILDMIDI, WildMidi, WildMidi_Init, [-lWildMidi], [],
[WildMidi decoder plugin], [libwildmidi not found])
dnl ------------------------ Post Decoder Plugins Tests -----------------------
@ -1138,13 +1106,8 @@ MPD_ENABLE_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc vorbis ogg],
dnl ------------------------------- LAME Encoder ------------------------------
MPD_AUTO_LIB(lame_encoder, LAME, mp3lame, lame_init, [-lmp3lame], [],
[libmp3lame], [libmp3lame not found])
if test x$enable_lame_encoder = xyes; then
AC_DEFINE(ENABLE_LAME_ENCODER, 1,
[Define to enable the lame encoder plugin])
fi
AM_CONDITIONAL(ENABLE_LAME_ENCODER, test x$enable_lame_encoder = xyes)
MPD_ENABLE_AUTO_LIB(lame_encoder, LAME, mp3lame, lame_init, [-lmp3lame], [],
[LAME encoder plugin], [libmp3lame not found])
dnl ----------------------------- TwoLAME Encoder -----------------------------
MPD_ENABLE_AUTO_PKG(twolame_encoder, TWOLAME, [twolame],

View File

@ -120,6 +120,16 @@ AC_DEFUN([MPD_ENABLE_AUTO_PKG_LIB], [
])
])
dnl Wrapper for AC_ARG_ENABLE and MPD_AUTO_LIB
dnl
dnl Parameters: varname1, varname2, libname, symname, libs, cflags, description, errmsg, default, pre
AC_DEFUN([MPD_ENABLE_AUTO_LIB], [
MPD_ARG_ENABLE([$1], [$2], [$7], [$9], [
$10
MPD_AUTO_LIB($1, $2, $3, $4, $5, $6, $7, $8)
])
])
dnl Wrapper for MPD_ENABLE_AUTO_PKG and MPD_DEPENDS
dnl
dnl Parameters: varname1, varname2, pkg, description, errmsg, default, dep_variable, dep_errmsg

View File

@ -29,7 +29,7 @@
#include <string.h>
const ArchivePlugin *const archive_plugins[] = {
#ifdef HAVE_BZ2
#ifdef ENABLE_BZ2
&bz2_archive_plugin,
#endif
#ifdef ENABLE_ZZIP

View File

@ -77,7 +77,7 @@ const struct DecoderPlugin *const decoder_plugins[] = {
#ifdef HAVE_FAAD
&faad_decoder_plugin,
#endif
#ifdef HAVE_MPCDEC
#ifdef ENABLE_MPCDEC
&mpcdec_decoder_plugin,
#endif
#ifdef ENABLE_WAVPACK

View File

@ -39,7 +39,7 @@ const EncoderPlugin *const encoder_plugins[] = {
#ifdef ENABLE_OPUS
&opus_encoder_plugin,
#endif
#ifdef ENABLE_LAME_ENCODER
#ifdef ENABLE_LAME
&lame_encoder_plugin,
#endif
#ifdef ENABLE_TWOLAME