aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac131
1 files changed, 108 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac
index a7c18f784..1e3dfb098 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,9 @@
AC_PREREQ(2.60)
-AC_INIT(mpd, 0.18.6~git, 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
@@ -66,6 +66,7 @@ dnl ---------------------------------------------------------------------------
AC_CANONICAL_HOST
host_is_darwin=no
+host_is_windows=no
case "$host_os" in
mingw32* | windows*)
@@ -76,14 +77,14 @@ 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
;;
darwin*)
host_is_darwin=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=
@@ -146,9 +147,9 @@ AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_CHECK_FUNCS(pipe2 accept4)
+AC_CHECK_FUNCS(getpwnam_r getpwuid_r)
MPD_OPTIONAL_FUNC(eventfd, eventfd, USE_EVENTFD)
MPD_OPTIONAL_FUNC(signalfd, signalfd, USE_SIGNALFD)
-MPD_OPTIONAL_FUNC(epoll, epoll_create1, USE_EPOLL)
AC_SEARCH_LIBS([exp], [m],,
[AC_MSG_ERROR([exp() not found])])
@@ -157,6 +158,77 @@ AC_CHECK_HEADERS(locale.h)
AC_CHECK_HEADERS(valgrind/memcheck.h)
dnl ---------------------------------------------------------------------------
+dnl Event loop selection
+dnl ---------------------------------------------------------------------------
+
+MPD_OPTIONAL_FUNC_NODEF(poll, poll)
+MPD_OPTIONAL_FUNC_NODEF(epoll, epoll_create1)
+
+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 ---------------------------------------------------------------------------
@@ -295,6 +367,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]),,
@@ -692,21 +769,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
@@ -1396,17 +1474,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 +1648,7 @@ results(wildmidi, [WildMidi])
printf '\nOther features:\n\t'
results(lsr, [libsamplerate])
+results(soxr, [libsoxr])
results(libmpdclient, [libmpdclient])
results(inotify, [inotify])
results(sqlite, [SQLite])
@@ -1621,6 +1696,16 @@ 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'