diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 291 |
1 files changed, 248 insertions, 43 deletions
diff --git a/configure.ac b/configure.ac index dcb8a1824..93f062068 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.15.7~git, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.16~git, musicpd-dev-team@lists.sourceforge.net) AC_CONFIG_SRCDIR([src/main.c]) -AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2]) +AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects]) AM_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR([m4]) -AC_DEFINE(PROTOCOL_VERSION, "0.15.0", [The mpd protocol version]) +AC_DEFINE(PROTOCOL_VERSION, "0.16.0", [The MPD protocol version]) dnl @@ -100,7 +100,12 @@ dnl dnl libc features dnl -AC_CHECK_FUNCS(syslog) +AC_SYS_LARGEFILE +if test x$enable_largefile != xno; then + AC_DEFINE([ENABLE_LARGEFILE], 1, [Define if large file support is enabled]) +fi + +AC_CHECK_FUNCS(daemon fork syslog) if test $ac_cv_func_syslog = no; then # syslog is not in the default libraries. See if it's in some other. for lib in bsd socket inet; do @@ -113,18 +118,34 @@ fi AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",) AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",) +AC_CHECK_FUNCS(pipe2 accept4) + AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",) AC_CHECK_HEADERS(locale.h) AC_CHECK_HEADERS(valgrind/memcheck.h) +AC_CHECK_FUNCS(inotify_init inotify_init1) +AC_ARG_ENABLE(inotify, + AS_HELP_STRING([--disable-inotify], + [disable support Inotify automatic database update (default: enabled) ]),, + [enable_inotify=yes]) + +if test x$ac_cv_func_inotify_init = xno; then + enable_inotify=no +fi + +if test x$enable_inotify = xyes; then + AC_DEFINE([ENABLE_INOTIFY], 1, [Define to enable inotify support]) +fi +AM_CONDITIONAL(ENABLE_INOTIFY, test x$enable_inotify = xyes) dnl dnl mandatory libraries dnl -PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.6 gthread-2.0],, - [AC_MSG_ERROR([glib-2.6 is required])]) +PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.12 gthread-2.0],, + [AC_MSG_ERROR([GLib 2.12 is required])]) dnl @@ -268,6 +289,7 @@ fi AM_CONDITIONAL(ENABLE_SQLITE, test x$enable_sqlite = xyes) + dnl dnl input plugins dnl @@ -280,9 +302,9 @@ AC_ARG_ENABLE(curl, MPD_AUTO_PKG(curl, CURL, [libcurl], [libcurl HTTP streaming], [libcurl not found]) if test x$enable_curl = xyes; then - AC_DEFINE(HAVE_CURL, 1, [Define when libcurl is used for HTTP streaming]) + AC_DEFINE(ENABLE_CURL, 1, [Define when libcurl is used for HTTP streaming]) fi -AM_CONDITIONAL(HAVE_CURL, test x$enable_curl = xyes) +AM_CONDITIONAL(ENABLE_CURL, test x$enable_curl = xyes) AC_ARG_ENABLE(lastfm, AS_HELP_STRING([--enable-lastfm], @@ -389,12 +411,17 @@ dnl dnl decoder plugins dnl - - AC_ARG_ENABLE(audiofile, - AS_HELP_STRING([--disable-audiofile], - [disable audiofile support, disables wave support (default: enable)]),, - enable_audiofile=yes) + AS_HELP_STRING([--enable-audiofile], + [enable audiofile support (WAV and others)]),, + enable_audiofile=auto) + +MPD_AUTO_PKG(audiofile, AUDIOFILE, [audiofile >= 0.1.7], + [audiofile decoder plugin], [libaudiofile not found]) +AM_CONDITIONAL(HAVE_AUDIOFILE, test x$enable_audiofile = xyes) +if test x$enable_audiofile = xyes; then + AC_DEFINE(HAVE_AUDIOFILE, 1, [Define for audiofile support]) +fi AC_ARG_ENABLE(ffmpeg, AS_HELP_STRING([--enable-ffmpeg], @@ -422,6 +449,18 @@ if test x$enable_mad = xyes; then fi AM_CONDITIONAL(HAVE_MAD, test x$enable_mad = xyes) +AC_ARG_ENABLE(mpg123, + AS_HELP_STRING([--enable-mpg123], + [enable libmpg123 decoder plugin]),, + enable_mpg123=auto) + +MPD_AUTO_PKG(mpg123, MPG123, [libmpg123], + [libmpg123 decoder plugin], [libmpg123 not found]) +if test x$enable_mpg123 = xyes; then + AC_DEFINE(HAVE_MPG123, 1, [Define to use libmpg123]) +fi +AM_CONDITIONAL(HAVE_MPG123, test x$enable_mpg123 = xyes) + AC_ARG_ENABLE(mikmod, AS_HELP_STRING([--enable-mikmod], [enable the mikmod decoder (default: disable)]),, @@ -470,6 +509,27 @@ AC_ARG_ENABLE(vorbis, [disable Ogg Vorbis support (default: enable)]),, enable_vorbis=yes) +AC_ARG_ENABLE(sndfile, + AS_HELP_STRING([--enable-sndfile], + [enable sndfile support]),, + enable_sndfile=auto) + +if test x$enable_sndfile = xauto && test x$enable_modplug = xyes; then + dnl If modplug is enabled, enable sndfile only if explicitly + dnl requested - modplug's modplug/sndfile.h is known to + dnl conflict with libsndfile's sndfile.h. + AC_MSG_NOTICE([disabling libsndfile auto-detection, because the modplug decoder is enabled]) + enable_sndfile=no +fi + +MPD_AUTO_PKG(sndfile, SNDFILE, [sndfile], + [libsndfile decoder plugin], [libsndfile not found]) +AM_CONDITIONAL(ENABLE_SNDFILE, test x$enable_sndfile = xyes) +if test x$enable_sndfile = xyes; then + AC_DEFINE(ENABLE_SNDFILE, 1, [Define to enable the sndfile decoder plugin]) +fi + + dnl ### dnl Ogg Tremor dnl ### @@ -516,12 +576,17 @@ if test x$enable_sidplay != xno; then # library name triggers an autoconf bug AC_CHECK_LIB(resid-builder, main, [found_sidplay=yes], [found_sidplay=no]) + + if test x$found_sidplay = xyes; then + AC_HAVE_LIBRARY(sidutils,, [found_sidplay=no]) + fi + MPD_AUTO_RESULT(sidplay, [sidplay decoder plugin], - [libresid-builder not found]) + [libresid-builder or libsidutils not found]) fi if test x$enable_sidplay = xyes; then - AC_SUBST(SIDPLAY_LIBS,"-lsidplay2 -lresid-builder") + AC_SUBST(SIDPLAY_LIBS,"-lsidplay2 -lresid-builder -lsidutils") AC_SUBST(SIDPLAY_CFLAGS,) AC_DEFINE(ENABLE_SIDPLAY, 1, [Define for libsidplay2 support]) @@ -540,9 +605,16 @@ AC_ARG_ENABLE(wildmidi, enable_wildmidi=no) AC_ARG_ENABLE(wavpack, - AS_HELP_STRING([--disable-wavpack], - [disable WavPack support (default: enable)]),, - enable_wavpack=yes) + AS_HELP_STRING([--enable-wavpack], + [enable WavPack support]),, + enable_wavpack=auto) + +MPD_AUTO_PKG(wavpack, WAVPACK, [wavpack], + [WavPack decoder plugin], [libwavpack not found]) +AM_CONDITIONAL(HAVE_WAVPACK, test x$enable_wavpack = xyes) +if test x$enable_wavpack = xyes; then + AC_DEFINE([HAVE_WAVPACK], 1, [Define to enable WavPack support]) +fi dnl @@ -585,6 +657,16 @@ AC_ARG_ENABLE(lame-encoder, [enable the LAME mp3 encoder]),, enable_lame_encoder=auto) +AC_ARG_ENABLE(twolame-encoder, + AS_HELP_STRING([--enable-twolame-encoder], + [enable the TwoLAME mp2 encoder]),, + enable_twolame_encoder=auto) + +AC_ARG_ENABLE(wave-encoder, + AS_HELP_STRING([--enable-wave-encoder], + [enable the PCM wave encoder]),, + enable_wave_encoder=yes) + dnl dnl audio output plugins @@ -628,7 +710,7 @@ AC_ARG_ENABLE(jack, [enable jack support]),, enable_jack=auto) -MPD_AUTO_PKG(jack, JACK, [jack >= 0.4], +MPD_AUTO_PKG(jack, JACK, [jack >= 0.100], [JACK output plugin], [libjack not found]) if test x$enable_jack = xyes; then AC_DEFINE([HAVE_JACK], 1, [Define to enable JACK support]) @@ -656,12 +738,17 @@ AC_ARG_ENABLE(oss, [disable OSS support (default: enable)]),, enable_oss=yes) +AC_ARG_ENABLE(openal, + AS_HELP_STRING([--enable-openal], + [enable OpenAL support (default: disable)]),, + enable_openal=no) + AC_ARG_ENABLE(pulse, AS_HELP_STRING([--enable-pulse], [enable support for the PulseAudio sound server]),, enable_pulse=auto) -MPD_AUTO_PKG(pulse, PULSE, [libpulse-simple], +MPD_AUTO_PKG(pulse, PULSE, [libpulse], [PulseAudio output plugin], [libpulse not found]) if test x$enable_pulse = xyes; then AC_DEFINE([HAVE_PULSE], 1, @@ -670,6 +757,11 @@ fi AM_CONDITIONAL(HAVE_PULSE, test x$enable_pulse = xyes) +AC_ARG_ENABLE(recorder-output, + AS_HELP_STRING([--enable-recorder-output], + [enables the recorder file output plugin (default: disable)]),, + [enable_recorder_output=auto]) + AC_ARG_ENABLE(httpd-output, AS_HELP_STRING([--enable-httpd-output], [enables the HTTP server output]),, @@ -719,6 +811,29 @@ fi AM_CONDITIONAL(HAVE_OSS, test x$enable_oss = xyes) +if test x$enable_openal = xyes; then + if test x$enable_osx = xyes; then + AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h], [], [enable_openal=no]) + if test x$enable_openal = xyes; then + OPENAL_LIBS="-framework OpenAL" + AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]) + else + AC_MSG_WARN(OpenAL headers not found -- disabling OpenAL support) + fi + else + PKG_CHECK_MODULES([OPENAL], [openal], + AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]), + enable_openal=no) + fi +fi + +if test x$enable_openal = xyes; then + MPD_CFLAGS="$MPD_CFLAGS $OPENAL_CFLAGS" + MPD_LIBS="$MPD_LIBS $OPENAL_LIBS" +fi + +AM_CONDITIONAL(HAVE_OPENAL, test x$enable_openal = xyes) + if test x$enable_fifo = xyes; then AC_CHECK_FUNC([mkfifo], [enable_fifo=yes;AC_DEFINE([HAVE_FIFO], 1, @@ -805,18 +920,6 @@ fi AM_CONDITIONAL(HAVE_MPCDEC, test x$enable_mpc = xyes) -if test x$enable_wavpack = xyes; then - PKG_CHECK_MODULES([WAVPACK], [wavpack], - [enable_wavpack=yes; - AC_DEFINE([HAVE_WAVPACK], 1, - [Define to enable WavPack support])] - MPD_LIBS="$MPD_LIBS $WAVPACK_LIBS" - MPD_CFLAGS="$MPD_CFLAGS $WAVPACK_CFLAGS", - enable_wavpack=no) -fi - -AM_CONDITIONAL(HAVE_WAVPACK, test x$enable_wavpack = xyes) - AM_PATH_FAAD() AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes) @@ -886,6 +989,8 @@ fi AM_CONDITIONAL(HAVE_FLAC, test x$enable_flac = xyes) +enable_flac_encoder=$enable_flac + if test x$enable_oggflac = xyes; then oldmpdcflags="$MPD_CFLAGS" oldmpdlibs="$MPD_LIBS" @@ -905,14 +1010,6 @@ AM_CONDITIONAL(HAVE_FLAC_COMMON, AM_CONDITIONAL(HAVE_OGG_COMMON, test x$enable_vorbis = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes) -if test x$enable_audiofile = xyes; then - PKG_CHECK_MODULES(AUDIOFILE, [audiofile >= 0.1.7], - AC_DEFINE(HAVE_AUDIOFILE, 1, [Define for audiofile support]), - enable_audiofile=no) -fi - -AM_CONDITIONAL(HAVE_AUDIOFILE, test x$enable_audiofile = xyes) - MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat libavcodec libavutil], [ffmpeg decoder library], [libavformat+libavcodec+libavutil not found]) @@ -974,10 +1071,14 @@ dnl dnl Encoder API and shout/httpd output plugin dnl -if test x$enable_shout = xyes || test x$enable_httpd_output = xyes; then +if test x$enable_shout = xyes || \ + test x$enable_recorder_output = xyes || \ + test x$enable_httpd_output = xyes; then # at least one output using encoders is explicitly enabled need_encoder=yes -elif test x$enable_shout = xauto || test x$enable_httpd_output = xauto; then +elif test x$enable_shout = xauto || \ + test x$enable_recorder_output = xauto || \ + test x$enable_httpd_output = xauto; then need_encoder=auto else # all outputs using encoders are disabled @@ -986,6 +1087,9 @@ else # don't bother to check for encoder plugins enable_vorbis_encoder=no enable_lame_encoder=no + enable_twolame_encoder=no + enable_wave_encoder=no + enable_flac_encoder=no fi MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc], @@ -1000,8 +1104,14 @@ fi AC_SUBST(LAME_CFLAGS) AC_SUBST(LAME_LIBS) +MPD_AUTO_PKG(twolame_encoder, TWOLAME, [twolame], + [TwoLAME encoder], [libtwolame not found]) + if test x$enable_vorbis_encoder != xno || - test x$enable_lame_encoder != xno; then + test x$enable_lame_encoder != xno || + test x$enable_twolame_encoder != xno || + test x$enable_flac_encoder != xno || + test x$enable_wave_encoder != xno; then # at least one encoder plugin is enabled enable_encoder=yes else @@ -1025,6 +1135,17 @@ if test x$enable_shout = xauto; then fi fi +if test x$enable_recorder_output = xauto; then + # handle recorder auto-detection: disable if no encoder is + # available + if test x$enable_encoder = xyes; then + enable_recorder_output=yes + else + AC_MSG_WARN([No encoder plugin -- disabling the recorder output plugin]) + enable_recorder_output=no + fi +fi + if test x$enable_httpd_output = xauto; then # handle HTTPD auto-detection: disable if no encoder is # available @@ -1041,12 +1162,21 @@ if test x$enable_shout = xyes; then AC_DEFINE(HAVE_SHOUT, 1, [Define to enable the shoutcast output]) fi +AM_CONDITIONAL(ENABLE_RECORDER_OUTPUT, test x$enable_recorder_output = xyes) +if test x$enable_recorder_output = xyes; then + AC_DEFINE(ENABLE_RECORDER_OUTPUT, 1, [Define to enable the recorder output]) +fi + AM_CONDITIONAL(ENABLE_HTTPD_OUTPUT, test x$enable_httpd_output = xyes) if test x$enable_httpd_output = xyes; then AC_DEFINE(ENABLE_HTTPD_OUTPUT, 1, [Define to enable the HTTP server output]) fi AM_CONDITIONAL(ENABLE_ENCODER, test x$enable_encoder = xyes) +if test x$enable_encoder = xyes; then + AC_DEFINE(ENABLE_ENCODER, 1, + [Define to enable the encoder plugins]) +fi AM_CONDITIONAL(ENABLE_VORBIS_ENCODER, test x$enable_vorbis_encoder = xyes) if test x$enable_vorbis_encoder = xyes; then @@ -1060,6 +1190,23 @@ if test x$enable_lame_encoder = xyes; then [Define to enable the lame encoder plugin]) fi +AM_CONDITIONAL(ENABLE_TWOLAME_ENCODER, test x$enable_twolame_encoder = xyes) +if test x$enable_twolame_encoder = xyes; then + AC_DEFINE(ENABLE_TWOLAME_ENCODER, 1, + [Define to enable the TwoLAME encoder plugin]) +fi + +AM_CONDITIONAL(ENABLE_WAVE_ENCODER, test x$enable_wave_encoder = xyes) +if test x$enable_wave_encoder = xyes; then + AC_DEFINE(ENABLE_WAVE_ENCODER, 1, + [Define to enable the PCM wave encoder plugin]) +fi + +AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes) +if test x$enable_flac_encoder = xyes; then + AC_DEFINE(ENABLE_FLAC_ENCODER, 1, + [Define to enable the FLAC encoder plugin]) +fi dnl dnl Documentation @@ -1196,6 +1343,12 @@ else echo " FIFO support ..................disabled" fi +if test x$enable_recorder_output = xyes; then + echo " File Recorder support .........enabled" +else + echo " File Recorder support .........disabled" +fi + if test x$enable_httpd_output = xyes; then echo " HTTP daemon support ...........enabled" else @@ -1220,6 +1373,12 @@ else echo " OSS support ...................disabled" fi +if test x$enable_openal = xyes; then + echo " OpenAL support ................enabled" +else + echo " OpenAL support ................disabled" +fi + if test x$enable_osx = xyes; then echo " OS X support ..................enabled" else @@ -1261,7 +1420,9 @@ echo "" if test x$enable_ao = xno && test x$enable_oss = xno && + test x$enable_openal = xno && test x$enable_shout = xno && + test x$enable_recorder_output = xno && test x$enable_httpd_output = xno && test x$enable_solaris_output = xno && test x$enable_alsa = xno && @@ -1276,6 +1437,7 @@ fi if test x$enable_shout = xyes || + test x$enable_recorder = xyes || test x$enable_httpd_output = xyes; then echo " Streaming Encoder Support:" if test x$enable_lame_encoder = xyes; then @@ -1289,6 +1451,25 @@ if else echo " Ogg Vorbis encoder ............disabled" fi + + if test x$enable_twolame_encoder = xyes; then + echo " TwoLAME mp3 encoder ...........enabled" + else + echo " TwoLAME mp3 encoder ...........disabled" + fi + + if test x$enable_flac_encoder = xyes; then + echo " FLAC encoder ..................enabled" + else + echo " FLAC encoder ..................disabled" + fi + + if test x$enable_wave_encoder = xyes; then + echo " PCM wave encoder ..............enabled" + else + echo " PCM wave encoder ..............disabled" + fi + echo "" fi @@ -1342,6 +1523,12 @@ else echo " MAD mp3 decoder support .......disabled" fi +if test x$enable_mpg123 = xyes; then + echo " libmpg123 decoder support .....enabled" +else + echo " libmpg123 decoder support .....disabled" +fi + if test x$enable_mp4 = xyes; then echo " MP4 support ...................enabled" else @@ -1377,6 +1564,12 @@ else echo " Ogg Vorbis support ............disabled" fi +if test x$enable_sndfile = xyes; then + echo " libsndfile ....................enabled" +else + echo " libsndfile ....................disabled" +fi + if test x$enable_audiofile = xyes; then echo " Wave file support .............enabled" else @@ -1399,6 +1592,7 @@ fi if test x$enable_mad = xno && + test x$enable_mpg123 = xno && test x$enable_vorbis = xno && test x$enable_flac = xno && test x$enable_oggflac = xno && @@ -1485,10 +1679,21 @@ else echo " libcue support ................disabled" fi +if test x$enable_inotify = xyes; then + echo " Inotify support (autoupdate) ..enabled" +else + echo " Inotify support (autoupdate) ..disabled" +fi + echo "" echo "##########################################" echo "" +if test x$enable_sndfile = xyes && test x$enable_modplug = xyes; then + AC_MSG_WARN([compilation may fail, because libmodplug conflicts with libsndfile]) + AC_MSG_WARN([libmodplug ships modplug/sndfile.h, which hides libsndfile's sndfile.h]) +fi + echo "Generating needed files for compilation" echo "" |