2 AC_INIT(mpd, 0.15.4, musicpd-dev-team@lists.sourceforge.net)
3 AC_CONFIG_SRCDIR([src/main.c])
4 AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2])
5 AM_CONFIG_HEADER(config.h)
6 AC_CONFIG_MACRO_DIR([m4])
8 AC_DEFINE(PROTOCOL_VERSION, "0.15.0", [The mpd protocol version])
19 if test x$CXX = xg++; then
20 # CXX=g++ probably means that autoconf hasn't found any C++
21 # compiler; to be sure, we check again
22 AC_PATH_PROG(CXX, $CXX, no)
23 if test x$CXX = xno; then
24 # no, we don't have C++ - the following hack is
25 # required because automake insists on using $(CXX)
26 # for linking the MPD binary
27 AC_MSG_NOTICE([Disabling C++ support])
42 AC_SUBST(AM_CFLAGS,"")
51 dnl OS specific defaults
58 MPD_LIBS="$MPD_LIBS -lws2_32"
62 if test -z "$prefix" || test "x$prefix" = xNONE; then
66 # aren't autotools supposed to be smart enough to figure this out? oh
67 # well, the git-core Makefile managed to do some of the work for us :)
70 local_lib='/sw/lib /opt/local/lib'
71 local_include='/sw/include /opt/local/include'
74 local_lib=/usr/local/lib
75 local_include=/usr/local/include
78 local_lib=/usr/pkg/lib
79 local_include=/usr/pkg/include
80 LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/pkg/lib"
84 for d in $local_lib; do
86 LDFLAGS="$LDFLAGS -L$d"
90 for d in $local_include; do
103 AC_CHECK_FUNCS(syslog)
104 if test $ac_cv_func_syslog = no; then
105 # syslog is not in the default libraries. See if it's in some other.
106 for lib in bsd socket inet; do
107 AC_CHECK_LIB($lib, syslog,
108 [AC_DEFINE(HAVE_SYSLOG)
109 LIBS="$LIBS -l$lib"; break])
113 AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
114 AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
116 AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)
118 AC_CHECK_HEADERS(locale.h)
119 AC_CHECK_HEADERS(valgrind/memcheck.h)
123 dnl mandatory libraries
126 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.6 gthread-2.0],,
127 [AC_MSG_ERROR([glib-2.6 is required])])
135 AS_HELP_STRING([--disable-tcp],
136 [disable support for clients connecting via TCP (default: enable)]),,
140 AS_HELP_STRING([--disable-ipv6],
141 [disable IPv6 support (default: enable)]),,
144 if test x$enable_tcp = xno; then
145 # if we don't support TCP, we don't need IPv6 either
149 if test x$enable_ipv6 = xyes; then
150 AC_MSG_CHECKING(for ipv6)
151 AC_EGREP_CPP([AP_maGiC_VALUE],
153 #include <sys/types.h>
154 #include <sys/socket.h>
162 AC_DEFINE(HAVE_IPV6, 1, [Define if IPv6 support present])
163 AC_MSG_RESULT([yes]),
168 if test x$enable_tcp = xyes; then
169 AC_DEFINE(HAVE_TCP, 1, [Define if TCP socket support is enabled])
173 AS_HELP_STRING([--disable-un],
174 [disable support for clients connecting via unix domain sockets (default: enable)]),,
177 if test x$enable_un = xyes; then
178 AC_DEFINE(HAVE_UN, 1, [Define if unix domain socket support is enabled])
188 AS_HELP_STRING([--enable-cue],
189 [enable support for libcue support]),,
192 MPD_AUTO_PKG(cue, CUE, [libcue],
193 [libcue parsing library], [libcue not found])
194 if test x$enable_cue = xyes; then
195 AC_DEFINE([HAVE_CUE], 1,
196 [Define to enable libcue support])
199 AM_CONDITIONAL(HAVE_CUE, test x$enable_cue = xyes)
204 AC_ARG_WITH(zeroconf,
205 AS_HELP_STRING([--with-zeroconf=@<:@auto|avahi|bonjour|no@:>@],
206 [enable zeroconf backend (default=auto)]),,
207 with_zeroconf="auto")
209 case $with_zeroconf in
217 if test x$with_zeroconf != xno; then
218 if test x$with_zeroconf = xavahi || test x$with_zeroconf = xauto; then
219 PKG_CHECK_MODULES([AVAHI], [avahi-client avahi-glib],
220 [found_avahi=1;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])]
221 MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS",
225 if test x$found_avahi = x1; then
227 elif test x$with_zeroconf = xavahi; then
228 AC_MSG_ERROR([Avahi support requested but not found])
231 if test x$with_zeroconf = xbonjour || test x$with_zeroconf = xauto; then
232 AC_CHECK_HEADER(dns_sd.h,
233 [found_bonjour=1;AC_DEFINE([HAVE_BONJOUR], 1, [Define to enable Bonjour Zeroconf support])],
235 AC_CHECK_LIB(dns_sd, DNSServiceRegister,
236 MPD_LIBS="$MPD_LIBS -ldns_sd")
239 if test x$found_bonjour = x1; then
240 with_zeroconf=bonjour
241 elif test x$with_zeroconf = xbonjour; then
242 AC_MSG_ERROR([Bonjour support requested but not found])
245 if test x$with_zeroconf = xauto; then
246 AC_MSG_WARN([No supported Zeroconf backend found, disabling Zeroconf])
249 AC_DEFINE([HAVE_ZEROCONF], 1, [Define to enable Zeroconf support])
253 AM_CONDITIONAL(HAVE_ZEROCONF, test x$with_zeroconf != xno)
254 AM_CONDITIONAL(HAVE_AVAHI, test x$with_zeroconf = xavahi)
255 AM_CONDITIONAL(HAVE_BONJOUR, test x$with_zeroconf = xbonjour)
257 AC_ARG_ENABLE(sqlite,
258 AS_HELP_STRING([--enable-sqlite],
259 [enable support for the SQLite database]),,
260 [enable_sqlite=auto])
262 MPD_AUTO_PKG(sqlite, SQLITE, [sqlite3],
263 [SQLite database support], [sqlite not found])
264 if test x$enable_sqlite = xyes; then
265 AC_DEFINE([ENABLE_SQLITE], 1, [Define to enable sqlite database support])
268 AM_CONDITIONAL(ENABLE_SQLITE, test x$enable_sqlite = xyes)
276 AS_HELP_STRING([--enable-curl],
277 [enable support for libcurl HTTP streaming (default: auto)]),,
280 MPD_AUTO_PKG(curl, CURL, [libcurl],
281 [libcurl HTTP streaming], [libcurl not found])
282 if test x$enable_curl = xyes; then
283 AC_DEFINE(HAVE_CURL, 1, [Define when libcurl is used for HTTP streaming])
285 AM_CONDITIONAL(HAVE_CURL, test x$enable_curl = xyes)
287 AC_ARG_ENABLE(lastfm,
288 AS_HELP_STRING([--enable-lastfm],
289 [enable support for last.fm radio (default: disable)]),,
292 if test x$enable_lastfm = xyes; then
293 if test x$enable_curl != xyes; then
294 AC_MSG_ERROR([Cannot enable last.fm radio without curl])
297 AC_DEFINE(ENABLE_LASTFM, 1, [Define when last.fm radio is enabled])
299 AM_CONDITIONAL(ENABLE_LASTFM, test x$enable_lastfm = xyes)
302 AS_HELP_STRING([--enable-mms],
303 [enable the MMS protocol with libmms]),,
306 MPD_AUTO_PKG(mms, MMS, [libmms],
307 [libmms mms:// protocol support], [libmms not found])
308 if test x$enable_mms = xyes; then
309 AC_DEFINE(ENABLE_MMS, 1,
310 [Define when libmms is used for the MMS protocol])
312 AM_CONDITIONAL(ENABLE_MMS, test x$enable_mms = xyes)
321 AS_HELP_STRING([--enable-bzip2],
322 [enable bzip2 archive support (default: disabled)]),,
325 if test x$enable_bzip2 = xyes; then
326 AC_CHECK_LIB(bz2, BZ2_bzDecompressInit,
327 [MPD_LIBS="$MPD_LIBS -lbz2"],
328 [AC_MSG_ERROR([libbz2 not found])])
331 AM_CONDITIONAL(HAVE_BZ2, test x$enable_bzip2 = xyes)
332 if test x$enable_bzip2 = xyes; then
333 AC_DEFINE(HAVE_BZ2, 1, [Define to have bz2 archive support])
338 AS_HELP_STRING([--enable-zip],
339 [enable zip archive support (default: disabled)]),,
342 MPD_AUTO_PKG(zip, ZZIP, [zziplib],
343 [libzzip archive library], [libzzip not found])
345 AM_CONDITIONAL(HAVE_ZIP, test x$enable_zip = xyes)
346 if test x$enable_zip = xyes; then
347 AC_DEFINE(HAVE_ZIP, 1, [Define to have zip archive support])
351 AC_ARG_ENABLE(iso9660,
352 AS_HELP_STRING([--enable-iso9660],
353 [enable iso9660 archive support (default: disabled)]),,
356 MPD_AUTO_PKG(iso9660, ISO9660, [libiso9660],
357 [libiso9660 archive library], [libiso9660 not found])
359 AM_CONDITIONAL(HAVE_ISO, test x$enable_iso9660 = xyes)
360 if test x$enable_iso9660 = xyes; then
361 AC_DEFINE(HAVE_ISO, 1, [Define to have iso archive support])
366 test x$enable_bzip2 = xyes ||
367 test x$enable_zip = xyes ||
368 test x$enable_iso9660 = xyes; then
370 AC_DEFINE(ENABLE_ARCHIVE, 1, [The archive API is available])
375 AM_CONDITIONAL(ENABLE_ARCHIVE, test x$enable_archive = xyes)
383 AS_HELP_STRING([--disable-id3],
384 [disable id3 support (default: enable)]),,
394 AC_ARG_ENABLE(audiofile,
395 AS_HELP_STRING([--disable-audiofile],
396 [disable audiofile support, disables wave support (default: enable)]),,
397 enable_audiofile=yes)
399 AC_ARG_ENABLE(ffmpeg,
400 AS_HELP_STRING([--enable-ffmpeg],
401 [enable FFMPEG support]),,
405 AS_HELP_STRING([--disable-flac],
406 [disable flac support (default: enable)]),,
414 AS_HELP_STRING([--enable-mad],
415 [enable libmad mp3 decoder plugin]),,
418 MPD_AUTO_PKG(mad, MAD, [mad],
419 [libmad MP3 decoder plugin], [libmad not found])
420 if test x$enable_mad = xyes; then
421 AC_DEFINE(HAVE_MAD, 1, [Define to use libmad])
423 AM_CONDITIONAL(HAVE_MAD, test x$enable_mad = xyes)
425 AC_ARG_ENABLE(mikmod,
426 AS_HELP_STRING([--enable-mikmod],
427 [enable the mikmod decoder (default: disable)]),,
430 if test x$enable_mikmod = xyes; then
431 AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config)
432 if test x$LIBMIKMOD_CONFIG != x ; then
433 AC_SUBST(LIBMIKMOD_CFLAGS, `$LIBMIKMOD_CONFIG --cflags`)
434 AC_SUBST(LIBMIKMOD_LIBS, `$LIBMIKMOD_CONFIG --libs`)
435 AC_DEFINE(ENABLE_MIKMOD_DECODER, 1, [Define for mikmod support])
441 AM_CONDITIONAL(ENABLE_MIKMOD_DECODER, test x$enable_mikmod = xyes)
443 AC_ARG_ENABLE(modplug,
444 AS_HELP_STRING([--enable-modplug],
445 [enable modplug decoder plugin]),,
448 found_modplug=$HAVE_CXX
449 MPD_AUTO_PRE(modplug, [modplug decoder plugin], [No C++ compiler found])
451 MPD_AUTO_PKG(modplug, MODPLUG, [libmodplug],
452 [modplug decoder plugin], [libmodplug not found])
453 AM_CONDITIONAL(HAVE_MODPLUG, test x$enable_modplug = xyes)
454 if test x$enable_modplug = xyes; then
455 AC_DEFINE(HAVE_MODPLUG, 1, [Define for modplug support])
459 AS_HELP_STRING([--disable-mpc],
460 [disable musepack (MPC) support (default: enable)]),,
463 AC_ARG_ENABLE(oggflac,
464 AS_HELP_STRING([--disable-oggflac],
465 [disable OggFLAC support (default: enable)]),,
468 AC_ARG_ENABLE(vorbis,
469 AS_HELP_STRING([--disable-vorbis],
470 [disable Ogg Vorbis support (default: enable)]),,
477 AS_HELP_STRING([--with-tremor=PFX],
478 [use Tremor (vorbisidec) integer Ogg Vorbis decoder (with optional prefix)]),,
481 if test x$with_tremor = xyes || test x$with_tremor = xno; then
482 use_tremor="$with_tremor"
484 tremor_prefix="$with_tremor"
488 AC_ARG_WITH(tremor-libraries,
489 AS_HELP_STRING([--with-tremor-libraries=DIR],
490 [directory where Tremor library is installed (optional)]),,
493 AC_ARG_WITH(tremor-includes,
494 AS_HELP_STRING([--with-tremor-includes=DIR],
495 [directory where Tremor header files are installed (optional)]),,
498 AC_ARG_ENABLE(sidplay,
499 AS_HELP_STRING([--enable-sidplay],
500 [enable C64 SID support via libsidplay2]),,
503 found_sidplay=$HAVE_CXX
504 MPD_AUTO_PRE(sidplay, [sidplay decoder plugin], [No C++ compiler found])
506 if test x$enable_sidplay != xno; then
507 # we're not using pkg-config here
508 # because libsidplay2's .pc file requires libtool
509 AC_HAVE_LIBRARY(sidplay2, [found_sidplay=yes], [found_sidplay=no])
510 MPD_AUTO_PRE(sidplay, [sidplay decoder plugin],
511 [libsidplay2 not found])
514 if test x$enable_sidplay != xno; then
515 # can't use AC_HAVE_LIBRARY here, because the dash in the
516 # library name triggers an autoconf bug
517 AC_CHECK_LIB(resid-builder, main,
518 [found_sidplay=yes], [found_sidplay=no])
519 MPD_AUTO_RESULT(sidplay, [sidplay decoder plugin],
520 [libresid-builder not found])
523 if test x$enable_sidplay = xyes; then
524 AC_SUBST(SIDPLAY_LIBS,"-lsidplay2 -lresid-builder")
525 AC_SUBST(SIDPLAY_CFLAGS,)
527 AC_DEFINE(ENABLE_SIDPLAY, 1, [Define for libsidplay2 support])
530 AM_CONDITIONAL(ENABLE_SIDPLAY, test x$enable_sidplay = xyes)
532 AC_ARG_ENABLE(fluidsynth,
533 AS_HELP_STRING([--enable-fluidsynth],
534 [enable MIDI support via fluidsynth (default: disable)]),,
535 enable_fluidsynth=no)
537 AC_ARG_ENABLE(wildmidi,
538 AS_HELP_STRING([--enable-wildmidi],
539 [enable MIDI support via wildmidi (default: disable)]),,
542 AC_ARG_ENABLE(wavpack,
543 AS_HELP_STRING([--disable-wavpack],
544 [disable WavPack support (default: enable)]),,
553 AS_HELP_STRING([--enable-lsr],
554 [enable libsamplerate support]),,
557 MPD_AUTO_PKG(lsr, SAMPLERATE, [samplerate >= 0.0.15],
558 [libsamplerate resampling], [libsamplerate not found])
559 if test x$enable_lsr = xyes; then
560 AC_DEFINE([HAVE_LIBSAMPLERATE], 1,
561 [Define to enable libsamplerate])
564 if test x$enable_lsr = xyes; then
565 PKG_CHECK_MODULES([SAMPLERATE_013],
566 [samplerate >= 0.1.3],,
567 [AC_DEFINE([HAVE_LIBSAMPLERATE_NOINT], 1,
568 [libsamplerate doesn't provide src_int_to_float_array() (<0.1.3)])])
571 AM_CONDITIONAL(HAVE_LIBSAMPLERATE, test x$enable_lsr = xyes)
578 AC_ARG_ENABLE(vorbis-encoder,
579 AS_HELP_STRING([--enable-vorbis-encoder],
580 [enable the Ogg Vorbis encoder]),,
581 [enable_vorbis_encoder=auto])
583 AC_ARG_ENABLE(lame-encoder,
584 AS_HELP_STRING([--enable-lame-encoder],
585 [enable the LAME mp3 encoder]),,
586 enable_lame_encoder=auto)
590 dnl audio output plugins
594 AS_HELP_STRING([--enable-alsa], [enable ALSA support]),,
598 AS_HELP_STRING([--enable-ao],
599 [enable support for libao]),,
602 MPD_AUTO_PKG(ao, AO, [ao],
603 [libao output plugin], [libao not found])
604 if test x$enable_ao = xyes; then
605 AC_DEFINE(HAVE_AO, 1, [Define to play with ao])
608 AM_CONDITIONAL(HAVE_AO, test x$enable_ao = xyes)
611 AS_HELP_STRING([--disable-fifo],
612 [disable support for writing audio to a FIFO (default: enable)]),,
615 AC_ARG_ENABLE(pipe-output,
616 AS_HELP_STRING([--enable-pipe-output],
617 [enable support for writing audio to a pipe (default: disable)]),,
618 enable_pipe_output=no)
620 if test x$enable_pipe_output = xyes; then
621 AC_DEFINE([ENABLE_PIPE_OUTPUT], 1,
622 [Define to enable support for writing audio to a pipe])
624 AM_CONDITIONAL(ENABLE_PIPE_OUTPUT, test x$enable_pipe_output = xyes)
627 AS_HELP_STRING([--enable-jack],
628 [enable jack support]),,
631 MPD_AUTO_PKG(jack, JACK, [jack >= 0.4],
632 [JACK output plugin], [libjack not found])
633 if test x$enable_jack = xyes; then
634 AC_DEFINE([HAVE_JACK], 1, [Define to enable JACK support])
637 if test x$enable_jack = xyes; then
638 # check whether jack_set_info_function() is available
640 LIBS="$LIBS $JACK_LIBS"
642 AC_CHECK_FUNCS(jack_set_info_function)
647 AM_CONDITIONAL(HAVE_JACK, test x$enable_jack = xyes)
650 AS_HELP_STRING([--enable-mvp],
651 [enable support for Hauppauge Media MVP (default: disable)]),,
655 AS_HELP_STRING([--disable-oss],
656 [disable OSS support (default: enable)]),,
660 AS_HELP_STRING([--enable-pulse],
661 [enable support for the PulseAudio sound server]),,
664 MPD_AUTO_PKG(pulse, PULSE, [libpulse-simple],
665 [PulseAudio output plugin], [libpulse not found])
666 if test x$enable_pulse = xyes; then
667 AC_DEFINE([HAVE_PULSE], 1,
668 [Define to enable PulseAudio support])
671 AM_CONDITIONAL(HAVE_PULSE, test x$enable_pulse = xyes)
673 AC_ARG_ENABLE(httpd-output,
674 AS_HELP_STRING([--enable-httpd-output],
675 [enables the HTTP server output]),,
676 [enable_httpd_output=auto])
681 AC_DEFINE(HAVE_OSX, 1, [Define for compiling OS X support])
682 MPD_LIBS="$MPD_LIBS -framework AudioUnit -framework CoreServices"
686 AM_CONDITIONAL(HAVE_OSX, test x$enable_osx = xyes)
689 AS_HELP_STRING([--enable-shout],
690 [enables the shoutcast streaming output]),,
693 enable_shout2="$enable_shout"
694 MPD_AUTO_PKG(shout, SHOUT, [shout],
695 [shout output plugin], [libshout not found])
696 if test x$enable_shout = xyes && test x$enable_shout2 = xauto; then
702 AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support])
703 enable_solaris_output=yes
707 enable_solaris_output=no
711 AM_CONDITIONAL(ENABLE_SOLARIS_OUTPUT, test x$enable_solaris_output = xyes)
713 if test x$enable_oss = xyes; then
714 AC_CHECK_HEADER(sys/soundcard.h,
715 [enable_oss=yes;AC_DEFINE(HAVE_OSS,1,[Define to enable OSS])],
716 [AC_MSG_WARN(Soundcard headers not found -- disabling OSS support);
720 AM_CONDITIONAL(HAVE_OSS, test x$enable_oss = xyes)
722 if test x$enable_fifo = xyes; then
723 AC_CHECK_FUNC([mkfifo],
724 [enable_fifo=yes;AC_DEFINE([HAVE_FIFO], 1,
725 [Define to enable support for writing audio to a FIFO])],
726 [enable_fifo=no;AC_MSG_WARN([mkfifo not found -- disabling support for writing audio to a FIFO])])
729 AM_CONDITIONAL(HAVE_FIFO, test x$enable_fifo = xyes)
731 if test x$enable_mvp = xyes; then
732 AC_DEFINE(HAVE_MVP,1,[Define to enable Hauppauge Media MVP support])
735 AM_CONDITIONAL(HAVE_MVP, test x$enable_mvp = xyes)
737 MPD_AUTO_PKG(alsa, ALSA, [alsa >= 0.9.0],
738 [ALSA output plugin], [libasound not found])
740 if test x$enable_alsa = xyes; then
741 AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support])
744 AM_CONDITIONAL(HAVE_ALSA, test x$enable_alsa = xyes)
746 if test x$enable_id3 = xyes; then
747 PKG_CHECK_MODULES([ID3TAG], [id3tag],,
748 AC_CHECK_LIB(id3tag, id3_file_open,
749 [ID3TAG_LIBS="-lid3tag -lz" ID3TAG_CFLAGS=""],
753 if test x$enable_id3 = xyes; then
754 AC_DEFINE(HAVE_ID3TAG, 1, [Define to use id3tag])
757 AM_CONDITIONAL(HAVE_ID3TAG, test x$enable_id3 = xyes)
759 if test x$enable_mpc = xyes; then
760 if test "x$mpcdec_libraries" != "x" ; then
761 MPCDEC_LIBS="-L$mpcdec_libraries"
762 elif test "x$mpcdec_prefix" != "x" ; then
763 MPCDEC_LIBS="-L$mpcdec_prefix/lib"
766 MPCDEC_LIBS="$MPCDEC_LIBS -lmpcdec"
768 if test "x$mpcdec_includes" != "x" ; then
769 MPCDEC_CFLAGS="-I$mpcdec_includes"
770 elif test "x$mpcdec_prefix" != "x" ; then
771 MPCDEC_CFLAGS="-I$mpcdec_prefix/include"
776 oldcppflags=$CPPFLAGS
777 CFLAGS="$CFLAGS $MPD_CFLAGS $MPCDEC_CFLAGS -I."
778 LIBS="$LIBS $MPD_LIBS $MPCDEC_LIBS"
780 AC_CHECK_HEADER(mpc/mpcdec.h,
782 [AC_CHECK_HEADER(mpcdec/mpcdec.h,
785 if test x$enable_mpc = xyes; then
786 AC_CHECK_LIB(mpcdec,main,
787 [MPD_LIBS="$MPD_LIBS $MPCDEC_LIBS";
788 MPD_CFLAGS="$MPD_CFLAGS $MPCDEC_CFLAGS";],
791 if test x$enable_mpc = xyes; then
792 AC_DEFINE(HAVE_MPCDEC,1,
793 [Define to use libmpcdec for MPC decoding])
794 if test x$old_mpcdec = xyes; then
795 AC_DEFINE(MPC_IS_OLD_API, 1,
796 [Define if an old pre-SV8 libmpcdec is used])
799 AC_MSG_WARN([mpcdec lib needed for MPC support -- disabling MPC support])
803 CPPFLAGS=$oldcppflags
806 AM_CONDITIONAL(HAVE_MPCDEC, test x$enable_mpc = xyes)
808 if test x$enable_wavpack = xyes; then
809 PKG_CHECK_MODULES([WAVPACK], [wavpack],
811 AC_DEFINE([HAVE_WAVPACK], 1,
812 [Define to enable WavPack support])]
813 MPD_LIBS="$MPD_LIBS $WAVPACK_LIBS"
814 MPD_CFLAGS="$MPD_CFLAGS $WAVPACK_CFLAGS",
818 AM_CONDITIONAL(HAVE_WAVPACK, test x$enable_wavpack = xyes)
822 AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes)
824 AM_CONDITIONAL(HAVE_MP4, test x$enable_mp4 = xyes)
826 if test x$use_tremor = xyes; then
827 if test "x$tremor_libraries" != "x" ; then
828 TREMOR_LIBS="-L$tremor_libraries"
829 elif test "x$tremor_prefix" != "x" ; then
830 TREMOR_LIBS="-L$tremor_prefix/lib"
832 TREMOR_LIBS="$TREMOR_LIBS -lvorbisidec"
833 if test "x$tremor_includes" != "x" ; then
834 TREMOR_CFLAGS="-I$tremor_includes"
835 elif test "x$tremor_prefix" != "x" ; then
836 TREMOR_CFLAGS="-I$tremor_prefix/include"
838 ac_save_CFLAGS="$CFLAGS"
840 CFLAGS="$CFLAGS $TREMOR_CFLAGS"
841 LIBS="$LIBS $TREMOR_LIBS"
842 AC_CHECK_LIB(vorbisidec,ov_read,enable_vorbis=yes,enable_vorbis=no;
843 AC_MSG_WARN([vorbisidec lib needed for ogg support with tremor -- disabling ogg support]))
844 CFLAGS="$ac_save_CFLAGS"
846 if test x$enable_vorbis = xyes; then
847 AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support])
849 elif test x$enable_vorbis = xyes; then
850 PKG_CHECK_MODULES(VORBIS, [ogg vorbis vorbisfile],
851 AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]),
855 AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes)
857 if test x$use_tremor = xyes; then
858 AC_DEFINE(HAVE_TREMOR,1,
859 [Define to use tremor (libvorbisidec) for ogg support])
860 if test x$enable_oggflac = xyes; then
861 AC_MSG_WARN([disabling OggFLAC support because it is incompatible with tremor])
866 AC_SUBST(TREMOR_CFLAGS)
867 AC_SUBST(TREMOR_LIBS)
869 if test x$enable_flac = xyes; then
870 PKG_CHECK_MODULES(FLAC, [flac >= 1.1],
871 AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support]),
876 CFLAGS="$CFLAGS $FLAC_CFLAGS"
877 LIBS="$LIBS $FLAC_LIBS"
878 if test x$enable_flac = xyes && test x$enable_oggflac = xyes; then
879 AC_CHECK_DECL(FLAC_API_SUPPORTS_OGG_FLAC,
880 [enable_oggflac=flac], [],
881 [#include <FLAC/export.h>])
887 AM_CONDITIONAL(HAVE_FLAC, test x$enable_flac = xyes)
889 if test x$enable_oggflac = xyes; then
890 oldmpdcflags="$MPD_CFLAGS"
891 oldmpdlibs="$MPD_LIBS"
892 AM_PATH_LIBOGGFLAC(MPD_LIBS="$MPD_LIBS $LIBOGGFLAC_LIBS"
893 MPD_CFLAGS="$MPD_CFLAGS $LIBOGGFLAC_CFLAGS",
897 if test x$enable_oggflac = xyes; then
898 AC_DEFINE(HAVE_OGGFLAC,1,[Define for OggFLAC support])
901 AM_CONDITIONAL(HAVE_OGGFLAC, test x$enable_oggflac = xyes)
903 AM_CONDITIONAL(HAVE_FLAC_COMMON,
904 test x$enable_flac = xyes || test x$enable_oggflac = xyes)
905 AM_CONDITIONAL(HAVE_OGG_COMMON,
906 test x$enable_vorbis = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes)
908 if test x$enable_audiofile = xyes; then
909 PKG_CHECK_MODULES(AUDIOFILE, [audiofile >= 0.1.7],
910 AC_DEFINE(HAVE_AUDIOFILE, 1, [Define for audiofile support]),
914 AM_CONDITIONAL(HAVE_AUDIOFILE, test x$enable_audiofile = xyes)
916 MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat libavcodec libavutil],
917 [ffmpeg decoder library], [libavformat+libavcodec+libavutil not found])
919 if test x$enable_ffmpeg = xyes; then
921 LIBS="$LIBS $FFMPEG_LIBS"
922 AC_CHECK_LIB(avcodec, avcodec_decode_audio2,,
927 if test x$enable_ffmpeg = xyes; then
928 # prior to ffmpeg svn12865, you had to specify include files
929 # without path prefix
930 old_CPPCFLAGS=$CPPFLAGS
931 CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
932 AC_CHECK_HEADER(libavcodec/avcodec.h,,
933 AC_DEFINE(OLD_FFMPEG_INCLUDES, 1,
934 [Define if avcodec.h instead of libavcodec/avcodec.h should be included]))
935 CPPCFLAGS=$old_CPPFLAGS
938 if test x$enable_ffmpeg = xyes; then
939 AC_DEFINE(HAVE_FFMPEG, 1, [Define for FFMPEG support])
942 AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes)
944 if test x$enable_fluidsynth = xyes; then
945 PKG_CHECK_MODULES(FLUIDSYNTH, [fluidsynth],
946 AC_DEFINE(ENABLE_FLUIDSYNTH, 1, [Define for fluidsynth support]),
947 enable_fluidsynth=no)
950 AM_CONDITIONAL(ENABLE_FLUIDSYNTH, test x$enable_fluidsynth = xyes)
952 if test x$enable_wildmidi = xyes; then
955 oldcppflags=$CPPFLAGS
957 AC_CHECK_LIB(WildMidi, WildMidi_Init,,
958 AC_MSG_ERROR([libwildmidi not found]))
962 CPPFLAGS=$oldcppflags
964 AC_SUBST(WILDMIDI_LIBS,-lWildMidi)
965 AC_SUBST(WILDMIDI_CFLAGS,)
967 AC_DEFINE(ENABLE_WILDMIDI, 1, [Define for wildmidi support])
970 AM_CONDITIONAL(ENABLE_WILDMIDI, test x$enable_wildmidi = xyes)
974 dnl Encoder API and shout/httpd output plugin
977 if test x$enable_shout = xyes || test x$enable_httpd_output = xyes; then
978 # at least one output using encoders is explicitly enabled
980 elif test x$enable_shout = xauto || test x$enable_httpd_output = xauto; then
983 # all outputs using encoders are disabled
986 # don't bother to check for encoder plugins
987 enable_vorbis_encoder=no
988 enable_lame_encoder=no
991 MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc],
992 [Ogg Vorbis encoder], [libvorbisenc not found])
994 if test x$enable_lame_encoder != xno; then
995 AM_PATH_LAME([found_lame_encoder=yes], [found_lame_encoder=no])
996 MPD_AUTO_RESULT(lame_encoder, [LAME encoder plugin],
1000 AC_SUBST(LAME_CFLAGS)
1003 if test x$enable_vorbis_encoder != xno ||
1004 test x$enable_lame_encoder != xno; then
1005 # at least one encoder plugin is enabled
1008 # no encoder plugin is enabled: disable the whole encoder API
1011 if test x$need_encoder = xyes; then
1012 AC_MSG_ERROR([No encoder plugin found])
1017 if test x$enable_shout = xauto; then
1018 # handle shout auto-detection: disable if no encoder is
1020 if test x$enable_encoder = xyes; then
1023 AC_MSG_WARN([No encoder plugin -- disabling the shout output plugin])
1028 if test x$enable_httpd_output = xauto; then
1029 # handle HTTPD auto-detection: disable if no encoder is
1031 if test x$enable_encoder = xyes; then
1032 enable_httpd_output=yes
1034 AC_MSG_WARN([No encoder plugin -- disabling the HTTP output plugin])
1035 enable_httpd_output=no
1039 AM_CONDITIONAL(HAVE_SHOUT, test x$enable_shout = xyes)
1040 if test x$enable_shout = xyes; then
1041 AC_DEFINE(HAVE_SHOUT, 1, [Define to enable the shoutcast output])
1044 AM_CONDITIONAL(ENABLE_HTTPD_OUTPUT, test x$enable_httpd_output = xyes)
1045 if test x$enable_httpd_output = xyes; then
1046 AC_DEFINE(ENABLE_HTTPD_OUTPUT, 1, [Define to enable the HTTP server output])
1049 AM_CONDITIONAL(ENABLE_ENCODER, test x$enable_encoder = xyes)
1051 AM_CONDITIONAL(ENABLE_VORBIS_ENCODER, test x$enable_vorbis_encoder = xyes)
1052 if test x$enable_vorbis_encoder = xyes; then
1053 AC_DEFINE(ENABLE_VORBIS_ENCODER, 1,
1054 [Define to enable the vorbis encoder plugin])
1057 AM_CONDITIONAL(ENABLE_LAME_ENCODER, test x$enable_lame_encoder = xyes)
1058 if test x$enable_lame_encoder = xyes; then
1059 AC_DEFINE(ENABLE_LAME_ENCODER, 1,
1060 [Define to enable the lame encoder plugin])
1068 AC_ARG_ENABLE(documentation,
1069 AS_HELP_STRING([--enable-documentation],
1070 [build documentation (default: disable)]),,
1071 [enable_documentation=no])
1073 if test x$enable_documentation = xyes; then
1074 AC_PATH_PROG(XMLTO, xmlto)
1076 AM_CONDITIONAL(HAVE_XMLTO, test x$XMLTO != x)
1078 AC_PATH_PROG(DOXYGEN, doxygen)
1079 if test x$DOXYGEN = x; then
1080 AC_MSG_ERROR([doxygen not found])
1085 AM_CONDITIONAL(HAVE_XMLTO, false)
1088 AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes)
1095 AC_ARG_ENABLE(werror,
1096 AS_HELP_STRING([--enable-werror],
1097 [treat warnings as errors (default: disabled)]),,
1100 if test "x$enable_werror" = xyes; then
1101 AM_CFLAGS="$AM_CFLAGS -Werror -pedantic-errors"
1104 AC_ARG_ENABLE(debug,
1105 AS_HELP_STRING([--enable-debug],
1106 [enable debugging (default: disabled)]),,
1109 #if test "x$enable_debug" = xno; then
1110 # don't set NDEBUG for now, until MPD is stable
1111 #AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
1114 AC_ARG_ENABLE(gprof,
1115 AS_HELP_STRING([--enable-gprof],
1116 [enable profiling via gprof (default: disabled)]),,
1119 if test "x$enable_gprof" = xyes; then
1120 MPD_CFLAGS="$MPD_CFLAGS -pg"
1121 MPD_LIBS="$MPD_LIBS -pg"
1125 AS_HELP_STRING([--enable-test],
1126 [build the test programs (default: disabled)]),,
1129 AM_CONDITIONAL(ENABLE_TEST, test "x$enable_test" = xyes)
1136 if test x$GCC = xyes
1138 MPD_CHECK_FLAG([-Wall])
1139 MPD_CHECK_FLAG([-Wextra])
1140 MPD_CHECK_FLAG([-Wno-deprecated-declarations])
1141 MPD_CHECK_FLAG([-Wmissing-prototypes])
1142 MPD_CHECK_FLAG([-Wdeclaration-after-statement])
1143 MPD_CHECK_FLAG([-Wshadow])
1144 MPD_CHECK_FLAG([-Wpointer-arith])
1145 MPD_CHECK_FLAG([-Wstrict-prototypes])
1146 MPD_CHECK_FLAG([-Wcast-qual])
1147 MPD_CHECK_FLAG([-Wwrite-strings])
1148 MPD_CHECK_FLAG([-pedantic])
1152 dnl pretty-print result
1156 echo "########### MPD CONFIGURATION ############"
1159 echo " Client Support:"
1160 if test x$enable_ipv6 = xyes; then
1161 echo " IPv6 support ..................enabled"
1163 echo " IPv6 support ..................disabled"
1166 if test x$enable_tcp = xyes; then
1167 echo " TCP support ...................enabled"
1169 echo " TCP support ...................disabled"
1172 if test x$enable_un = xyes; then
1173 echo " Unix domain socket support ....enabled"
1175 echo " Unix domain socket support ....disabled"
1181 test x$enable_tcp = xno &&
1182 test x$enable_un = xno; then
1183 AC_MSG_ERROR([No client interfaces configured!])
1186 echo " Playback Support:"
1187 if test x$enable_alsa = xyes; then
1188 echo " ALSA support ..................enabled"
1190 echo " ALSA support ..................disabled"
1193 if test x$enable_fifo = xyes; then
1194 echo " FIFO support ..................enabled"
1196 echo " FIFO support ..................disabled"
1199 if test x$enable_httpd_output = xyes; then
1200 echo " HTTP daemon support ...........enabled"
1202 echo " HTTP daemon support ...........disabled"
1205 if test x$enable_jack = xyes; then
1206 echo " JACK support ..................enabled"
1208 echo " JACK support ..................disabled"
1211 if test x$enable_ao = xyes; then
1212 echo " libao support .................enabled"
1214 echo " libao support .................disabled"
1217 if test x$enable_oss = xyes; then
1218 echo " OSS support ...................enabled"
1220 echo " OSS support ...................disabled"
1223 if test x$enable_osx = xyes; then
1224 echo " OS X support ..................enabled"
1226 echo " OS X support ..................disabled"
1229 if test x$enable_pipe_output = xyes; then
1230 echo " Pipeline output support .......enabled"
1232 echo " Pipeline output support .......disabled"
1235 if test x$enable_pulse = xyes; then
1236 echo " PulseAudio support ............enabled"
1238 echo " PulseAudio support ............disabled"
1241 if test x$enable_mvp = xyes; then
1242 echo " Media MVP support .............enabled"
1244 echo " Media MVP support .............disabled"
1247 if test x$enable_shout = xyes; then
1248 echo " SHOUTcast support .............enabled"
1250 echo " SHOUTcast support .............disabled"
1253 if test x$enable_solaris_output = xyes; then
1254 echo " Solaris /dev/audio support ....enabled"
1256 echo " Solaris /dev/audio support ....disabled"
1262 test x$enable_ao = xno &&
1263 test x$enable_oss = xno &&
1264 test x$enable_shout = xno &&
1265 test x$enable_httpd_output = xno &&
1266 test x$enable_solaris_output = xno &&
1267 test x$enable_alsa = xno &&
1268 test x$enable_osx = xno &&
1269 test x$enable_pulse = xno &&
1270 test x$enable_jack = xno &&
1271 test x$enable_fifo = xno &&
1272 test x$enable_pipe_output = xno &&
1273 test x$enable_mvp = xno; then
1274 AC_MSG_ERROR([No Audio Output types configured!])
1278 test x$enable_shout = xyes ||
1279 test x$enable_httpd_output = xyes; then
1280 echo " Streaming Encoder Support:"
1281 if test x$enable_lame_encoder = xyes; then
1282 echo " LAME mp3 encoder ..............enabled"
1284 echo " LAME mp3 encoder ..............disabled"
1287 if test x$enable_vorbis_encoder = xyes; then
1288 echo " Ogg Vorbis encoder ............enabled"
1290 echo " Ogg Vorbis encoder ............disabled"
1295 echo " File Format Support:"
1297 if test x$enable_aac = xyes; then
1298 echo " AAC support ...................enabled"
1300 echo " AAC support ...................disabled"
1303 if test x$enable_sidplay = xyes; then
1304 echo " C64 SID support ...............enabled"
1306 echo " C64 SID support ...............disabled"
1309 if test x$enable_ffmpeg = xyes; then
1310 echo " FFMPEG support ................enabled"
1312 echo " FFMPEG support ................disabled"
1315 if test x$enable_flac = xyes; then
1316 echo " FLAC support ..................enabled"
1318 echo " FLAC support ..................disabled"
1321 if test x$enable_fluidsynth = xyes; then
1322 echo " fluidsynth MIDI support .......enabled"
1324 echo " fluidsynth MIDI support .......disabled"
1327 if test x$enable_mikmod = xyes; then
1328 echo " MikMod support ................enabled"
1330 echo " MikMod support ................disabled"
1333 if test x$enable_modplug = xyes; then
1334 echo " MODPLUG support ...............enabled"
1336 echo " MODPLUG support ...............disabled"
1339 if test x$enable_mad = xyes; then
1340 echo " MAD mp3 decoder support .......enabled"
1342 echo " MAD mp3 decoder support .......disabled"
1345 if test x$enable_mp4 = xyes; then
1346 echo " MP4 support ...................enabled"
1348 echo " MP4 support ...................disabled"
1351 if test x$enable_mpc = xyes; then
1352 echo " Musepack (MPC) support ........enabled"
1354 echo " Musepack (MPC) support ........disabled"
1357 case $enable_oggflac in
1359 echo " OggFLAC support ...............enabled"
1362 echo " OggFLAC support ...............enabled(FLAC 1.1.3)"
1365 echo " OggFLAC support ...............disabled"
1369 if test x$enable_vorbis = xyes; then
1370 echo " Ogg Vorbis support ............enabled"
1371 if test x$use_tremor = xyes; then
1372 echo " using tremor.................yes"
1374 echo " using tremor.................no"
1377 echo " Ogg Vorbis support ............disabled"
1380 if test x$enable_audiofile = xyes; then
1381 echo " Wave file support .............enabled"
1383 echo " Wave file support .............disabled"
1386 if test x$enable_wavpack = xyes; then
1387 echo " WavPack support ...............enabled"
1389 echo " WavPack support ...............disabled"
1392 if test x$enable_wildmidi = xyes; then
1393 echo " wildmidi MIDI support .........enabled"
1395 echo " wildmidi MIDI support .........disabled"
1401 test x$enable_mad = xno &&
1402 test x$enable_vorbis = xno &&
1403 test x$enable_flac = xno &&
1404 test x$enable_oggflac = xno &&
1405 test x$enable_audiofile = xno &&
1406 test x$enable_aac = xno &&
1407 test x$enable_mpc = xno &&
1408 test x$enable_wavpack = xno &&
1409 test x$enable_ffmpeg = xno &&
1410 test x$enable_modplug = xno &&
1411 test x$enable_sidplay = xno &&
1412 test x$enable_fluidsynth = xno &&
1413 test x$enable_wildmidi = xno &&
1414 test x$enable_mp4 = xno &&
1415 test x$enable_mikmod = xno; then
1416 AC_MSG_ERROR([No input plugins supported!])
1420 echo " Archive support:"
1422 if test x$enable_bzip2 = xyes; then
1423 echo " BZ2 archives support ..........enabled"
1425 echo " BZ2 archives support ..........disabled"
1428 if test x$enable_iso9660 = xyes; then
1429 echo " ISO 9660 archives support .....enabled"
1431 echo " ISO 9660 archives support .....disabled"
1434 if test x$enable_zip = xyes; then
1435 echo " ZIP archives support ..........enabled"
1437 echo " ZIP archives support ..........disabled"
1441 echo " Streaming support:"
1443 if test x$enable_lastfm = xyes; then
1444 echo " last.fm radio support .........enabled"
1446 echo " last.fm radio support .........disabled"
1449 if test x$enable_curl = xyes; then
1450 echo " libcurl support (streaming) ...enabled"
1452 echo " libcurl support (streaming) ...disabled"
1455 if test x$enable_mms = xyes; then
1456 echo " libmms support ................enabled"
1458 echo " libmms support ................disabled"
1462 echo " Other features:"
1464 if test x$enable_id3 = xyes; then
1465 echo " ID3 tag support ...............enabled"
1467 echo " ID3 tag support ...............disabled"
1470 if test x$enable_lsr = xyes; then
1471 echo " libsamplerate support .........enabled"
1473 echo " libsamplerate support .........disabled"
1476 if test x$with_zeroconf != xno; then
1477 echo " Zeroconf support ..............$with_zeroconf"
1479 echo " Zeroconf support ..............disabled"
1482 if test x$enable_cue = xyes; then
1483 echo " libcue support ................enabled"
1485 echo " libcue support ................disabled"
1489 echo "##########################################"
1492 echo "Generating needed files for compilation"
1503 echo "You are now ready to compile MPD"
1504 echo "Type \"make\" to compile MPD"