configure.ac: add macro MPD_ENABLE_AUTO_PKG
Simplify the definition of many build options.
This commit is contained in:
@@ -32,7 +32,7 @@ const ArchivePlugin *const archive_plugins[] = {
|
||||
#ifdef HAVE_BZ2
|
||||
&bz2_archive_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_ZZIP
|
||||
#ifdef ENABLE_ZZIP
|
||||
&zzip_archive_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_ISO9660
|
||||
|
@@ -28,10 +28,10 @@
|
||||
|
||||
const DatabasePlugin *const database_plugins[] = {
|
||||
&simple_db_plugin,
|
||||
#ifdef HAVE_LIBMPDCLIENT
|
||||
#ifdef ENABLE_LIBMPDCLIENT
|
||||
&proxy_db_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_LIBUPNP
|
||||
#ifdef ENABLE_UPNP
|
||||
&upnp_db_plugin,
|
||||
#endif
|
||||
nullptr
|
||||
|
@@ -41,7 +41,7 @@
|
||||
#include "util/Domain.hxx"
|
||||
#include "Log.hxx"
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
#include "fs/io/GzipOutputStream.hxx"
|
||||
#endif
|
||||
|
||||
@@ -52,21 +52,21 @@ static constexpr Domain simple_db_domain("simple_db");
|
||||
inline SimpleDatabase::SimpleDatabase()
|
||||
:Database(simple_db_plugin),
|
||||
path(AllocatedPath::Null()),
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
compress(true),
|
||||
#endif
|
||||
cache_path(AllocatedPath::Null()),
|
||||
prefixed_light_song(nullptr) {}
|
||||
|
||||
inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path,
|
||||
#ifndef HAVE_ZLIB
|
||||
#ifndef ENABLE_ZLIB
|
||||
gcc_unused
|
||||
#endif
|
||||
bool _compress)
|
||||
:Database(simple_db_plugin),
|
||||
path(std::move(_path)),
|
||||
path_utf8(path.ToUTF8()),
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
compress(_compress),
|
||||
#endif
|
||||
cache_path(AllocatedPath::Null()),
|
||||
@@ -104,7 +104,7 @@ SimpleDatabase::Configure(const config_param ¶m, Error &error)
|
||||
if (path.IsNull() && error.IsDefined())
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
compress = param.GetBlockValue("compress", compress);
|
||||
#endif
|
||||
|
||||
@@ -389,7 +389,7 @@ SimpleDatabase::Save(Error &error)
|
||||
|
||||
OutputStream *os = &fos;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
GzipOutputStream *gzip = nullptr;
|
||||
if (compress) {
|
||||
gzip = new GzipOutputStream(*os, error);
|
||||
@@ -407,13 +407,13 @@ SimpleDatabase::Save(Error &error)
|
||||
db_save_internal(bos, *root);
|
||||
|
||||
if (!bos.Flush(error)) {
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
delete gzip;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
if (gzip != nullptr) {
|
||||
bool success = gzip->Flush(error);
|
||||
delete gzip;
|
||||
@@ -484,7 +484,7 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri,
|
||||
std::string name(storage_uri);
|
||||
std::replace_if(name.begin(), name.end(), IsUnsafeChar, '_');
|
||||
|
||||
#ifndef HAVE_ZLIB
|
||||
#ifndef ENABLE_ZLIB
|
||||
constexpr bool compress = false;
|
||||
#endif
|
||||
auto db = new SimpleDatabase(AllocatedPath::Build(cache_path,
|
||||
|
@@ -39,7 +39,7 @@ class SimpleDatabase : public Database {
|
||||
AllocatedPath path;
|
||||
std::string path_utf8;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
bool compress;
|
||||
#endif
|
||||
|
||||
|
@@ -52,7 +52,7 @@ const struct DecoderPlugin *const decoder_plugins[] = {
|
||||
#ifdef HAVE_MAD
|
||||
&mad_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_MPG123
|
||||
#ifdef ENABLE_MPG123
|
||||
&mpg123_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_MP4V2
|
||||
@@ -61,19 +61,17 @@ const struct DecoderPlugin *const decoder_plugins[] = {
|
||||
#ifdef ENABLE_VORBIS_DECODER
|
||||
&vorbis_decoder_plugin,
|
||||
#endif
|
||||
#if defined(HAVE_FLAC)
|
||||
#ifdef ENABLE_FLAC
|
||||
&oggflac_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_FLAC
|
||||
&flac_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_OPUS
|
||||
#ifdef ENABLE_OPUS
|
||||
&opus_decoder_plugin,
|
||||
#endif
|
||||
#ifdef ENABLE_SNDFILE
|
||||
&sndfile_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_AUDIOFILE
|
||||
#ifdef ENABLE_AUDIOFILE
|
||||
&audiofile_decoder_plugin,
|
||||
#endif
|
||||
#ifdef ENABLE_DSD
|
||||
@@ -86,10 +84,10 @@ const struct DecoderPlugin *const decoder_plugins[] = {
|
||||
#ifdef HAVE_MPCDEC
|
||||
&mpcdec_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_WAVPACK
|
||||
#ifdef ENABLE_WAVPACK
|
||||
&wavpack_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_MODPLUG
|
||||
#ifdef ENABLE_MODPLUG
|
||||
&modplug_decoder_plugin,
|
||||
#endif
|
||||
#ifdef ENABLE_MIKMOD_DECODER
|
||||
@@ -104,10 +102,10 @@ const struct DecoderPlugin *const decoder_plugins[] = {
|
||||
#ifdef ENABLE_FLUIDSYNTH
|
||||
&fluidsynth_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_ADPLUG
|
||||
#ifdef ENABLE_ADPLUG
|
||||
&adplug_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_FFMPEG
|
||||
#ifdef ENABLE_FFMPEG
|
||||
&ffmpeg_decoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_GME
|
||||
|
@@ -33,16 +33,16 @@
|
||||
|
||||
const EncoderPlugin *const encoder_plugins[] = {
|
||||
&null_encoder_plugin,
|
||||
#ifdef ENABLE_VORBIS_ENCODER
|
||||
#ifdef ENABLE_VORBISENC
|
||||
&vorbis_encoder_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_OPUS
|
||||
#ifdef ENABLE_OPUS
|
||||
&opus_encoder_plugin,
|
||||
#endif
|
||||
#ifdef ENABLE_LAME_ENCODER
|
||||
&lame_encoder_plugin,
|
||||
#endif
|
||||
#ifdef ENABLE_TWOLAME_ENCODER
|
||||
#ifdef ENABLE_TWOLAME
|
||||
&twolame_encoder_plugin,
|
||||
#endif
|
||||
#ifdef ENABLE_WAVE_ENCODER
|
||||
@@ -51,7 +51,7 @@ const EncoderPlugin *const encoder_plugins[] = {
|
||||
#ifdef ENABLE_FLAC_ENCODER
|
||||
&flac_encoder_plugin,
|
||||
#endif
|
||||
#ifdef ENABLE_SHINE_ENCODER
|
||||
#ifdef ENABLE_SHINE
|
||||
&shine_encoder_plugin,
|
||||
#endif
|
||||
nullptr
|
||||
|
@@ -28,14 +28,14 @@
|
||||
|
||||
TextFile::TextFile(Path path_fs, Error &error)
|
||||
:file_reader(new FileReader(path_fs, error)),
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
gunzip_reader(file_reader->IsDefined()
|
||||
? new AutoGunzipReader(*file_reader)
|
||||
: nullptr),
|
||||
#endif
|
||||
buffered_reader(file_reader->IsDefined()
|
||||
? new BufferedReader(*
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
gunzip_reader
|
||||
#else
|
||||
file_reader
|
||||
@@ -48,7 +48,7 @@ TextFile::TextFile(Path path_fs, Error &error)
|
||||
TextFile::~TextFile()
|
||||
{
|
||||
delete buffered_reader;
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
delete gunzip_reader;
|
||||
#endif
|
||||
delete file_reader;
|
||||
|
@@ -34,7 +34,7 @@ class BufferedReader;
|
||||
class TextFile {
|
||||
FileReader *const file_reader;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef ENABLE_ZLIB
|
||||
AutoGunzipReader *const gunzip_reader;
|
||||
#endif
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include "util/Macros.hxx"
|
||||
#include "plugins/FileInputPlugin.hxx"
|
||||
|
||||
#ifdef HAVE_ALSA
|
||||
#ifdef ENABLE_ALSA
|
||||
#include "plugins/AlsaInputPlugin.hxx"
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "plugins/CurlInputPlugin.hxx"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FFMPEG
|
||||
#ifdef ENABLE_FFMPEG
|
||||
#include "plugins/FfmpegInputPlugin.hxx"
|
||||
#endif
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
const InputPlugin *const input_plugins[] = {
|
||||
&input_plugin_file,
|
||||
#ifdef HAVE_ALSA
|
||||
#ifdef ENABLE_ALSA
|
||||
&input_plugin_alsa,
|
||||
#endif
|
||||
#ifdef ENABLE_ARCHIVE
|
||||
@@ -69,7 +69,7 @@ const InputPlugin *const input_plugins[] = {
|
||||
#ifdef ENABLE_CURL
|
||||
&input_plugin_curl,
|
||||
#endif
|
||||
#ifdef HAVE_FFMPEG
|
||||
#ifdef ENABLE_FFMPEG
|
||||
&input_plugin_ffmpeg,
|
||||
#endif
|
||||
#ifdef ENABLE_SMBCLIENT
|
||||
|
@@ -41,7 +41,7 @@ static const char *remoteUrlPrefixes[] = {
|
||||
"mmst://",
|
||||
"mmsu://",
|
||||
#endif
|
||||
#ifdef HAVE_FFMPEG
|
||||
#ifdef ENABLE_FFMPEG
|
||||
"gopher://",
|
||||
"rtp://",
|
||||
"rtsp://",
|
||||
@@ -61,7 +61,7 @@ static const char *remoteUrlPrefixes[] = {
|
||||
#ifdef ENABLE_DESPOTIFY
|
||||
"spt://",
|
||||
#endif
|
||||
#ifdef HAVE_ALSA
|
||||
#ifdef ENABLE_ALSA
|
||||
"alsa://",
|
||||
#endif
|
||||
NULL
|
||||
|
@@ -29,7 +29,7 @@ const NeighborPlugin *const neighbor_plugins[] = {
|
||||
#ifdef ENABLE_SMBCLIENT
|
||||
&smbclient_neighbor_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_LIBUPNP
|
||||
#ifdef ENABLE_UPNP
|
||||
&upnp_neighbor_plugin,
|
||||
#endif
|
||||
nullptr
|
||||
|
@@ -54,13 +54,13 @@ const AudioOutputPlugin *const audio_output_plugins[] = {
|
||||
#ifdef ENABLE_PIPE_OUTPUT
|
||||
&pipe_output_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_ALSA
|
||||
#ifdef ENABLE_ALSA
|
||||
&alsa_output_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_ROAR
|
||||
#ifdef ENABLE_ROAR
|
||||
&roar_output_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_AO
|
||||
#ifdef ENABLE_AO
|
||||
&ao_output_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_OSS
|
||||
@@ -75,10 +75,10 @@ const AudioOutputPlugin *const audio_output_plugins[] = {
|
||||
#ifdef ENABLE_SOLARIS_OUTPUT
|
||||
&solaris_output_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_PULSE
|
||||
#ifdef ENABLE_PULSE
|
||||
&pulse_output_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_JACK
|
||||
#ifdef ENABLE_JACK
|
||||
&jack_output_plugin,
|
||||
#endif
|
||||
#ifdef ENABLE_HTTPD_OUTPUT
|
||||
|
@@ -25,11 +25,11 @@
|
||||
#include "config/ConfigError.hxx"
|
||||
#include "util/Error.hxx"
|
||||
|
||||
#ifdef HAVE_LIBSAMPLERATE
|
||||
#ifdef ENABLE_LIBSAMPLERATE
|
||||
#include "LibsamplerateResampler.hxx"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SOXR
|
||||
#ifdef ENABLE_SOXR
|
||||
#include "SoxrResampler.hxx"
|
||||
#endif
|
||||
|
||||
@@ -38,11 +38,11 @@
|
||||
enum class SelectedResampler {
|
||||
FALLBACK,
|
||||
|
||||
#ifdef HAVE_LIBSAMPLERATE
|
||||
#ifdef ENABLE_LIBSAMPLERATE
|
||||
LIBSAMPLERATE,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SOXR
|
||||
#ifdef ENABLE_SOXR
|
||||
SOXR,
|
||||
#endif
|
||||
};
|
||||
@@ -58,14 +58,14 @@ pcm_resampler_global_init(Error &error)
|
||||
if (strcmp(converter, "internal") == 0)
|
||||
return true;
|
||||
|
||||
#ifdef HAVE_SOXR
|
||||
#ifdef ENABLE_SOXR
|
||||
if (memcmp(converter, "soxr", 4) == 0) {
|
||||
selected_resampler = SelectedResampler::SOXR;
|
||||
return pcm_resample_soxr_global_init(converter, error);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBSAMPLERATE
|
||||
#ifdef ENABLE_LIBSAMPLERATE
|
||||
selected_resampler = SelectedResampler::LIBSAMPLERATE;
|
||||
return pcm_resample_lsr_global_init(converter, error);
|
||||
#endif
|
||||
@@ -86,12 +86,12 @@ pcm_resampler_create()
|
||||
case SelectedResampler::FALLBACK:
|
||||
return new FallbackPcmResampler();
|
||||
|
||||
#ifdef HAVE_LIBSAMPLERATE
|
||||
#ifdef ENABLE_LIBSAMPLERATE
|
||||
case SelectedResampler::LIBSAMPLERATE:
|
||||
return new LibsampleratePcmResampler();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SOXR
|
||||
#ifdef ENABLE_SOXR
|
||||
case SelectedResampler::SOXR:
|
||||
return new SoxrPcmResampler();
|
||||
#endif
|
||||
|
@@ -49,7 +49,7 @@ const struct playlist_plugin *const playlist_plugins[] = {
|
||||
// TODO: enable without GLib
|
||||
&pls_playlist_plugin,
|
||||
#endif
|
||||
#ifdef HAVE_EXPAT
|
||||
#ifdef ENABLE_EXPAT
|
||||
&xspf_playlist_plugin,
|
||||
&asx_playlist_plugin,
|
||||
&rss_playlist_plugin,
|
||||
|
@@ -103,7 +103,7 @@ socketpair_cloexec_nonblock(int domain, int type, int protocol, int sv[2]);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBMPDCLIENT
|
||||
#ifdef ENABLE_LIBMPDCLIENT
|
||||
/* Avoid symbol conflict with statically linked libmpdclient */
|
||||
#define socket_cloexec_nonblock socket_cloexec_nonblock_noconflict
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user