diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 75 |
1 files changed, 51 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index f9062934f..2756f5448 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,9 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.17.2~git, 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 @@ -23,22 +23,6 @@ AC_PROG_CC_C99 AC_PROG_CXX AC_PROG_RANLIB -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 @@ -126,6 +110,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) @@ -147,6 +144,12 @@ AC_CHECK_HEADERS(valgrind/memcheck.h) dnl --------------------------------------------------------------------------- dnl Allow tools to be specifically built dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(mpdclient, + AS_HELP_STRING([--enable-libmpdclient], + [enable support for the MPD client]),, + enable_libmpdclient=auto) + AC_ARG_ENABLE(alsa, AS_HELP_STRING([--enable-alsa], [enable ALSA support]),, [enable_alsa=auto]) @@ -537,6 +540,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) @@ -899,9 +911,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]) @@ -1010,9 +1019,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 @@ -1494,6 +1500,16 @@ 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]) + + AC_LANG_PUSH([C++]) + AX_APPEND_COMPILE_FLAGS([-ffunction-sections]) + AX_APPEND_COMPILE_FLAGS([-fdata-sections]) + AC_LANG_POP + + AX_APPEND_LINK_FLAGS([-Wl,--gc-sections]) fi dnl ----------------------------------- GCC ----------------------------------- @@ -1508,6 +1524,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 --------------------------- |