aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac219
1 files changed, 123 insertions, 96 deletions
diff --git a/configure.ac b/configure.ac
index fa2ec19ac..2816a2b48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,13 +1,13 @@
AC_PREREQ(2.60)
-AC_INIT(mpd, 0.17.5, musicpd-dev-team@lists.sourceforge.net)
+AC_INIT(mpd, 0.18~git, musicpd-dev-team@lists.sourceforge.net)
VERSION_MAJOR=0
-VERSION_MINOR=17
+VERSION_MINOR=18
VERSION_REVISION=0
VERSION_EXTRA=0
-AC_CONFIG_SRCDIR([src/main.c])
+AC_CONFIG_SRCDIR([src/Main.cxx])
AM_INIT_AUTOMAKE([foreign 1.11 dist-bzip2 dist-xz subdir-objects])
AM_SILENT_RULES
AC_CONFIG_HEADERS(config.h)
@@ -28,22 +28,6 @@ AN_PROGRAM([ar], [AC_PROG_AR])
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
AC_PROG_AR
-HAVE_CXX=yes
-if test x$CXX = xg++; then
- # CXX=g++ probably means that autoconf hasn't found any C++
- # compiler; to be sure, we check again
- AC_PATH_PROG(CXX, $CXX, no)
- if test x$CXX = xno; then
- # no, we don't have C++ - the following hack is
- # required because automake insists on using $(CXX)
- # for linking the MPD binary
- AC_MSG_NOTICE([Disabling C++ support])
- CXX="$CC"
- HAVE_CXX=no
- fi
-fi
-AM_CONDITIONAL(HAVE_CXX, test x$HAVE_CXX = xyes)
-
AC_PROG_INSTALL
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
@@ -87,7 +71,8 @@ mingw32* | windows*)
src/win/mpd_win32_rc.rc
])
AC_CHECK_TOOL(WINDRES, windres)
- AM_CPPFLAGS="$AM_CPPFLAGS -DWINVER=0x0501"
+ 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
;;
@@ -131,6 +116,19 @@ if test -z "$prefix" || test "x$prefix" = xNONE; then
fi
dnl ---------------------------------------------------------------------------
+dnl Language Checks
+dnl ---------------------------------------------------------------------------
+
+AC_CXX_COMPILE_STDCXX_0X
+if test "$ax_cv_cxx_compile_cxx0x_native" != yes; then
+ if test "$ax_cv_cxx_compile_cxx0x_gxx" = yes; then
+ AM_CXXFLAGS="$AM_CXXFLAGS -std=gnu++0x"
+ elif test "$ax_cv_cxx_compile_cxx0x_cxx" = yes; then
+ AM_CXXFLAGS="$AM_CXXFLAGS -std=c++0x"
+ fi
+fi
+
+dnl ---------------------------------------------------------------------------
dnl Header/Library Checks
dnl ---------------------------------------------------------------------------
AC_CHECK_FUNCS(daemon fork)
@@ -141,7 +139,7 @@ AC_SEARCH_LIBS([syslog], [bsd socket inet],
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([gethostbyname], [nsl])
-AC_CHECK_FUNCS(pipe2 accept4)
+AC_CHECK_FUNCS(pipe2 accept4 eventfd)
AC_SEARCH_LIBS([exp], [m],,
[AC_MSG_ERROR([exp() not found])])
@@ -152,6 +150,17 @@ AC_CHECK_HEADERS(valgrind/memcheck.h)
dnl ---------------------------------------------------------------------------
dnl Allow tools to be specifically built
dnl ---------------------------------------------------------------------------
+
+AC_ARG_ENABLE(libmpdclient,
+ AS_HELP_STRING([--enable-libmpdclient],
+ [enable support for the MPD client]),,
+ enable_libmpdclient=auto)
+
+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=auto])
@@ -186,11 +195,6 @@ AC_ARG_ENABLE(curl,
[enable support for libcurl HTTP streaming (default: auto)]),,
[enable_curl=auto])
-AC_ARG_ENABLE(soup,
- AS_HELP_STRING([--enable-soup],
- [enable support for libsoup HTTP streaming (default: auto)]),,
- [enable_soup=auto])
-
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging (default: disabled)]),,
@@ -201,10 +205,6 @@ AC_ARG_ENABLE(documentation,
[build documentation (default: disable)]),,
[enable_documentation=no])
-AC_ARG_ENABLE(ffado,
- AS_HELP_STRING([--enable-ffado], [enable libffado (FireWire) support]),,
- [enable_ffado=no])
-
AC_ARG_ENABLE(ffmpeg,
AS_HELP_STRING([--enable-ffmpeg],
[enable FFMPEG support]),,
@@ -321,16 +321,16 @@ AC_ARG_ENABLE(mpg123,
[enable libmpg123 decoder plugin]),,
enable_mpg123=auto)
-AC_ARG_ENABLE(mvp,
- AS_HELP_STRING([--enable-mvp],
- [enable support for Hauppauge Media MVP (default: disable)]),,
- enable_mvp=no)
-
AC_ARG_ENABLE(openal,
AS_HELP_STRING([--enable-openal],
[enable OpenAL support (default: disable)]),,
enable_openal=no)
+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)]),,
@@ -461,8 +461,8 @@ AC_ARG_WITH(tremor-includes,
dnl ---------------------------------------------------------------------------
dnl Mandatory Libraries
dnl ---------------------------------------------------------------------------
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16 gthread-2.0],,
- [AC_MSG_ERROR([GLib 2.16 is required])])
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.24 gthread-2.0],,
+ [AC_MSG_ERROR([GLib 2.24 is required])])
if test x$GCC = xyes; then
# suppress warnings in the GLib headers
@@ -542,6 +542,15 @@ dnl ---------------------------------------------------------------------------
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)
+
dnl --------------------------------- inotify ---------------------------------
AC_CHECK_FUNCS(inotify_init inotify_init1)
@@ -557,6 +566,27 @@ AM_CONDITIONAL(ENABLE_INOTIFY, test x$enable_inotify = xyes)
dnl --------------------------------- libwrap ---------------------------------
if test x$enable_libwrap != xno; then
AC_CHECK_LIBWRAP(found_libwrap=yes, found_libwrap=no)
+
+ if test x$found_libwrap = xyes; then
+ dnl See if libwrap is compatible with C++; it is
+ dnl broken on many systems
+ AC_MSG_CHECKING(whether libwrap is compatible with C++)
+ AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ #include <tcpd.h>
+ bool CheckLibWrap(int fd, const char &progname) {
+ struct request_info req;
+ request_init(&req, RQ_FILE, fd, RQ_DAEMON, progname, 0);
+ fromhost(&req);
+ return hosts_access(&req);
+ }
+ ])],
+ AC_MSG_RESULT([yes]),
+ [found_libwrap=no; AC_MSG_RESULT([no]);
+ AC_MSG_WARN([Your version of libwrap is broken with C++])])
+ AC_LANG_POP
+ fi
+
MPD_AUTO_RESULT(libwrap, libwrap, [libwrap not found])
fi
@@ -674,21 +704,13 @@ dnl Input Plugins
dnl ---------------------------------------------------------------------------
dnl ----------------------------------- CURL ----------------------------------
-MPD_AUTO_PKG(curl, CURL, [libcurl],
+MPD_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 ----------------------------------- SOUP ----------------------------------
-MPD_AUTO_PKG(soup, SOUP, [libsoup-2.4],
- [libsoup HTTP streaming], [libsoup not found])
-if test x$enable_soup = xyes; then
- AC_DEFINE(ENABLE_SOUP, 1, [Define when libsoup is used for HTTP streaming])
-fi
-AM_CONDITIONAL(ENABLE_SOUP, test x$enable_soup = xyes)
-
dnl --------------------------------- Last.FM ---------------------------------
if test x$enable_lastfm = xyes; then
if test x$enable_curl != xyes; then
@@ -811,6 +833,14 @@ dnl ---------------------------------------------------------------------------
dnl Decoder Plugins
dnl ---------------------------------------------------------------------------
+dnl -------------------------------- libadplug --------------------------------
+MPD_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.1.7],
[audiofile decoder plugin], [libaudiofile not found])
@@ -823,10 +853,9 @@ dnl ----------------------------------- FAAD ----------------------------------
AM_PATH_FAAD()
AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes)
-AM_CONDITIONAL(HAVE_MP4, test x$enable_mp4 = xyes)
dnl ---------------------------------- ffmpeg ---------------------------------
-MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat >= 52.31 libavcodec >= 52.20 libavutil >= 49.15],
+MPD_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
@@ -837,7 +866,7 @@ AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes)
dnl ----------------------------------- FLAC ----------------------------------
-MPD_AUTO_PKG(flac, FLAC, [flac >= 1.1],
+MPD_AUTO_PKG(flac, FLAC, [flac >= 1.2],
[FLAC decoder], [libFLAC not found])
if test x$enable_flac = xyes; then
@@ -904,9 +933,6 @@ fi
AM_CONDITIONAL(ENABLE_MIKMOD_DECODER, test x$enable_mikmod = xyes)
dnl -------------------------------- libmodplug -------------------------------
-found_modplug=$HAVE_CXX
-MPD_AUTO_PRE(modplug, [modplug decoder plugin], [No C++ compiler found])
-
MPD_AUTO_PKG(modplug, MODPLUG, [libmodplug],
[modplug decoder plugin], [libmodplug not found])
@@ -915,6 +941,14 @@ if test x$enable_modplug = xyes; then
fi
AM_CONDITIONAL(HAVE_MODPLUG, test x$enable_modplug = xyes)
+dnl -------------------------------- libopus ----------------------------------
+MPD_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],
@@ -937,16 +971,7 @@ if test x$enable_mpc = xyes; then
LIBS=$oldlibs
CPPFLAGS=$oldcppflags
- if test x$enable_mpc = xyes; then
- AC_CHECK_HEADER([mpc/mpcdec.h],
- [AC_DEFINE(HAVE_MPCDEC,1,
- [Define to use libmpcdec for MPC decoding])],
- [AC_CHECK_HEADER(mpcdec/mpcdec.h,
- [AC_DEFINE(MPC_IS_OLD_API, 1,
- [Define if an old pre-SV8 libmpcdec is used])]
- )]
- )
- else
+ if test x$enable_mpc != xyes; then
AC_MSG_WARN([mpcdec lib needed for MPC support -- disabling MPC support])
fi
fi
@@ -1020,9 +1045,6 @@ fi
AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes || test x$enable_tremor = xyes)
dnl --------------------------------- sidplay ---------------------------------
-found_sidplay=$HAVE_CXX
-MPD_AUTO_PRE(sidplay, [sidplay decoder plugin], [No C++ compiler found])
-
if test x$enable_sidplay != xno; then
# we're not using pkg-config here
# because libsidplay2's .pc file requires libtool
@@ -1097,9 +1119,9 @@ if
test x$enable_mad = xno &&
test x$enable_mikmod = xno; then
test x$enable_modplug = xno &&
- test x$enable_mp4 = xno &&
test x$enable_mpc = xno &&
test x$enable_mpg123 = xno &&
+ test x$enable_opus = xno &&
test x$enable_sidplay = xno &&
test x$enable_tremor = xno &&
test x$enable_vorbis = xno &&
@@ -1109,11 +1131,8 @@ if
AC_MSG_ERROR([No input plugins supported!])
fi
-AM_CONDITIONAL(HAVE_OGG_COMMON,
- test x$enable_vorbis = xyes || test x$enable_tremor = xyes || test x$enable_flac = xyes)
-
-AM_CONDITIONAL(HAVE_FLAC_COMMON,
- test x$enable_flac = xyes)
+AM_CONDITIONAL(HAVE_XIPH,
+ test x$enable_vorbis = xyes || test x$enable_tremor = xyes || test x$enable_flac = xyes || test x$enable_opus = xyes)
dnl ---------------------------------------------------------------------------
dnl Encoders for Streaming Audio Output Plugins
@@ -1201,6 +1220,7 @@ fi
dnl --------------------------- encoder plugins test --------------------------
if test x$enable_vorbis_encoder != xno ||
+ test x$enable_opus != xno ||
test x$enable_lame_encoder != xno ||
test x$enable_twolame_encoder != xno ||
test x$enable_flac_encoder != xno ||
@@ -1246,17 +1266,6 @@ fi
AM_CONDITIONAL(HAVE_ROAR, test x$enable_roar = xyes)
-dnl ----------------------------------- FFADO ---------------------------------
-
-MPD_AUTO_PKG(ffado, FFADO, [libffado],
- [libffado output plugin], [libffado not found])
-
-if test x$enable_ffado = xyes; then
- AC_DEFINE(ENABLE_FFADO_OUTPUT, 1, [Define to enable the libffado output plugin])
-fi
-
-AM_CONDITIONAL(ENABLE_FFADO_OUTPUT, test x$enable_ffado = xyes)
-
dnl ----------------------------------- FIFO ----------------------------------
if test x$enable_fifo = xyes; then
AC_CHECK_FUNC([mkfifo],
@@ -1312,13 +1321,6 @@ fi
AM_CONDITIONAL(HAVE_AO, test x$enable_ao = xyes)
-dnl ----------------------------------- MVP -----------------------------------
-if test x$enable_mvp = xyes; then
- AC_DEFINE(HAVE_MVP,1,[Define to enable Hauppauge Media MVP support])
-fi
-
-AM_CONDITIONAL(HAVE_MVP, test x$enable_mvp = xyes)
-
dnl ---------------------------------- OpenAL ---------------------------------
AC_SUBST(OPENAL_CFLAGS,"")
AC_SUBST(OPENAL_LIBS,"")
@@ -1454,11 +1456,9 @@ if
test x$enable_alsa = xno &&
test x$enable_roar = xno &&
test x$enable_ao = xno &&
- test x$enable_ffado = xno &&
test x$enable_fifo = xno &&
test x$enable_httpd_output = xno &&
test x$enable_jack = xno &&
- test x$enable_mvp = xno &&
test x$enable_openal = xno &&
test x$enable_oss = xno &&
test x$enable_osx = xno &&
@@ -1504,6 +1504,22 @@ dnl ---------------------------------------------------------------------------
dnl ---------------------------------- debug ----------------------------------
if test "x$enable_debug" = xno; then
AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG"
+
+ AX_APPEND_COMPILE_FLAGS([-ffunction-sections])
+ AX_APPEND_COMPILE_FLAGS([-fdata-sections])
+ AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
+
+ AC_LANG_PUSH([C++])
+ AX_APPEND_COMPILE_FLAGS([-ffunction-sections])
+ AX_APPEND_COMPILE_FLAGS([-fdata-sections])
+ 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])
+ AC_LANG_POP
+
+ AX_APPEND_LINK_FLAGS([-Wl,--gc-sections])
fi
dnl ----------------------------------- GCC -----------------------------------
@@ -1518,6 +1534,17 @@ then
AX_APPEND_COMPILE_FLAGS([-Wcast-qual])
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
AX_APPEND_COMPILE_FLAGS([-pedantic])
+
+ AC_LANG_PUSH([C++])
+ AX_APPEND_COMPILE_FLAGS([-Wall])
+ AX_APPEND_COMPILE_FLAGS([-Wextra])
+ AX_APPEND_COMPILE_FLAGS([-Wmissing-declarations])
+ AX_APPEND_COMPILE_FLAGS([-Wshadow])
+ AX_APPEND_COMPILE_FLAGS([-Wpointer-arith])
+ AX_APPEND_COMPILE_FLAGS([-Wcast-qual])
+ AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
+ AX_APPEND_COMPILE_FLAGS([-Wsign-compare])
+ AC_LANG_POP
fi
dnl ---------------------------- warnings as errors ---------------------------
@@ -1550,20 +1577,21 @@ results(un,[UNIX Domain Sockets])
printf '\nFile format support:\n\t'
results(aac, [AAC])
+results(adplug, [AdPlug])
results(sidplay, [C64 SID])
results(ffmpeg, [FFMPEG])
results(flac, [FLAC])
results(fluidsynth, [FluidSynth])
results(gme, [GME])
-results(sndfile, [libsndfile])
printf '\n\t'
+results(sndfile, [libsndfile])
results(mikmod, [MikMod])
results(modplug, [MODPLUG])
results(mad, [MAD])
results(mpg123, [MPG123])
-results(mp4, [MP4])
results(mpc, [Musepack])
printf '\n\t'
+results(opus, [Opus])
results(tremor, [OggTremor])
results(vorbis, [OggVorbis])
results(audiofile, [WAVE])
@@ -1572,6 +1600,7 @@ results(wildmidi, [WildMidi])
printf '\nOther features:\n\t'
results(lsr, [libsamplerate])
+results(libmpdclient, [libmpdclient])
results(inotify, [inotify])
results(sqlite, [SQLite])
@@ -1580,14 +1609,12 @@ results(id3,[ID3])
printf '\nPlayback support:\n\t'
results(alsa,ALSA)
-results(ffado,FFADO)
results(fifo,FIFO)
results(recorder_output,[File Recorder])
results(httpd_output,[HTTP Daemon])
results(jack,[JACK])
printf '\n\t'
results(ao,[libao])
-results(mvp, [Media MVP])
results(oss,[OSS])
results(openal,[OpenAL])
results(osx, [OS X])
@@ -1607,6 +1634,7 @@ if
results(flac_encoder, [FLAC])
results(lame_encoder, [LAME])
results(vorbis_encoder, [Ogg Vorbis])
+ results(opus, [Opus])
results(twolame_encoder, [TwoLAME])
results(wave_encoder, [WAVE])
fi
@@ -1619,7 +1647,6 @@ results(lastfm,[Last.FM])
results(soundcloud,[Soundcloud])
printf '\n\t'
results(mms,[MMS])
-results(soup, [SOUP])
printf '\n\n##########################################\n\n'