aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac444
1 files changed, 381 insertions, 63 deletions
diff --git a/configure.ac b/configure.ac
index 2e0061954..f8d100331 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,20 +1,25 @@
AC_PREREQ(2.60)
-AC_INIT(mpd, 0.18.19, mpd-devel@musicpd.org)
+AC_INIT(mpd, 0.19.5, musicpd-dev-team@lists.sourceforge.net)
VERSION_MAJOR=0
-VERSION_MINOR=18
-VERSION_REVISION=19
+VERSION_MINOR=19
+VERSION_REVISION=5
VERSION_EXTRA=0
AC_CONFIG_SRCDIR([src/Main.cxx])
+AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE([foreign 1.11 dist-xz subdir-objects])
AM_SILENT_RULES
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
-AC_DEFINE(PROTOCOL_VERSION, "0.18.0", [The MPD protocol version])
+AC_DEFINE(PROTOCOL_VERSION, "0.19.0", [The MPD protocol version])
+GIT_COMMIT=`GIT_DIR="$srcdir/.git" git describe --dirty --always 2>/dev/null`
+if test x$GIT_COMMIT != x; then
+ AC_DEFINE_UNQUOTED(GIT_COMMIT, ["$GIT_COMMIT"], [The current git commit])
+fi
dnl ---------------------------------------------------------------------------
dnl Programs
@@ -65,9 +70,31 @@ dnl OS Specific Defaults
dnl ---------------------------------------------------------------------------
AC_CANONICAL_HOST
+host_is_unix=yes
+host_is_linux=no
+host_is_android=no
host_is_darwin=no
+host_is_solaris=no
+host_is_windows=no
+
+linux_auto=no
case "$host_os" in
+linux-android*)
+ host_is_android=yes
+ host_is_linux=yes
+ linux_auto=auto
+ AM_CPPFLAGS="$AM_CPPFLAGS -DANDROID"
+ ;;
+
+linux*)
+ host_is_linux=yes
+ linux_auto=auto
+
+ dnl allow using all glibc features
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+ ;;
+
mingw32* | windows*)
AC_CONFIG_FILES([
src/win32/mpd_win32_rc.rc
@@ -76,14 +103,21 @@ mingw32* | windows*)
AM_CPPFLAGS="$AM_CPPFLAGS -DWIN32_LEAN_AND_MEAN"
AM_CPPFLAGS="$AM_CPPFLAGS -DWINVER=0x0600 -D_WIN32_WINNT=0x0600"
LIBS="$LIBS -lws2_32"
- HAVE_WINDOWS=1
+ host_is_windows=yes
+ host_is_unix=no
;;
darwin*)
host_is_darwin=yes
;;
+
+solaris*)
+ host_is_solaris=yes
+ ;;
esac
-AM_CONDITIONAL([HAVE_WINDOWS], [test x$HAVE_WINDOWS = x1])
+
+AM_CONDITIONAL([ANDROID], [test x$host_is_android = xyes])
+AM_CONDITIONAL([HAVE_WINDOWS], [test x$host_is_windows = xyes])
if test -z "$prefix" || test "x$prefix" = xNONE; then
local_lib=
@@ -122,6 +156,27 @@ if test -z "$prefix" || test "x$prefix" = xNONE; then
fi
dnl ---------------------------------------------------------------------------
+dnl Android
+dnl ---------------------------------------------------------------------------
+
+AC_ARG_WITH([android-sdk],
+ AS_HELP_STRING([--with-android-sdk=DIR],
+ [Directory for Android SDK]),
+ [], [with_android_sdk=no])
+
+if test x$host_is_android = xyes; then
+ if test x$with_android_sdk = xno; then
+ AC_MSG_ERROR([Android build requires option --with-android-sdk=DIR])
+ fi
+
+ if ! test -x $with_android_sdk/tools/android; then
+ AC_MSG_ERROR([Android SDK not found in $with_android_sdk])
+ fi
+fi
+
+AC_SUBST(ANDROID_SDK, [$with_android_sdk])
+
+dnl ---------------------------------------------------------------------------
dnl Language Checks
dnl ---------------------------------------------------------------------------
@@ -137,7 +192,8 @@ fi
dnl ---------------------------------------------------------------------------
dnl Header/Library Checks
dnl ---------------------------------------------------------------------------
-AC_CHECK_FUNCS(daemon fork)
+
+AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([syslog], [bsd socket inet],
[AC_DEFINE(HAVE_SYSLOG, 1, [Define if syslog() is available])])
@@ -145,10 +201,16 @@ AC_SEARCH_LIBS([syslog], [bsd socket inet],
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([gethostbyname], [nsl])
-AC_CHECK_FUNCS(pipe2 accept4)
-MPD_OPTIONAL_FUNC(eventfd, eventfd, USE_EVENTFD)
-MPD_OPTIONAL_FUNC(signalfd, signalfd, USE_SIGNALFD)
-MPD_OPTIONAL_FUNC(epoll, epoll_create1, USE_EPOLL)
+if test x$host_is_linux = xyes; then
+ AC_CHECK_FUNCS(pipe2 accept4)
+fi
+
+AC_CHECK_FUNCS(getpwnam_r getpwuid_r)
+
+if test x$host_is_linux = xyes; then
+ MPD_OPTIONAL_FUNC(eventfd, eventfd, USE_EVENTFD)
+ MPD_OPTIONAL_FUNC(signalfd, signalfd, USE_SIGNALFD)
+fi
AC_SEARCH_LIBS([exp], [m],,
[AC_MSG_ERROR([exp() not found])])
@@ -156,14 +218,96 @@ AC_SEARCH_LIBS([exp], [m],,
AC_CHECK_HEADERS(locale.h)
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 ---------------------------------------------------------------------------
+
+MPD_OPTIONAL_FUNC_NODEF(poll, poll)
+
+if test x$host_is_linux = xyes; then
+ MPD_OPTIONAL_FUNC_NODEF(epoll, epoll_create1)
+fi
+
+AC_ARG_WITH(pollmethod,
+ AS_HELP_STRING(
+ [--with-pollmethod=@<:@epoll|poll|winselect|auto@:>@],
+ [specify poll method for internal event loop (default=auto)]),,
+ [with_pollmethod=auto])
+
+if test "x$with_pollmethod" = xauto; then
+ if test "x$enable_epoll" = xyes; then
+ with_pollmethod=epoll
+ elif test "x$enable_poll" = xyes; then
+ with_pollmethod=poll
+ elif test "x$host_is_windows" = xyes; then
+ with_pollmethod=winselect
+ else
+ AC_MSG_ERROR([no poll method is available for your platform])
+ fi
+fi
+case "$with_pollmethod" in
+epoll)
+ AC_DEFINE(USE_EPOLL, 1, [Define to poll sockets with epoll])
+ ;;
+poll)
+ AC_DEFINE(USE_POLL, 1, [Define to poll sockets with poll])
+ ;;
+winselect)
+ AC_DEFINE(USE_WINSELECT, 1,
+ [Define to poll sockets with Windows select])
+ ;;
+*)
+ AC_MSG_ERROR([unknown pollmethod option: $with_pollmethod])
+esac
+
dnl ---------------------------------------------------------------------------
dnl Allow tools to be specifically built
dnl ---------------------------------------------------------------------------
+AC_ARG_ENABLE(database,
+ AS_HELP_STRING([--enable-database],
+ [enable support for the music database]),,
+ enable_database=yes)
+AM_CONDITIONAL(ENABLE_DATABASE, test x$enable_database = xyes)
+if test x$enable_database = xyes; then
+ database_auto=auto
+ AC_DEFINE(ENABLE_DATABASE, 1, [Define to enable the music database])
+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],
@@ -172,7 +316,7 @@ AC_ARG_ENABLE(adplug,
AC_ARG_ENABLE(alsa,
AS_HELP_STRING([--enable-alsa], [enable ALSA support]),,
- [enable_alsa=auto])
+ [enable_alsa=$linux_auto])
AC_ARG_ENABLE(roar,
AS_HELP_STRING([--enable-roar],
@@ -183,12 +327,19 @@ 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)]),,
@@ -198,12 +349,24 @@ 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])
+
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging (default: disabled)]),,
@@ -243,11 +406,15 @@ 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],
@@ -273,6 +440,8 @@ 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
@@ -285,6 +454,8 @@ 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],
@@ -300,6 +471,11 @@ AC_ARG_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]),,
@@ -369,7 +545,13 @@ 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],
@@ -384,17 +566,19 @@ AC_ARG_ENABLE(sndfile,
AC_ARG_ENABLE(solaris_output,
AS_HELP_STRING([--enable-solaris-output],
[enables the Solaris /dev/audio output]),,
- [enable_solaris_output=auto])
+ [enable_solaris_output=$host_is_solaris])
AC_ARG_ENABLE(sqlite,
AS_HELP_STRING([--enable-sqlite],
[enable support for the SQLite database]),,
- [enable_sqlite=auto])
+ [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=auto])
+ [enable_systemd_daemon=$linux_auto])
AC_ARG_ENABLE(tcp,
AS_HELP_STRING([--disable-tcp],
@@ -419,7 +603,7 @@ AC_ARG_ENABLE(twolame-encoder,
AC_ARG_ENABLE(un,
AS_HELP_STRING([--disable-un],
[disable support for clients connecting via unix domain sockets (default: enable)]),,
- [enable_un=yes])
+ [enable_un=$host_is_unix])
AC_ARG_ENABLE(vorbis,
AS_HELP_STRING([--enable-vorbis],
@@ -430,6 +614,8 @@ 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],
@@ -440,6 +626,8 @@ 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],
@@ -475,13 +663,58 @@ AC_ARG_WITH(tremor-includes,
dnl ---------------------------------------------------------------------------
dnl Mandatory Libraries
dnl ---------------------------------------------------------------------------
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28 gthread-2.0],,
+
+no_exceptions=yes
+
+AX_BOOST_BASE([1.46],, [AC_MSG_ERROR([Boost not found])])
+
+dnl Don't disable exceptions on Boost older than 1.54, because
+dnl Boost.Intrusive supports this compiler mode only since 1.54;
+dnl see https://svn.boost.org/trac/boost/ticket/7849
+CPPFLAGS_SAVED="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+export CPPFLAGS
+AC_LANG_PUSH(C++)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+@%:@include <boost/version.hpp>
+]], [[
+#if BOOST_VERSION < 105400
+#error detected Boost older than 1.54
+#endif
+]])],, [no_exceptions=no])
+AC_LANG_POP([C++])
+CPPFLAGS="$CPPFLAGS_SAVED"
+
+AC_ARG_ENABLE(icu,
+ AS_HELP_STRING([--enable-icu],
+ [enable libicu for Unicode (default: enabled)]),,
+ enable_icu=yes)
+
+if test x$enable_icu = xyes; then
+ PKG_CHECK_MODULES([ICU], [icu-i18n],,
+ [AC_MSG_ERROR([libicu not found])])
+
+ AC_DEFINE(HAVE_ICU, 1, [Define if libicu is used])
+fi
+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)
+
+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$GCC = xyes; then
- # suppress warnings in the GLib headers
- GLIB_CFLAGS=`echo $GLIB_CFLAGS |sed -e 's,-I/,-isystem /,g'`
+ if test x$GCC = xyes; then
+ # suppress warnings in the GLib headers
+ GLIB_CFLAGS=`echo $GLIB_CFLAGS |sed -e 's,-I/,-isystem /,g'`
+ fi
+
+ AC_DEFINE(HAVE_GLIB, 1, [Define if GLib is used])
fi
+AM_CONDITIONAL(HAVE_GLIB, test x$enable_glib = xyes)
dnl ---------------------------------------------------------------------------
dnl Protocol Options
@@ -519,12 +752,6 @@ if test x$enable_tcp = xyes; then
AC_DEFINE(HAVE_TCP, 1, [Define if TCP socket support is enabled])
fi
-case "$host_os" in
-mingw* | windows* | cygwin*)
- enable_un=no
- ;;
-esac
-
if test x$enable_un = xyes; then
AC_DEFINE(HAVE_UN, 1, [Define if unix domain socket support is enabled])
STRUCT_UCRED
@@ -565,6 +792,15 @@ fi
AM_CONDITIONAL(HAVE_LIBMPDCLIENT, test x$enable_libmpdclient = xyes)
+dnl -------------------------------- expat --------------------------------
+MPD_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)
@@ -644,7 +880,7 @@ avahi)
;;
esac
-MPD_AUTO_PKG(avahi, AVAHI, [avahi-client],
+MPD_AUTO_PKG(avahi, AVAHI, [avahi-client dbus-1],
[avahi client library], [avahi-client not found])
if test x$enable_avahi = xyes; then
AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])
@@ -697,21 +933,22 @@ dnl Converter Plugins
dnl ---------------------------------------------------------------------------
dnl ------------------------------ libsamplerate ------------------------------
-MPD_AUTO_PKG(lsr, SAMPLERATE, [samplerate >= 0.0.15],
+MPD_AUTO_PKG(lsr, SAMPLERATE, [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)
-if test x$enable_lsr = xyes; then
- PKG_CHECK_MODULES([SAMPLERATE_013],
- [samplerate >= 0.1.3],,
- [AC_DEFINE([HAVE_LIBSAMPLERATE_NOINT], 1,
- [libsamplerate doesn't provide src_int_to_float_array() (<0.1.3)])])
+dnl ------------------------------ libsoxr ------------------------------------
+MPD_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_LIBSAMPLERATE, test x$enable_lsr = xyes)
+AM_CONDITIONAL(HAVE_SOXR, test x$enable_soxr = xyes)
dnl ---------------------------------------------------------------------------
dnl Input Plugins
@@ -725,6 +962,23 @@ if test x$enable_curl = xyes; then
fi
AM_CONDITIONAL(ENABLE_CURL, test x$enable_curl = xyes)
+dnl ----------------------------------- smbclient -----------------------------
+MPD_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],
+ [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],
[Despotify support], [despotify not found])
@@ -769,6 +1023,30 @@ fi
AM_CONDITIONAL(ENABLE_MMS, test x$enable_mms = xyes)
dnl ---------------------------------------------------------------------------
+dnl Neighbor Plugins
+dnl ---------------------------------------------------------------------------
+
+AC_ARG_ENABLE(neighbor-plugins,
+ AS_HELP_STRING([--enable-neighbor-plugins],
+ [enable support for neighbor discovery (default: auto)]),,
+ [enable_neighbor_plugins=auto])
+
+if test x$enable_neighbor_plugins = xauto; then
+ if test x$enable_smbclient = xyes; then
+ enable_neighbor_plugins=yes
+ fi
+ if test x$enable_upnp = xyes; then
+ enable_neighbor_plugins=yes
+ fi
+fi
+
+if test x$enable_neighbor_plugins = xyes; then
+ AC_DEFINE(ENABLE_NEIGHBOR_PLUGINS, 1,
+ [Define to enable support for neighbor discovery])
+fi
+AM_CONDITIONAL(ENABLE_NEIGHBOR_PLUGINS, test x$enable_neighbor_plugins = xyes)
+
+dnl ---------------------------------------------------------------------------
dnl Archive Plugins
dnl ---------------------------------------------------------------------------
@@ -787,6 +1065,16 @@ fi
AM_CONDITIONAL(ENABLE_ISO9660_TEST, test x$MKISOFS != xno)
+dnl ---------------------------------- zlib ---------------------------------
+
+MPD_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], [],
@@ -803,6 +1091,24 @@ fi
AM_CONDITIONAL(ENABLE_BZIP2_TEST, test x$BZIP2 != xno)
+dnl ---------------------------------- libupnp ---------------------------------
+
+if test x$enable_expat = xno; then
+ if test x$enable_upnp = xauto; then
+ AC_MSG_WARN([expat disabled -- disabling UPnP])
+ enable_upnp=no
+ elif test x$enable_upnp = xyes; then
+ AC_MSG_ERROR([expat disabled -- required for UPnP])
+ 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)
+
dnl --------------------------------- libzzip ---------------------------------
MPD_AUTO_PKG(zzip, ZZIP, [zziplib >= 0.13],
[libzzip archive library], [libzzip not found])
@@ -1119,6 +1425,7 @@ else
enable_vorbis_encoder=no
enable_lame_encoder=no
enable_twolame_encoder=no
+ enable_shine_encoder=no
enable_wave_encoder=no
enable_flac_encoder=no
fi
@@ -1130,6 +1437,17 @@ if test x$enable_flac_encoder = xyes; then
fi
AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes)
+dnl ------------------------------- Shine Encoder ------------------------------
+
+MPD_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],
[Ogg Vorbis encoder], [libvorbisenc not found])
@@ -1173,6 +1491,7 @@ if test x$enable_vorbis_encoder != xno ||
test x$enable_lame_encoder != xno ||
test x$enable_twolame_encoder != xno ||
test x$enable_flac_encoder != xno ||
+ test x$enable_shine_encoder != xno ||
test x$enable_wave_encoder != xno; then
# at least one encoder plugin is enabled
enable_encoder=yes
@@ -1368,18 +1687,6 @@ AM_CONDITIONAL(HAVE_SHOUT, test x$enable_shout = xyes)
dnl --------------------------------- Solaris ---------------------------------
-if test x$enable_solaris_output = xauto; then
- case "$host_os" in
- solaris*)
- enable_solaris_output=yes
- ;;
-
- *)
- enable_solaris_output=no
- ;;
- esac
-fi
-
if test x$enable_solaris_output = xyes; then
AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support])
fi
@@ -1388,17 +1695,13 @@ AM_CONDITIONAL(ENABLE_SOLARIS_OUTPUT, test x$enable_solaris_output = xyes)
dnl --------------------------------- WinMM ---------------------------------
-case "$host_os" in
- mingw32* | windows*)
- AC_DEFINE(ENABLE_WINMM_OUTPUT, 1, [Define to enable WinMM support])
- enable_winmm_output=yes
- LIBS="$LIBS -lwinmm"
- ;;
-
- *)
- enable_winmm_output=no
- ;;
-esac
+if test "x$host_is_windows" = xyes; then
+ AC_DEFINE(ENABLE_WINMM_OUTPUT, 1, [Define to enable WinMM support])
+ enable_winmm_output=yes
+ LIBS="$LIBS -lwinmm"
+else
+ enable_winmm_output=no
+fi
AM_CONDITIONAL(ENABLE_WINMM_OUTPUT, test x$enable_winmm_output = xyes)
@@ -1407,8 +1710,11 @@ dnl Documentation
dnl ---------------------------------------------------------------------------
if test x$enable_documentation = xyes; then
AC_PATH_PROG(XMLTO, xmlto)
+ if test x$XMLTO = x; then
+ AC_MSG_ERROR([xmlto not found])
+ fi
+
AC_SUBST(XMLTO)
- AM_CONDITIONAL(HAVE_XMLTO, test x$XMLTO != x)
AC_PATH_PROG(DOXYGEN, doxygen)
if test x$DOXYGEN = x; then
@@ -1416,8 +1722,6 @@ if test x$enable_documentation = xyes; then
fi
AC_SUBST(DOXYGEN)
-else
- AM_CONDITIONAL(HAVE_XMLTO, false)
fi
AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes)
@@ -1452,8 +1756,12 @@ AC_LANG_PUSH([C++])
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
AX_APPEND_COMPILE_FLAGS([-fno-threadsafe-statics])
AX_APPEND_COMPILE_FLAGS([-fmerge-all-constants])
-AX_APPEND_COMPILE_FLAGS([-fno-exceptions])
-AX_APPEND_COMPILE_FLAGS([-fno-rtti])
+
+if test x$no_exceptions = xyes; then
+ AX_APPEND_COMPILE_FLAGS([-fno-exceptions])
+ AX_APPEND_COMPILE_FLAGS([-fno-rtti])
+fi
+
AX_APPEND_COMPILE_FLAGS([-ffast-math])
AX_APPEND_COMPILE_FLAGS([-ftree-vectorize])
AC_LANG_POP
@@ -1520,6 +1828,10 @@ results(ipv6, "IPv6")
results(tcp, "TCP")
results(un,[UNIX Domain Sockets])
+printf '\nStorage support:\n\t'
+results(nfs, [NFS])
+results(smbclient, [SMB])
+
printf '\nFile format support:\n\t'
results(aac, [AAC])
results(adplug, [AdPlug])
@@ -1546,6 +1858,7 @@ results(wildmidi, [WildMidi])
printf '\nOther features:\n\t'
results(lsr, [libsamplerate])
+results(soxr, [libsoxr])
results(libmpdclient, [libmpdclient])
results(inotify, [inotify])
results(sqlite, [SQLite])
@@ -1579,6 +1892,7 @@ if
printf '\nStreaming encoder support:\n\t'
results(flac_encoder, [FLAC])
results(lame_encoder, [LAME])
+ results(shine_encoder, [Shine])
results(vorbis_encoder, [Ogg Vorbis])
results(opus, [Opus])
results(twolame_encoder, [TwoLAME])
@@ -1588,11 +1902,15 @@ fi
printf '\nStreaming support:\n\t'
results(cdio_paranoia, [CDIO_PARANOIA])
results(curl,[CURL])
+results(smbclient,[SMBCLIENT])
results(despotify,[Despotify])
results(soundcloud,[Soundcloud])
printf '\n\t'
results(mms,[MMS])
+printf '\nEvent loop:\n\t'
+printf $with_pollmethod
+
printf '\n\n##########################################\n\n'
echo 'Generating files needed for compilation'
@@ -1602,7 +1920,7 @@ dnl Generate files
dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(doc/doxygen.conf)
-AC_CONFIG_FILES(mpd.service)
+AC_CONFIG_FILES(systemd/mpd.service)
AC_OUTPUT
echo 'MPD is ready for compilation, type "make" to begin.'