diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 681 |
1 files changed, 144 insertions, 537 deletions
diff --git a/configure.ac b/configure.ac index 66a942288..6c525062a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.19.7, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.20, musicpd-dev-team@lists.sourceforge.net) VERSION_MAJOR=0 -VERSION_MINOR=19 -VERSION_REVISION=7 +VERSION_MINOR=20 +VERSION_REVISION=0 VERSION_EXTRA=0 AC_CONFIG_SRCDIR([src/Main.cxx]) @@ -97,7 +97,7 @@ linux*) mingw32* | windows*) AC_CONFIG_FILES([ - src/win32/mpd_win32_rc.rc + win32/res/mpd.rc ]) AC_CHECK_TOOL(WINDRES, windres) AM_CPPFLAGS="$AM_CPPFLAGS -DWIN32_LEAN_AND_MEAN" @@ -193,10 +193,27 @@ dnl --------------------------------------------------------------------------- dnl Header/Library Checks dnl --------------------------------------------------------------------------- +AX_PTHREAD +LIBS="$PTHREAD_LIBS $LIBS" +AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" +AM_CXXFLAGS="$AM_CXXFLAGS $PTHREAD_CFLAGS" + +MPD_WITH_LIBRARY([PTHREAD], + [AC_CHECK_FUNCS([pthread_setname_np])]) + AC_SEARCH_LIBS([clock_gettime], [rt]) -AC_SEARCH_LIBS([syslog], [bsd socket inet], - [AC_DEFINE(HAVE_SYSLOG, 1, [Define if syslog() is available])]) +AC_ARG_ENABLE(syslog, + AS_HELP_STRING([--enable-syslog], + [enable syslog support (default: auto)]),, + enable_syslog=auto) +MPD_AUTO(syslog, [syslog support], [syslog() not available], + [AC_SEARCH_LIBS([syslog], [bsd socket inet], + [found_syslog=yes], + [found_syslog=no])]) +if test x$enable_syslog = xyes; then + AC_DEFINE(HAVE_SYSLOG, 1, [Define if syslog() is available]) +fi AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([gethostbyname], [nsl]) @@ -220,18 +237,6 @@ AC_CHECK_HEADERS(valgrind/memcheck.h) AC_CHECK_HEADERS([sys/prctl.h], AC_CHECK_FUNCS([prctl])) -AX_PTHREAD -LIBS="$PTHREAD_LIBS $LIBS" -AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" -AM_CXXFLAGS="$AM_CXXFLAGS $PTHREAD_CFLAGS" - -AC_CHECK_LIB([pthread], [pthread_setname_np], - [have_pthread_setname_np=yes], - [have_pthread_setname_np=no]) -if test x$have_pthread_setname_np = xyes; then - AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [Is pthread_setname_np() available?]) -fi - dnl --------------------------------------------------------------------------- dnl Event loop selection dnl --------------------------------------------------------------------------- @@ -290,82 +295,18 @@ else database_auto=no fi -AC_ARG_ENABLE(libmpdclient, - AS_HELP_STRING([--enable-libmpdclient], - [enable support for the MPD client]),, - enable_libmpdclient=auto) -MPD_DEPENDS([enable_libmpdclient], [enable_database], - [Cannot use --enable-libmpdclient with --disable-database]) - -AC_ARG_ENABLE(expat, - AS_HELP_STRING([--enable-expat], - [enable the expat XML parser]),, - enable_expat=auto) - -AC_ARG_ENABLE(upnp, - AS_HELP_STRING([--enable-upnp], - [enable UPnP client support (default: auto)]),, - enable_upnp=auto) -MPD_DEPENDS([enable_upnp], [enable_database], - [Cannot use --enable-upnp with --disable-database]) - -AC_ARG_ENABLE(adplug, - AS_HELP_STRING([--enable-adplug], - [enable the AdPlug decoder plugin (default: auto)]),, - enable_adplug=auto) - -AC_ARG_ENABLE(alsa, - AS_HELP_STRING([--enable-alsa], [enable ALSA support]),, - [enable_alsa=$linux_auto]) - -AC_ARG_ENABLE(roar, - AS_HELP_STRING([--enable-roar], - [enable support for RoarAudio]),, - [enable_roar=auto]) - -AC_ARG_ENABLE(ao, - AS_HELP_STRING([--enable-ao], - [enable support for libao]),, - enable_ao=auto) -MPD_DEPENDS([enable_ao], [enable_glib], - [Cannot use --enable-ao with --disable-glib]) - -AC_ARG_ENABLE(audiofile, - AS_HELP_STRING([--enable-audiofile], - [enable audiofile support (WAV and others)]),, - enable_audiofile=auto) - -AC_ARG_ENABLE(zlib, - AS_HELP_STRING([--enable-zlib], - [enable zlib support (default: auto)]),, - enable_zlib=auto) - -AC_ARG_ENABLE(bzip2, - AS_HELP_STRING([--enable-bzip2], - [enable bzip2 archive support (default: auto)]),, - enable_bzip2=auto) - -AC_ARG_ENABLE(cdio-paranoia, - AS_HELP_STRING([--enable-cdio-paranoia], - [enable support for audio CD support]),, - enable_cdio_paranoia=auto) -MPD_DEPENDS([enable_cdio_paranoia], [enable_glib], - [Cannot use --enable-cdio-paranoia with --disable-glib]) - -AC_ARG_ENABLE(curl, - AS_HELP_STRING([--enable-curl], - [enable support for libcurl HTTP streaming (default: auto)]),, - [enable_curl=auto]) - -AC_ARG_ENABLE(smbclient, - AS_HELP_STRING([--enable-smbclient], - [enable support for libsmbclient (default: auto)]),, - [enable_smbclient=auto]) - -AC_ARG_ENABLE(nfs, - AS_HELP_STRING([--enable-nfs], - [enable support for libnfs (default: auto)]),, - [enable_nfs=auto]) +default_enable_daemon=yes +if test x$host_is_android = xyes || test x$host_is_android = xyes; then + default_enable_daemon=no +fi +AC_ARG_ENABLE(daemon, + AS_HELP_STRING([--enable-daemon], + [enable daemonization (default: enabled)]),, + enable_daemon=$default_enable_daemon) +AM_CONDITIONAL([ENABLE_DAEMON], [test x$enable_daemon = xyes]) +if test x$enable_daemon = xyes; then + AC_DEFINE([ENABLE_DAEMON], 1, [Enable daemonization?]) +fi AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], @@ -382,44 +323,20 @@ AC_ARG_ENABLE(dsd, [enable DSD decoder (default: enable)]),, [enable_dsd=yes]) -AC_ARG_ENABLE(ffmpeg, - AS_HELP_STRING([--enable-ffmpeg], - [enable FFMPEG support]),, - enable_ffmpeg=auto) - AC_ARG_ENABLE(fifo, AS_HELP_STRING([--disable-fifo], [disable support for writing audio to a FIFO (default: enable)]),, enable_fifo=yes) -AC_ARG_ENABLE(flac, - AS_HELP_STRING([--enable-flac], - [enable FLAC decoder]),, - enable_flac=auto) - -AC_ARG_ENABLE(fluidsynth, - AS_HELP_STRING([--enable-fluidsynth], - [enable MIDI support via fluidsynth (default: auto)]),, - enable_fluidsynth=auto) - AC_ARG_ENABLE(gme, AS_HELP_STRING([--enable-gme], [enable Blargg's game music emulator plugin]),, enable_gme=auto) -MPD_DEPENDS([enable_gme], [enable_glib], - [Cannot use --enable-gme with --disable-glib]) AC_ARG_ENABLE(httpd-output, AS_HELP_STRING([--enable-httpd-output], [enables the HTTP server output]),, [enable_httpd_output=auto]) -MPD_DEPENDS([enable_httpd_output], [enable_glib], - [Cannot use --enable-httpd-output with --disable-glib]) - -AC_ARG_ENABLE(id3, - AS_HELP_STRING([--enable-id3], - [enable id3 support]),, - enable_id3=auto) AC_ARG_ENABLE(inotify, AS_HELP_STRING([--disable-inotify], @@ -431,91 +348,27 @@ AC_ARG_ENABLE(ipv6, [disable IPv6 support (default: enable)]),, [enable_ipv6=yes]) -AC_ARG_ENABLE(iso9660, - AS_HELP_STRING([--enable-iso9660], - [enable iso9660 archive support (default: disabled)]),, - enable_iso9660=no) - -AC_ARG_ENABLE(jack, - AS_HELP_STRING([--enable-jack], - [enable jack support]),, - enable_jack=auto) -MPD_DEPENDS([enable_jack], [enable_glib], - [Cannot use --enable-jack with --disable-glib]) - AC_SYS_LARGEFILE -AC_ARG_ENABLE(despotify, - AS_HELP_STRING([--enable-despotify], - [enable support for despotify (default: disable)]),, - [enable_despotify=no]) - AC_ARG_ENABLE(soundcloud, AS_HELP_STRING([--enable-soundcloud], [enable support for soundcloud.com]),, [enable_soundcloud=auto]) -MPD_DEPENDS([enable_soundcloud], [enable_glib], - [Cannot use --enable-soundcloud with --disable-glib]) - -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]) -AC_ARG_ENABLE(lsr, - AS_HELP_STRING([--enable-lsr], - [enable libsamplerate support]),, - enable_lsr=auto) - -AC_ARG_ENABLE(soxr, - AS_HELP_STRING([--enable-soxr], - [enable the libsoxr resampler]),, - enable_soxr=auto) - -AC_ARG_ENABLE(mad, - AS_HELP_STRING([--enable-mad], - [enable libmad mp3 decoder plugin]),, - enable_mad=auto) - AC_ARG_ENABLE(mikmod, AS_HELP_STRING([--enable-mikmod], [enable the mikmod decoder (default: disable)]),, enable_mikmod=no) -AC_ARG_ENABLE(mms, - AS_HELP_STRING([--enable-mms], - [enable the MMS protocol with libmms]),, - [enable_mms=auto]) - -AC_ARG_ENABLE(modplug, - AS_HELP_STRING([--enable-modplug], - [enable modplug decoder plugin]),, - enable_modplug=auto) - -AC_ARG_ENABLE(mpc, - AS_HELP_STRING([--enable-mpc], - [disable musepack (MPC) support (default: auto)]),, - enable_mpc=auto) - -AC_ARG_ENABLE(mpg123, - AS_HELP_STRING([--enable-mpg123], - [enable libmpg123 decoder plugin]),, - enable_mpg123=auto) - AC_ARG_ENABLE(openal, AS_HELP_STRING([--enable-openal], [enable OpenAL support (default: auto)]),, enable_openal=auto) -AC_ARG_ENABLE(opus, - AS_HELP_STRING([--enable-opus], - [enable Opus codec support (default: auto)]),, - enable_opus=auto) - AC_ARG_ENABLE(oss, AS_HELP_STRING([--disable-oss], [disable OSS support (default: enable)]),, @@ -531,11 +384,6 @@ AC_ARG_ENABLE(pipe-output, [enable support for writing audio to a pipe (default: disable)]),, enable_pipe_output=no) -AC_ARG_ENABLE(pulse, - AS_HELP_STRING([--enable-pulse], - [enable support for the PulseAudio sound server]),, - enable_pulse=auto) - AC_ARG_ENABLE(recorder-output, AS_HELP_STRING([--enable-recorder-output], [enables the recorder file output plugin (default: disable)]),, @@ -545,41 +393,17 @@ AC_ARG_ENABLE(sidplay, AS_HELP_STRING([--enable-sidplay], [enable C64 SID support via libsidplay2]),, enable_sidplay=auto) -MPD_DEPENDS([enable_sidplay], [enable_glib], - [Cannot use --enable-sidplay with --disable-glib]) - -AC_ARG_ENABLE(shine-encoder, - AS_HELP_STRING([--enable-shine-encoder], - [enables shine encoder]),, - [enable_shine_encoder=auto]) AC_ARG_ENABLE(shout, AS_HELP_STRING([--enable-shout], [enables the shoutcast streaming output]),, [enable_shout=auto]) -AC_ARG_ENABLE(sndfile, - AS_HELP_STRING([--enable-sndfile], - [enable sndfile support]),, - enable_sndfile=auto) - AC_ARG_ENABLE(solaris_output, AS_HELP_STRING([--enable-solaris-output], [enables the Solaris /dev/audio output]),, [enable_solaris_output=$host_is_solaris]) -AC_ARG_ENABLE(sqlite, - AS_HELP_STRING([--enable-sqlite], - [enable support for the SQLite database]),, - [enable_sqlite=$database_auto]) -MPD_DEPENDS([enable_sqlite], [enable_glib], - [Cannot use --enable-sqlite with --disable-glib]) - -AC_ARG_ENABLE(systemd-daemon, - AS_HELP_STRING([--enable-systemd-daemon], - [use the systemd daemon library (default=auto)]),, - [enable_systemd_daemon=$linux_auto]) - AC_ARG_ENABLE(tcp, AS_HELP_STRING([--disable-tcp], [disable support for clients connecting via TCP (default: enable)]),, @@ -590,16 +414,6 @@ AC_ARG_ENABLE(test, [build the test programs (default: disabled)]),, enable_test=no) -AC_ARG_WITH(tremor, - AS_HELP_STRING([--with-tremor=PFX], - [use Tremor (vorbisidec) integer Ogg Vorbis decoder (with optional prefix)]),, - with_tremor=no) - -AC_ARG_ENABLE(twolame-encoder, - AS_HELP_STRING([--enable-twolame-encoder], - [enable the TwoLAME mp2 encoder]),, - enable_twolame_encoder=auto) - AC_ARG_ENABLE(un, AS_HELP_STRING([--disable-un], [disable support for clients connecting via unix domain sockets (default: enable)]),, @@ -610,56 +424,21 @@ AC_ARG_ENABLE(vorbis, [enable Ogg Vorbis decoder]),, enable_vorbis=auto) -AC_ARG_ENABLE(vorbis-encoder, - AS_HELP_STRING([--enable-vorbis-encoder], - [enable the Ogg Vorbis encoder]),, - [enable_vorbis_encoder=auto]) -MPD_DEPENDS([enable_vorbis_encoder], [enable_glib], - [Cannot use --enable-vorbis-encoder with --disable-glib]) - AC_ARG_ENABLE(wave-encoder, AS_HELP_STRING([--enable-wave-encoder], [enable the PCM wave encoder]),, enable_wave_encoder=yes) -AC_ARG_ENABLE(wavpack, - AS_HELP_STRING([--enable-wavpack], - [enable WavPack support]),, - enable_wavpack=auto) -MPD_DEPENDS([enable_wavpack], [enable_glib], - [Cannot use --enable-wavpack with --disable-glib]) - AC_ARG_ENABLE(werror, AS_HELP_STRING([--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)]),, with_zeroconf="auto") -AC_ARG_ENABLE(zzip, - AS_HELP_STRING([--enable-zzip], - [enable zip archive support (default: disabled)]),, - enable_zzip=no) - - -AC_ARG_WITH(tremor-libraries, - AS_HELP_STRING([--with-tremor-libraries=DIR], - [directory where Tremor library is installed (optional)]),, - tremor_libraries="") - -AC_ARG_WITH(tremor-includes, - AS_HELP_STRING([--with-tremor-includes=DIR], - [directory where Tremor header files are installed (optional)]),, - tremor_includes="") - dnl --------------------------------------------------------------------------- dnl Mandatory Libraries dnl --------------------------------------------------------------------------- @@ -700,13 +479,18 @@ AM_CONDITIONAL(HAVE_ICU, test x$enable_icu = xyes) AC_ARG_ENABLE(glib, AS_HELP_STRING([--enable-glib], - [enable GLib usage (default: enabled)]),, - enable_glib=yes) + [enable GLib (default: auto)]),, + enable_glib=auto) -if test x$enable_glib = xyes; then - PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28 gthread-2.0],, - [AC_MSG_ERROR([GLib 2.28 is required])]) +if test x$enable_glib != xno; then + PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32], + [found_glib=yes], + [found_glib=no]) + + MPD_AUTO_RESULT([glib], [Glib], [GLib not found]) +fi +if test x$enable_glib = xyes; then if test x$GCC = xyes; then # suppress warnings in the GLib headers GLIB_CFLAGS=`echo $GLIB_CFLAGS |sed -e 's,-I/,-isystem /,g'` @@ -714,6 +498,7 @@ if test x$enable_glib = xyes; then AC_DEFINE(HAVE_GLIB, 1, [Define if GLib is used]) fi + AM_CONDITIONAL(HAVE_GLIB, test x$enable_glib = xyes) dnl --------------------------------------------------------------------------- @@ -765,12 +550,9 @@ if AC_MSG_ERROR([No client interfaces configured!]) fi -MPD_AUTO_PKG(systemd_daemon, SYSTEMD_DAEMON, libsystemd-daemon, - [systemd activation], [libsystemd-daemon not found]) -AM_CONDITIONAL(ENABLE_SYSTEMD_DAEMON, test x$enable_systemd_daemon = xyes) -if test x$enable_systemd_daemon = xyes; then - AC_DEFINE([ENABLE_SYSTEMD_DAEMON], 1, [Define to use the systemd daemon library]) -fi +MPD_ENABLE_AUTO_PKG(systemd_daemon, SYSTEMD_DAEMON, libsystemd-daemon, + [systemd socket activation], [libsystemd-daemon not found], + [$linux_auto]) dnl --------------------------------------------------------------------------- dnl LIBC Features @@ -784,22 +566,14 @@ dnl Miscellaneous Libraries dnl --------------------------------------------------------------------------- dnl -------------------------------- libmpdclient -------------------------------- -MPD_AUTO_PKG(libmpdclient, LIBMPDCLIENT, [libmpdclient >= 2.2], - [MPD client library], [libmpdclient not found]) -if test x$enable_libmpdclient = xyes; then - AC_DEFINE(HAVE_LIBMPDCLIENT, 1, [Define to use libmpdclient]) -fi - -AM_CONDITIONAL(HAVE_LIBMPDCLIENT, test x$enable_libmpdclient = xyes) +MPD_ENABLE_AUTO_PKG_DEPENDS(libmpdclient, LIBMPDCLIENT, + [libmpdclient >= 2.2], + [MPD client library], [libmpdclient not found], [], + [enable_database], [Cannot use --enable-libmpdclient with --disable-database]) dnl -------------------------------- expat -------------------------------- -MPD_AUTO_PKG(expat, EXPAT, [expat], +MPD_ENABLE_AUTO_PKG(expat, EXPAT, [expat], [expat XML parser], [expat not found]) -if test x$enable_expat = xyes; then - AC_DEFINE(HAVE_EXPAT, 1, [Define to use the expat XML parser]) -fi - -AM_CONDITIONAL(HAVE_EXPAT, test x$enable_expat = xyes) dnl --------------------------------- inotify --------------------------------- AC_CHECK_FUNCS(inotify_init inotify_init1) @@ -851,13 +625,9 @@ dnl Metadata Plugins dnl --------------------------------------------------------------------------- dnl -------------------------------- libid3tag -------------------------------- -MPD_AUTO_PKG_LIB(id3, ID3TAG, id3tag, id3tag, id3_file_open, [-lid3tag -lz], [], - [id3tag], [libid3tag not found]) -if test x$enable_id3 = xyes; then - AC_DEFINE(HAVE_ID3TAG, 1, [Define to use id3tag]) -fi - -AM_CONDITIONAL(HAVE_ID3TAG, test x$enable_id3 = xyes) +MPD_ENABLE_AUTO_PKG_LIB(id3, ID3TAG, + id3tag, id3tag, id3_file_open, [-lid3tag -lz], [], + [ID3 support using libid3tag], [libid3tag not found]) dnl --------------------------------------------------------------------------- dnl Autodiscovery @@ -920,107 +690,68 @@ dnl --------------------------------------------------------------------------- dnl ---------------------------------- sqlite --------------------------------- -MPD_AUTO_PKG(sqlite, SQLITE, [sqlite3], - [SQLite database support], [sqlite not found]) -if test x$enable_sqlite = xyes; then - AC_DEFINE([ENABLE_SQLITE], 1, [Define to enable sqlite database support]) -fi - -AM_CONDITIONAL(ENABLE_SQLITE, test x$enable_sqlite = xyes) +MPD_ENABLE_AUTO_PKG(sqlite, SQLITE, [sqlite3], + [SQLite database support], [sqlite not found], + [$database_auto]) dnl --------------------------------------------------------------------------- dnl Converter Plugins dnl --------------------------------------------------------------------------- dnl ------------------------------ libsamplerate ------------------------------ -MPD_AUTO_PKG(lsr, SAMPLERATE, [samplerate >= 0.1.3], +MPD_ENABLE_AUTO_PKG(lsr, LIBSAMPLERATE, [samplerate >= 0.1.3], [libsamplerate resampling], [libsamplerate not found]) -if test x$enable_lsr = xyes; then - AC_DEFINE([HAVE_LIBSAMPLERATE], 1, - [Define to enable libsamplerate]) -fi -AM_CONDITIONAL(HAVE_LIBSAMPLERATE, test x$enable_lsr = xyes) dnl ------------------------------ libsoxr ------------------------------------ -MPD_AUTO_PKG(soxr, SOXR, [soxr], +MPD_ENABLE_AUTO_PKG(soxr, SOXR, [soxr], [libsoxr resampler], [libsoxr not found]) -if test x$enable_soxr = xyes; then - AC_DEFINE([HAVE_SOXR], 1, [Define to enable libsoxr]) -fi - -AM_CONDITIONAL(HAVE_SOXR, test x$enable_soxr = xyes) dnl --------------------------------------------------------------------------- dnl Input Plugins dnl --------------------------------------------------------------------------- dnl ----------------------------------- CURL ---------------------------------- -MPD_AUTO_PKG(curl, CURL, [libcurl >= 7.18], +MPD_ENABLE_AUTO_PKG(curl, CURL, [libcurl >= 7.18], [libcurl HTTP streaming], [libcurl not found]) -if test x$enable_curl = xyes; then - AC_DEFINE(ENABLE_CURL, 1, [Define when libcurl is used for HTTP streaming]) -fi -AM_CONDITIONAL(ENABLE_CURL, test x$enable_curl = xyes) dnl ----------------------------------- smbclient ----------------------------- -MPD_AUTO_PKG_LIB(smbclient, SMBCLIENT, [smbclient >= 0.2], +MPD_ENABLE_AUTO_PKG_LIB(smbclient, SMBCLIENT, [smbclient >= 0.2], [smbclient], [smbc_init], [-lsmbclient], [], [smbclient input plugin], [libsmbclient not found]) -if test x$enable_smbclient = xyes; then - AC_DEFINE(ENABLE_SMBCLIENT, 1, [Define when libsmbclient is used]) -fi -AM_CONDITIONAL(ENABLE_SMBCLIENT, test x$enable_smbclient = xyes) dnl ----------------------------------- NFS ----------------------------- -MPD_AUTO_PKG(nfs, NFS, [libnfs], +MPD_ENABLE_AUTO_PKG(nfs, NFS, [libnfs], [NFS input plugin], [libnfs not found]) -if test x$enable_nfs = xyes; then - AC_DEFINE(ENABLE_NFS, 1, [Define when libnfs is used]) -fi -AM_CONDITIONAL(ENABLE_NFS, test x$enable_nfs = xyes) dnl --------------------------------- Despotify --------------------------------- -MPD_AUTO_PKG(despotify, DESPOTIFY, [despotify], +MPD_ENABLE_AUTO_PKG(despotify, DESPOTIFY, [despotify], [Despotify support], [despotify not found]) -if test x$enable_despotify = xyes; then - AC_DEFINE(ENABLE_DESPOTIFY, 1, [Define when despotify is enabled]) -fi -AM_CONDITIONAL(ENABLE_DESPOTIFY, test x$enable_despotify = xyes) dnl --------------------------------- Soundcloud ------------------------------ -if test x$enable_soundcloud != xno; then - PKG_CHECK_MODULES([YAJL], [yajl >= 2.0], +MPD_AUTO([soundcloud], [soundcloud.com support], [libyajl not found], + [PKG_CHECK_MODULES([YAJL], [yajl >= 2.0], [found_soundcloud=yes], - AC_CHECK_LIB([yajl], [yajl_parse_complete], - [found_soundcloud=yes YAJL_CFLAGS=-DHAVE_YAJL1 YAJL_LIBS=-lyajl], - [found_soundcloud=no])) -fi -MPD_AUTO_RESULT([soundcloud], [soundcloud.com support], [libyajl not found]) + [found_soundcloud=no])]) if test x$enable_soundcloud = xyes; then AC_DEFINE(ENABLE_SOUNDCLOUD, 1, [Define when soundcloud is enabled]) fi AM_CONDITIONAL(ENABLE_SOUNDCLOUD, test x$enable_soundcloud = xyes) -AC_SUBST(YAJL_LIBS) dnl ---------------------------------- cdio --------------------------------- -MPD_AUTO_PKG(cdio_paranoia, CDIO_PARANOIA, [libcdio_paranoia], - [libcdio_paranoia audio CD library], [libcdio_paranoia not found]) +MPD_ENABLE_AUTO_PKG(cdio_paranoia, CDIO_PARANOIA, [libcdio_paranoia], + [libcdio_paranoia input plugin], [libcdio_paranoia not found]) if test x$enable_cdio_paranoia = xyes; then - AC_DEFINE([ENABLE_CDIO_PARANOIA], 1, - [Define to enable libcdio_paranoia support]) AC_CHECK_HEADERS(cdio/paranoia/paranoia.h) fi -AM_CONDITIONAL(ENABLE_CDIO_PARANOIA, test x$enable_cdio_paranoia = xyes) - -dnl ---------------------------------- libmms --------------------------------- -MPD_AUTO_PKG(mms, MMS, [libmms >= 0.4], +MPD_ENABLE_AUTO_PKG(mms, MMS, [libmms >= 0.4], [libmms mms:// protocol support], [libmms not found]) -if test x$enable_mms = xyes; then - AC_DEFINE(ENABLE_MMS, 1, - [Define when libmms is used for the MMS protocol]) -fi -AM_CONDITIONAL(ENABLE_MMS, test x$enable_mms = xyes) + +dnl --------------------------------------------------------------------------- +dnl Playlist Plugins +dnl --------------------------------------------------------------------------- + +MPD_ARG_ENABLE(cue, CUE, [CUE sheet parser], yes) dnl --------------------------------------------------------------------------- dnl Neighbor Plugins @@ -1051,8 +782,8 @@ dnl Archive Plugins dnl --------------------------------------------------------------------------- dnl --------------------------------- iso9660 --------------------------------- -MPD_AUTO_PKG(iso9660, ISO9660, [libiso9660], - [libiso9660 archive library], [libiso9660 not found]) +MPD_ENABLE_AUTO_PKG(iso9660, ISO9660, [libiso9660], + [libiso9660 archive plugin], [libiso9660 not found]) AM_CONDITIONAL(HAVE_ISO9660, test x$enable_iso9660 = xyes) if test x$enable_iso9660 = xyes; then @@ -1067,23 +798,15 @@ AM_CONDITIONAL(ENABLE_ISO9660_TEST, test x$MKISOFS != xno) dnl ---------------------------------- zlib --------------------------------- -MPD_AUTO_PKG(zlib, ZLIB, [zlib], +MPD_ENABLE_AUTO_PKG(zlib, ZLIB, [zlib], [zlib support], [zlib not found]) -AM_CONDITIONAL(HAVE_ZLIB, test x$enable_zlib = xyes) -if test x$enable_zlib = xyes; then - AC_DEFINE(HAVE_ZLIB, 1, [Define to enable zlib support]) -fi - 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" @@ -1102,21 +825,16 @@ if test x$enable_expat = xno; then fi fi -MPD_AUTO_PKG(upnp, UPNP, [libupnp], - [UPnP client support], [libupnp not found]) -if test x$enable_upnp = xyes; then - AC_DEFINE(HAVE_LIBUPNP, 1, [Define when libupnp is used]) -fi -AM_CONDITIONAL(HAVE_LIBUPNP, test x$enable_upnp = xyes) +MPD_ENABLE_AUTO_PKG_DEPENDS(upnp, UPNP, [libupnp], + [UPnP client support], [libupnp not found], [], + [enable_database], [Cannot use --enable-upnp with --disable-database]) dnl --------------------------------- libzzip --------------------------------- -MPD_AUTO_PKG(zzip, ZZIP, [zziplib >= 0.13], - [libzzip archive library], [libzzip not found]) +MPD_ENABLE_AUTO_PKG(zzip, ZZIP, [zziplib >= 0.13], + [libzzip archive library], [libzzip not found], + [no]) -AM_CONDITIONAL(HAVE_ZZIP, test x$enable_zzip = xyes) if test x$enable_zzip = xyes; then - AC_DEFINE(HAVE_ZZIP, 1, [Define to have zip archive support]) - AC_PATH_PROG(ZIP, zip, no) else ZIP="no" @@ -1142,20 +860,12 @@ dnl Decoder Plugins dnl --------------------------------------------------------------------------- dnl -------------------------------- libadplug -------------------------------- -MPD_AUTO_PKG(adplug, ADPLUG, [adplug], +MPD_ENABLE_AUTO_PKG(adplug, ADPLUG, [adplug], [AdPlug decoder plugin], [libadplug not found]) -if test x$enable_adplug = xyes; then - AC_DEFINE(HAVE_ADPLUG, 1, [Define to use libadplug]) -fi -AM_CONDITIONAL(HAVE_ADPLUG, test x$enable_adplug = xyes) dnl -------------------------------- audiofile -------------------------------- -MPD_AUTO_PKG(audiofile, AUDIOFILE, [audiofile >= 0.3], +MPD_ENABLE_AUTO_PKG(audiofile, AUDIOFILE, [audiofile >= 0.3], [audiofile decoder plugin], [libaudiofile not found]) -AM_CONDITIONAL(HAVE_AUDIOFILE, test x$enable_audiofile = xyes) -if test x$enable_audiofile = xyes; then - AC_DEFINE(HAVE_AUDIOFILE, 1, [Define for audiofile support]) -fi dnl ----------------------------------- DSD ----------------------------------- @@ -1166,43 +876,25 @@ fi AM_CONDITIONAL(ENABLE_DSD, test x$enable_dsd = xyes) dnl ----------------------------------- FAAD ---------------------------------- -AM_PATH_FAAD() - -AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes) +MPD_ENABLE_AUTO_LIB(aac, FAAD, faad, NeAACDecOpen, [-lfaad], [], + [FAAD decoder plugin], [libfaad not found]) dnl ---------------------------------- ffmpeg --------------------------------- -MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat >= 53.17 libavcodec >= 53.25 libavutil >= 51.17], +MPD_ENABLE_AUTO_PKG(ffmpeg, FFMPEG, + [libavformat >= 53.17 libavcodec >= 53.25 libavutil >= 51.17], [ffmpeg decoder library], [libavformat+libavcodec+libavutil not found]) -if test x$enable_ffmpeg = xyes; then - AC_DEFINE(HAVE_FFMPEG, 1, [Define for FFMPEG support]) -fi - -AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes) - dnl ----------------------------------- FLAC ---------------------------------- -MPD_AUTO_PKG(flac, FLAC, [flac >= 1.2], +MPD_ENABLE_AUTO_PKG(flac, FLAC, [flac >= 1.2], [FLAC decoder], [libFLAC not found]) -if test x$enable_flac = xyes; then - AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support]) -fi - -AM_CONDITIONAL(HAVE_FLAC, test x$enable_flac = xyes) - enable_flac_encoder=$enable_flac dnl -------------------------------- FluidSynth ------------------------------- -MPD_AUTO_PKG(fluidsynth, FLUIDSYNTH, [fluidsynth >= 1.1], - [fluidsynth decoder], [fluidsynth not found]) - -if test x$enable_fluidsynth = xyes; then - AC_DEFINE(ENABLE_FLUIDSYNTH, 1, [Define for fluidsynth support]) -fi - -AM_CONDITIONAL(ENABLE_FLUIDSYNTH, test x$enable_fluidsynth = xyes) +MPD_ENABLE_AUTO_PKG(fluidsynth, FLUIDSYNTH, [fluidsynth >= 1.1], + [fluidsynth MIDI decoder plugin], [fluidsynth not found]) dnl ---------------------------------- libgme --------------------------------- MPD_AUTO_PKG_LIB(gme, GME, [libgme], gme, gme_open_file, [-lgme -lstdc++], [], @@ -1213,13 +905,9 @@ if test x$enable_gme = xyes; then fi dnl ---------------------------------- libmad --------------------------------- -MPD_AUTO_PKG_LIB(mad, MAD, [mad], +MPD_ENABLE_AUTO_PKG_LIB(mad, MAD, [mad], mad, mad_stream_init, [-lmad], [], [libmad MP3 decoder plugin], [libmad not found]) -if test x$enable_mad = xyes; then - AC_DEFINE(HAVE_MAD, 1, [Define to use libmad]) -fi -AM_CONDITIONAL(HAVE_MAD, test x$enable_mad = xyes) enable_shout2="$enable_shout" MPD_AUTO_PKG(shout, SHOUT, [shout], @@ -1229,12 +917,8 @@ if test x$enable_shout = xyes && test x$enable_shout2 = xauto; then fi dnl -------------------------------- libmpg123 -------------------------------- -MPD_AUTO_PKG(mpg123, MPG123, [libmpg123], +MPD_ENABLE_AUTO_PKG(mpg123, MPG123, [libmpg123], [libmpg123 decoder plugin], [libmpg123 not found]) -if test x$enable_mpg123 = xyes; then - AC_DEFINE(HAVE_MPG123, 1, [Define to use libmpg123]) -fi -AM_CONDITIONAL(HAVE_MPG123, test x$enable_mpg123 = xyes) dnl -------------------------------- libmikmod -------------------------------- if test x$enable_mikmod = xyes; then @@ -1251,72 +935,57 @@ fi AM_CONDITIONAL(ENABLE_MIKMOD_DECODER, test x$enable_mikmod = xyes) dnl -------------------------------- libmodplug ------------------------------- -MPD_AUTO_PKG(modplug, MODPLUG, [libmodplug], +MPD_ENABLE_AUTO_PKG(modplug, MODPLUG, [libmodplug], [modplug decoder plugin], [libmodplug not found]) -if test x$enable_modplug = xyes; then - AC_DEFINE(HAVE_MODPLUG, 1, [Define for modplug support]) -fi -AM_CONDITIONAL(HAVE_MODPLUG, test x$enable_modplug = xyes) - dnl -------------------------------- libopus ---------------------------------- -MPD_AUTO_PKG(opus, OPUS, [opus ogg], +MPD_ENABLE_AUTO_PKG(opus, OPUS, [opus ogg], [opus decoder plugin], [libopus not found]) -if test x$enable_opus = xyes; then - AC_DEFINE(HAVE_OPUS, 1, [Define to use libopus]) -fi -AM_CONDITIONAL(HAVE_OPUS, test x$enable_opus = xyes) dnl -------------------------------- libsndfile ------------------------------- dnl See above test, which may disable this. -MPD_AUTO_PKG(sndfile, SNDFILE, [sndfile], +MPD_ENABLE_AUTO_PKG(sndfile, SNDFILE, [sndfile], [libsndfile decoder plugin], [libsndfile not found]) -if test x$enable_sndfile = xyes; then - AC_DEFINE(ENABLE_SNDFILE, 1, [Define to enable the sndfile decoder plugin]) -fi -AM_CONDITIONAL(ENABLE_SNDFILE, test x$enable_sndfile = xyes) - 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 ------------------------------- + +AC_ARG_WITH(tremor, + AS_HELP_STRING([--with-tremor=PFX], + [use Tremor (vorbisidec) integer Ogg Vorbis decoder (with optional prefix)]),, + with_tremor=no) + +AC_ARG_VAR([TREMOR_CFLAGS], [C compiler flags for Tremor]) +AC_ARG_VAR([TREMOR_LIBS], [linker flags for Tremor]) + if test x$with_tremor = xyes || test x$with_tremor = xno; then enable_tremor="$with_tremor" + tremor_prefix="" else tremor_prefix="$with_tremor" enable_tremor=yes fi if test x$enable_tremor = xyes; then - 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 + if test x$TREMOR_CFLAGS = x && test x$tremor_prefix != x; then TREMOR_CFLAGS="-I$tremor_prefix/include" fi - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $TREMOR_CFLAGS" - LIBS="$LIBS $TREMOR_LIBS" - AC_CHECK_LIB(vorbisidec,ov_read,,enable_tremor=no; - AC_MSG_WARN([vorbisidec lib needed for ogg support with tremor -- disabling ogg support])) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" -fi + if test x$TREMOR_LIBS = x; then + TREMOR_LIBS="-lvorbisidec" + + if test x$tremor_prefix != x; then + TREMOR_LIBS="-L$tremor_prefix/lib $TREMOR_LIBS" + fi + fi + + MPD_WITH_LIBRARY([TREMOR], + [AC_CHECK_FUNC([ov_read],, + [AC_MSG_ERROR([libvorbisidec not found])])]) -if test x$enable_tremor = xyes; then AC_DEFINE(HAVE_TREMOR,1, [Define to use tremor (libvorbisidec) for ogg support]) AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]) @@ -1325,9 +994,6 @@ else TREMOR_LIBS= fi -AC_SUBST(TREMOR_CFLAGS) -AC_SUBST(TREMOR_LIBS) - dnl -------------------------------- Ogg Vorbis ------------------------------- if test x$enable_tremor = xyes; then @@ -1382,21 +1048,12 @@ fi AM_CONDITIONAL(ENABLE_SIDPLAY, test x$enable_sidplay = xyes) dnl --------------------------------- wavpack --------------------------------- -MPD_AUTO_PKG(wavpack, WAVPACK, [wavpack], +MPD_ENABLE_AUTO_PKG(wavpack, WAVPACK, [wavpack], [WavPack decoder plugin], [libwavpack not found]) -AM_CONDITIONAL(HAVE_WAVPACK, test x$enable_wavpack = xyes) -if test x$enable_wavpack = xyes; then - AC_DEFINE([HAVE_WAVPACK], 1, [Define to enable WavPack support]) -fi 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 ----------------------- @@ -1439,44 +1096,21 @@ AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes) dnl ------------------------------- Shine Encoder ------------------------------ -MPD_AUTO_PKG(shine_encoder, SHINE, [shine >= 3.1], +MPD_ENABLE_AUTO_PKG(shine_encoder, SHINE, [shine >= 3.1], [shine encoder], [libshine not found]) -if test x$enable_shine_encoder = xyes; then - AC_DEFINE(ENABLE_SHINE_ENCODER, 1, - [Define to enable the shine encoder plugin]) -fi -AM_CONDITIONAL(ENABLE_SHINE_ENCODER, test x$enable_shine_encoder = xyes) - dnl ---------------------------- Ogg Vorbis Encoder --------------------------- -MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc vorbis ogg], +MPD_ENABLE_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc vorbis ogg], [Ogg Vorbis encoder], [libvorbisenc not found]) -if test x$enable_vorbis_encoder = xyes; then - AC_DEFINE(ENABLE_VORBIS_ENCODER, 1, - [Define to enable the vorbis encoder plugin]) -fi -AM_CONDITIONAL(ENABLE_VORBIS_ENCODER, test x$enable_vorbis_encoder = xyes) - 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_AUTO_PKG(twolame_encoder, TWOLAME, [twolame], - [TwoLAME encoder], [libtwolame not found]) - -if test x$enable_twolame_encoder = xyes; then - AC_DEFINE(ENABLE_TWOLAME_ENCODER, 1, - [Define to enable the TwoLAME encoder plugin]) -fi -AM_CONDITIONAL(ENABLE_TWOLAME_ENCODER, test x$enable_twolame_encoder = xyes) +MPD_ENABLE_AUTO_PKG(twolame_encoder, TWOLAME, [twolame], + [TwoLAME encoder plugin], [libtwolame not found]) dnl ------------------------------- WAVE Encoder ------------------------------ AM_CONDITIONAL(ENABLE_WAVE_ENCODER, test x$enable_wave_encoder = xyes) @@ -1516,24 +1150,13 @@ dnl Audio Output Plugins dnl --------------------------------------------------------------------------- dnl ----------------------------------- ALSA ---------------------------------- -MPD_AUTO_PKG(alsa, ALSA, [alsa >= 0.9.0], - [ALSA output plugin], [libasound not found]) - -if test x$enable_alsa = xyes; then - AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support]) -fi - -AM_CONDITIONAL(HAVE_ALSA, test x$enable_alsa = xyes) +MPD_ENABLE_AUTO_PKG(alsa, ALSA, [alsa >= 0.9.0], + [ALSA output plugin], [libasound not found], + [$linux_auto]) dnl ----------------------------------- ROAR ---------------------------------- -MPD_AUTO_PKG(roar, ROAR, [libroar >= 0.4.0], - [ROAR output plugin], [libroar not found]) - -if test x$enable_roar = xyes; then - AC_DEFINE(HAVE_ROAR, 1, [Define to enable ROAR support]) -fi - -AM_CONDITIONAL(HAVE_ROAR, test x$enable_roar = xyes) +MPD_ENABLE_AUTO_PKG(roar, ROAR, [libroar >= 0.4.0], + [RoarAudio output plugin], [libroar not found]) dnl ----------------------------------- FIFO ---------------------------------- if test x$enable_fifo = xyes; then @@ -1563,11 +1186,8 @@ fi AM_CONDITIONAL(ENABLE_HTTPD_OUTPUT, test x$enable_httpd_output = xyes) dnl ----------------------------------- JACK ---------------------------------- -MPD_AUTO_PKG(jack, JACK, [jack >= 0.100], +MPD_ENABLE_AUTO_PKG(jack, JACK, [jack >= 0.100], [JACK output plugin], [libjack not found]) -if test x$enable_jack = xyes; then - AC_DEFINE([HAVE_JACK], 1, [Define to enable JACK support]) -fi if test x$enable_jack = xyes; then # check whether jack_set_info_function() is available @@ -1579,16 +1199,9 @@ if test x$enable_jack = xyes; then LIBS=$old_LIBS fi -AM_CONDITIONAL(HAVE_JACK, test x$enable_jack = xyes) - dnl ---------------------------------- libao ---------------------------------- -MPD_AUTO_PKG(ao, AO, [ao], +MPD_ENABLE_AUTO_PKG(ao, AO, [ao], [libao output plugin], [libao not found]) -if test x$enable_ao = xyes; then - AC_DEFINE(HAVE_AO, 1, [Define to play with ao]) -fi - -AM_CONDITIONAL(HAVE_AO, test x$enable_ao = xyes) dnl ---------------------------------- OpenAL --------------------------------- AC_SUBST(OPENAL_CFLAGS,"") @@ -1642,14 +1255,8 @@ fi AM_CONDITIONAL(ENABLE_PIPE_OUTPUT, test x$enable_pipe_output = xyes) dnl -------------------------------- PulseAudio ------------------------------- -MPD_AUTO_PKG(pulse, PULSE, [libpulse >= 0.9.16], +MPD_ENABLE_AUTO_PKG(pulse, PULSE, [libpulse >= 0.9.16], [PulseAudio output plugin], [libpulse not found]) -if test x$enable_pulse = xyes; then - AC_DEFINE([HAVE_PULSE], 1, - [Define to enable PulseAudio support]) -fi - -AM_CONDITIONAL(HAVE_PULSE, test x$enable_pulse = xyes) dnl --------------------------------- Recorder -------------------------------- if test x$enable_recorder_output = xauto; then |