diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 222 |
1 files changed, 169 insertions, 53 deletions
diff --git a/configure.ac b/configure.ac index b2e952808..eb63735ce 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,80 @@ 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(eventloop, + AS_HELP_STRING( + [--with-eventloop=@<:@glib|internal|auto@:>@], + [specify event loop implementation (default=auto)]),, + [with_eventloop=auto]) + +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_eventloop" = xauto; then + if + test "x$enable_epoll" = xyes || + test "x$host_is_windows" = xyes; then + with_eventloop=internal + else + with_eventloop=glib + fi +fi + +case "$with_eventloop" in +glib) + AC_DEFINE(USE_GLIB_EVENTLOOP, 1, + [Define to use GLib event loop]) + ;; +internal) + AC_DEFINE(USE_INTERNAL_EVENTLOOP, 1, + [Define to use internal event loop]) + ;; +*) + AC_MSG_ERROR([unknown eventloop option: $with_eventloop]) + ;; +esac + +if test "x$with_eventloop" = xinternal; then + 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 +fi + +dnl --------------------------------------------------------------------------- dnl Allow tools to be specifically built dnl --------------------------------------------------------------------------- @@ -172,7 +268,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 +300,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 +396,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]),, @@ -379,7 +485,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 +495,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 +520,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 +576,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 +631,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 @@ -692,21 +803,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 +832,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]) @@ -1376,18 +1496,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 +1504,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 +1678,7 @@ results(wildmidi, [WildMidi]) printf '\nOther features:\n\t' results(lsr, [libsamplerate]) +results(soxr, [libsoxr]) results(libmpdclient, [libmpdclient]) results(inotify, [inotify]) results(sqlite, [SQLite]) @@ -1616,11 +1721,22 @@ 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' +case $with_eventloop in +glib) + printf 'GLib' + ;; +internal) + printf 'Internal (%s)' $with_pollmethod + ;; +esac + printf '\n\n##########################################\n\n' echo 'Generating files needed for compilation' |