aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-09 21:07:05 +0100
committerMax Kellermann <max@duempel.org>2014-12-09 21:19:09 +0100
commit0f0245625af906cee3f96ec139c6e1e3f580aa05 (patch)
tree29997d838407fe7d3027ee5c16d1ab10e1dbaaf6
parent8583689fa4623431472c49f34c6f8ac2710cacc8 (diff)
downloadmpd-0f0245625af906cee3f96ec139c6e1e3f580aa05.tar.gz
mpd-0f0245625af906cee3f96ec139c6e1e3f580aa05.tar.xz
mpd-0f0245625af906cee3f96ec139c6e1e3f580aa05.zip
configure.ac: add macro MPD_ENABLE_AUTO_LIB
Diffstat (limited to '')
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac53
-rw-r--r--m4/mpd_auto.m410
-rw-r--r--src/archive/ArchiveList.cxx2
-rw-r--r--src/decoder/DecoderList.cxx2
-rw-r--r--src/encoder/EncoderList.cxx2
6 files changed, 24 insertions, 51 deletions
diff --git a/Makefile.am b/Makefile.am
index 3cded98ca..3d0723501 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
diff --git a/configure.ac b/configure.ac
index 370b69fec..f25ccddc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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],
diff --git a/m4/mpd_auto.m4 b/m4/mpd_auto.m4
index 60ede3124..791395fdc 100644
--- a/m4/mpd_auto.m4
+++ b/m4/mpd_auto.m4
@@ -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
diff --git a/src/archive/ArchiveList.cxx b/src/archive/ArchiveList.cxx
index 4a39ea8a5..089959c38 100644
--- a/src/archive/ArchiveList.cxx
+++ b/src/archive/ArchiveList.cxx
@@ -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
diff --git a/src/decoder/DecoderList.cxx b/src/decoder/DecoderList.cxx
index e9c9ba685..42d0a512a 100644
--- a/src/decoder/DecoderList.cxx
+++ b/src/decoder/DecoderList.cxx
@@ -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
diff --git a/src/encoder/EncoderList.cxx b/src/encoder/EncoderList.cxx
index f3e3ffa64..79c045328 100644
--- a/src/encoder/EncoderList.cxx
+++ b/src/encoder/EncoderList.cxx
@@ -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