diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 238 |
1 files changed, 185 insertions, 53 deletions
diff --git a/configure.ac b/configure.ac index 2cd0c7720..34fb4b1c1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,9 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.18.7, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.19~git, musicpd-dev-team@lists.sourceforge.net) VERSION_MAJOR=0 -VERSION_MINOR=18 +VERSION_MINOR=19 VERSION_REVISION=0 VERSION_EXTRA=0 @@ -13,7 +13,7 @@ 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]) dnl --------------------------------------------------------------------------- @@ -65,9 +65,20 @@ dnl OS Specific Defaults dnl --------------------------------------------------------------------------- AC_CANONICAL_HOST +host_is_unix=yes +host_is_linux=no host_is_darwin=no +host_is_solaris=no +host_is_windows=no + +linux_auto=no case "$host_os" in +linux*) + host_is_linux=yes + linux_auto=auto + ;; + mingw32* | windows*) AC_CONFIG_FILES([ src/win/mpd_win32_rc.rc @@ -76,14 +87,19 @@ 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([HAVE_WINDOWS], [test x$host_is_windows = xyes]) if test -z "$prefix" || test "x$prefix" = xNONE; then local_lib= @@ -145,10 +161,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])]) @@ -157,6 +179,48 @@ AC_CHECK_HEADERS(locale.h) AC_CHECK_HEADERS(valgrind/memcheck.h) 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 --------------------------------------------------------------------------- @@ -165,6 +229,16 @@ AC_ARG_ENABLE(libmpdclient, [enable support for the MPD client]),, enable_libmpdclient=auto) +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) + AC_ARG_ENABLE(adplug, AS_HELP_STRING([--enable-adplug], [enable the AdPlug decoder plugin (default: auto)]),, @@ -172,7 +246,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], @@ -204,6 +278,11 @@ AC_ARG_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(debug, AS_HELP_STRING([--enable-debug], [enable debugging (default: disabled)]),, @@ -295,6 +374,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]),, @@ -365,6 +449,10 @@ AC_ARG_ENABLE(sidplay, [enable C64 SID support via libsidplay2]),, enable_sidplay=auto) +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], @@ -379,7 +467,7 @@ 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], @@ -389,7 +477,7 @@ AC_ARG_ENABLE(sqlite, 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], @@ -414,7 +502,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], @@ -470,13 +558,24 @@ AC_ARG_WITH(tremor-includes, dnl --------------------------------------------------------------------------- dnl Mandatory Libraries dnl --------------------------------------------------------------------------- -PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28 gthread-2.0],, + +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 @@ -514,12 +613,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 @@ -560,6 +653,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) @@ -692,21 +794,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 @@ -720,6 +823,14 @@ if test x$enable_curl = xyes; then fi AM_CONDITIONAL(ENABLE_CURL, test x$enable_curl = xyes) +dnl ----------------------------------- smbclient ----------------------------- +MPD_AUTO_PKG(smbclient, SMBCLIENT, [smbclient >= 0.2], + [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 --------------------------------- Despotify --------------------------------- MPD_AUTO_PKG(despotify, DESPOTIFY, [despotify], [Despotify support], [despotify not found]) @@ -798,6 +909,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]) @@ -1127,6 +1256,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 @@ -1138,6 +1268,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], + [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], [Ogg Vorbis encoder], [libvorbisenc not found]) @@ -1181,6 +1322,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 @@ -1376,18 +1518,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 @@ -1396,17 +1526,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) @@ -1574,6 +1700,7 @@ results(wildmidi, [WildMidi]) printf '\nOther features:\n\t' results(lsr, [libsamplerate]) +results(soxr, [libsoxr]) results(libmpdclient, [libmpdclient]) results(inotify, [inotify]) results(sqlite, [SQLite]) @@ -1607,6 +1734,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]) @@ -1616,11 +1744,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' |