2 AC_INIT(mpd, 0.15.12, 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])
180 AC_CHECK_FUNCS(getpeereid)
189 AS_HELP_STRING([--enable-cue],
190 [enable support for libcue support]),,
193 MPD_AUTO_PKG(cue, CUE, [libcue],
194 [libcue parsing library], [libcue not found])
195 if test x$enable_cue = xyes; then
196 AC_DEFINE([HAVE_CUE], 1,
197 [Define to enable libcue support])
200 AM_CONDITIONAL(HAVE_CUE, test x$enable_cue = xyes)
205 AC_ARG_WITH(zeroconf,
206 AS_HELP_STRING([--with-zeroconf=@<:@auto|avahi|bonjour|no@:>@],
207 [enable zeroconf backend (default=auto)]),,
208 with_zeroconf="auto")
210 case $with_zeroconf in
218 if test x$with_zeroconf != xno; then
219 if test x$with_zeroconf = xavahi || test x$with_zeroconf = xauto; then
220 PKG_CHECK_MODULES([AVAHI], [avahi-client avahi-glib],
221 [found_avahi=1;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])]
222 MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS",
226 if test x$found_avahi = x1; then
228 elif test x$with_zeroconf = xavahi; then
229 AC_MSG_ERROR([Avahi support requested but not found])
232 if test x$with_zeroconf = xbonjour || test x$with_zeroconf = xauto; then
233 AC_CHECK_HEADER(dns_sd.h,
234 [found_bonjour=1;AC_DEFINE([HAVE_BONJOUR], 1, [Define to enable Bonjour Zeroconf support])],
236 AC_CHECK_LIB(dns_sd, DNSServiceRegister,
237 MPD_LIBS="$MPD_LIBS -ldns_sd")
240 if test x$found_bonjour = x1; then
241 with_zeroconf=bonjour
242 elif test x$with_zeroconf = xbonjour; then
243 AC_MSG_ERROR([Bonjour support requested but not found])
246 if test x$with_zeroconf = xauto; then
247 AC_MSG_WARN([No supported Zeroconf backend found, disabling Zeroconf])
250 AC_DEFINE([HAVE_ZEROCONF], 1, [Define to enable Zeroconf support])
254 AM_CONDITIONAL(HAVE_ZEROCONF, test x$with_zeroconf != xno)
255 AM_CONDITIONAL(HAVE_AVAHI, test x$with_zeroconf = xavahi)
256 AM_CONDITIONAL(HAVE_BONJOUR, test x$with_zeroconf = xbonjour)
258 AC_ARG_ENABLE(sqlite,
259 AS_HELP_STRING([--enable-sqlite],
260 [enable support for the SQLite database]),,
261 [enable_sqlite=auto])
263 MPD_AUTO_PKG(sqlite, SQLITE, [sqlite3],
264 [SQLite database support], [sqlite not found])
265 if test x$enable_sqlite = xyes; then
266 AC_DEFINE([ENABLE_SQLITE], 1, [Define to enable sqlite database support])
269 AM_CONDITIONAL(ENABLE_SQLITE, test x$enable_sqlite = xyes)
277 AS_HELP_STRING([--enable-curl],
278 [enable support for libcurl HTTP streaming (default: auto)]),,
281 MPD_AUTO_PKG(curl, CURL, [libcurl],
282 [libcurl HTTP streaming], [libcurl not found])
283 if test x$enable_curl = xyes; then
284 AC_DEFINE(HAVE_CURL, 1, [Define when libcurl is used for HTTP streaming])
286 AM_CONDITIONAL(HAVE_CURL, test x$enable_curl = xyes)
288 AC_ARG_ENABLE(lastfm,
289 AS_HELP_STRING([--enable-lastfm],
290 [enable support for last.fm radio (default: disable)]),,
293 if test x$enable_lastfm = xyes; then
294 if test x$enable_curl != xyes; then
295 AC_MSG_ERROR([Cannot enable last.fm radio without curl])
298 AC_DEFINE(ENABLE_LASTFM, 1, [Define when last.fm radio is enabled])
300 AM_CONDITIONAL(ENABLE_LASTFM, test x$enable_lastfm = xyes)
303 AS_HELP_STRING([--enable-mms],
304 [enable the MMS protocol with libmms]),,
307 MPD_AUTO_PKG(mms, MMS, [libmms >= 0.4],
308 [libmms mms:// protocol support], [libmms not found])
309 if test x$enable_mms = xyes; then
310 AC_DEFINE(ENABLE_MMS, 1,
311 [Define when libmms is used for the MMS protocol])
313 AM_CONDITIONAL(ENABLE_MMS, test x$enable_mms = xyes)
322 AS_HELP_STRING([--enable-bzip2],
323 [enable bzip2 archive support (default: disabled)]),,
326 if test x$enable_bzip2 = xyes; then
327 AC_CHECK_LIB(bz2, BZ2_bzDecompressInit,
328 [MPD_LIBS="$MPD_LIBS -lbz2"],
329 [AC_MSG_ERROR([libbz2 not found])])
332 AM_CONDITIONAL(HAVE_BZ2, test x$enable_bzip2 = xyes)
333 if test x$enable_bzip2 = xyes; then
334 AC_DEFINE(HAVE_BZ2, 1, [Define to have bz2 archive support])
339 AS_HELP_STRING([--enable-zip],
340 [enable zip archive support (default: disabled)]),,
343 MPD_AUTO_PKG(zip, ZZIP, [zziplib >= 0.13],
344 [libzzip archive library], [libzzip not found])
346 AM_CONDITIONAL(HAVE_ZIP, test x$enable_zip = xyes)
347 if test x$enable_zip = xyes; then
348 AC_DEFINE(HAVE_ZIP, 1, [Define to have zip archive support])
352 AC_ARG_ENABLE(iso9660,
353 AS_HELP_STRING([--enable-iso9660],
354 [enable iso9660 archive support (default: disabled)]),,
357 MPD_AUTO_PKG(iso9660, ISO9660, [libiso9660],
358 [libiso9660 archive library], [libiso9660 not found])
360 AM_CONDITIONAL(HAVE_ISO, test x$enable_iso9660 = xyes)
361 if test x$enable_iso9660 = xyes; then
362 AC_DEFINE(HAVE_ISO, 1, [Define to have iso archive support])
367 test x$enable_bzip2 = xyes ||
368 test x$enable_zip = xyes ||
369 test x$enable_iso9660 = xyes; then
371 AC_DEFINE(ENABLE_ARCHIVE, 1, [The archive API is available])
376 AM_CONDITIONAL(ENABLE_ARCHIVE, test x$enable_archive = xyes)
384 AS_HELP_STRING([--disable-id3],
385 [disable id3 support (default: enable)]),,
395 AC_ARG_ENABLE(audiofile,
396 AS_HELP_STRING([--disable-audiofile],
397 [disable audiofile support, disables wave support (default: enable)]),,
398 enable_audiofile=yes)
400 AC_ARG_ENABLE(ffmpeg,
401 AS_HELP_STRING([--enable-ffmpeg],
402 [enable FFMPEG support]),,
406 AS_HELP_STRING([--disable-flac],
407 [disable flac support (default: enable)]),,
415 AS_HELP_STRING([--enable-mad],
416 [enable libmad mp3 decoder plugin]),,
419 MPD_AUTO_PKG(mad, MAD, [mad],
420 [libmad MP3 decoder plugin], [libmad not found])
421 if test x$enable_mad = xyes; then
422 AC_DEFINE(HAVE_MAD, 1, [Define to use libmad])
424 AM_CONDITIONAL(HAVE_MAD, test x$enable_mad = xyes)
426 AC_ARG_ENABLE(mikmod,
427 AS_HELP_STRING([--enable-mikmod],
428 [enable the mikmod decoder (default: disable)]),,
431 if test x$enable_mikmod = xyes; then
432 AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config)
433 if test x$LIBMIKMOD_CONFIG != x ; then
434 AC_SUBST(LIBMIKMOD_CFLAGS, `$LIBMIKMOD_CONFIG --cflags`)
435 AC_SUBST(LIBMIKMOD_LIBS, `$LIBMIKMOD_CONFIG --libs`)
436 AC_DEFINE(ENABLE_MIKMOD_DECODER, 1, [Define for mikmod support])
442 AM_CONDITIONAL(ENABLE_MIKMOD_DECODER, test x$enable_mikmod = xyes)
444 AC_ARG_ENABLE(modplug,
445 AS_HELP_STRING([--enable-modplug],
446 [enable modplug decoder plugin]),,
449 found_modplug=$HAVE_CXX
450 MPD_AUTO_PRE(modplug, [modplug decoder plugin], [No C++ compiler found])
452 MPD_AUTO_PKG(modplug, MODPLUG, [libmodplug],
453 [modplug decoder plugin], [libmodplug not found])
454 AM_CONDITIONAL(HAVE_MODPLUG, test x$enable_modplug = xyes)
455 if test x$enable_modplug = xyes; then
456 AC_DEFINE(HAVE_MODPLUG, 1, [Define for modplug support])
460 AS_HELP_STRING([--disable-mpc],
461 [disable musepack (MPC) support (default: enable)]),,
464 AC_ARG_ENABLE(oggflac,
465 AS_HELP_STRING([--disable-oggflac],
466 [disable OggFLAC support (default: enable)]),,
469 AC_ARG_ENABLE(vorbis,
470 AS_HELP_STRING([--disable-vorbis],
471 [disable Ogg Vorbis support (default: enable)]),,
478 AS_HELP_STRING([--with-tremor=PFX],
479 [use Tremor (vorbisidec) integer Ogg Vorbis decoder (with optional prefix)]),,
482 if test x$with_tremor = xyes || test x$with_tremor = xno; then
483 use_tremor="$with_tremor"
485 tremor_prefix="$with_tremor"
489 AC_ARG_WITH(tremor-libraries,
490 AS_HELP_STRING([--with-tremor-libraries=DIR],
491 [directory where Tremor library is installed (optional)]),,
494 AC_ARG_WITH(tremor-includes,
495 AS_HELP_STRING([--with-tremor-includes=DIR],
496 [directory where Tremor header files are installed (optional)]),,
499 AC_ARG_ENABLE(sidplay,
500 AS_HELP_STRING([--enable-sidplay],
501 [enable C64 SID support via libsidplay2]),,
504 found_sidplay=$HAVE_CXX
505 MPD_AUTO_PRE(sidplay, [sidplay decoder plugin], [No C++ compiler found])
507 if test x$enable_sidplay != xno; then
508 # we're not using pkg-config here
509 # because libsidplay2's .pc file requires libtool
510 AC_HAVE_LIBRARY(sidplay2, [found_sidplay=yes], [found_sidplay=no])
511 MPD_AUTO_PRE(sidplay, [sidplay decoder plugin],
512 [libsidplay2 not found])
515 if test x$enable_sidplay != xno; then
516 # can't use AC_HAVE_LIBRARY here, because the dash in the
517 # library name triggers an autoconf bug
518 AC_CHECK_LIB(resid-builder, main,
519 [found_sidplay=yes], [found_sidplay=no])
520 MPD_AUTO_RESULT(sidplay, [sidplay decoder plugin],
521 [libresid-builder not found])
524 if test x$enable_sidplay = xyes; then
525 AC_SUBST(SIDPLAY_LIBS,"-lsidplay2 -lresid-builder")
526 AC_SUBST(SIDPLAY_CFLAGS,)
528 AC_DEFINE(ENABLE_SIDPLAY, 1, [Define for libsidplay2 support])
531 AM_CONDITIONAL(ENABLE_SIDPLAY, test x$enable_sidplay = xyes)
533 AC_ARG_ENABLE(fluidsynth,
534 AS_HELP_STRING([--enable-fluidsynth],
535 [enable MIDI support via fluidsynth (default: disable)]),,
536 enable_fluidsynth=no)
538 AC_ARG_ENABLE(wildmidi,
539 AS_HELP_STRING([--enable-wildmidi],
540 [enable MIDI support via wildmidi (default: disable)]),,
543 AC_ARG_ENABLE(wavpack,
544 AS_HELP_STRING([--disable-wavpack],
545 [disable WavPack support (default: enable)]),,
554 AS_HELP_STRING([--enable-lsr],
555 [enable libsamplerate support]),,
558 MPD_AUTO_PKG(lsr, SAMPLERATE, [samplerate >= 0.0.15],
559 [libsamplerate resampling], [libsamplerate not found])
560 if test x$enable_lsr = xyes; then
561 AC_DEFINE([HAVE_LIBSAMPLERATE], 1,
562 [Define to enable libsamplerate])
565 if test x$enable_lsr = xyes; then
566 PKG_CHECK_MODULES([SAMPLERATE_013],
567 [samplerate >= 0.1.3],,
568 [AC_DEFINE([HAVE_LIBSAMPLERATE_NOINT], 1,
569 [libsamplerate doesn't provide src_int_to_float_array() (<0.1.3)])])
572 AM_CONDITIONAL(HAVE_LIBSAMPLERATE, test x$enable_lsr = xyes)
579 AC_ARG_ENABLE(vorbis-encoder,
580 AS_HELP_STRING([--enable-vorbis-encoder],
581 [enable the Ogg Vorbis encoder]),,
582 [enable_vorbis_encoder=auto])
584 AC_ARG_ENABLE(lame-encoder,
585 AS_HELP_STRING([--enable-lame-encoder],
586 [enable the LAME mp3 encoder]),,
587 enable_lame_encoder=auto)
591 dnl audio output plugins
595 AS_HELP_STRING([--enable-alsa], [enable ALSA support]),,
599 AS_HELP_STRING([--enable-ao],
600 [enable support for libao]),,
603 MPD_AUTO_PKG(ao, AO, [ao],
604 [libao output plugin], [libao not found])
605 if test x$enable_ao = xyes; then
606 AC_DEFINE(HAVE_AO, 1, [Define to play with ao])
609 AM_CONDITIONAL(HAVE_AO, test x$enable_ao = xyes)
612 AS_HELP_STRING([--disable-fifo],
613 [disable support for writing audio to a FIFO (default: enable)]),,
616 AC_ARG_ENABLE(pipe-output,
617 AS_HELP_STRING([--enable-pipe-output],
618 [enable support for writing audio to a pipe (default: disable)]),,
619 enable_pipe_output=no)
621 if test x$enable_pipe_output = xyes; then
622 AC_DEFINE([ENABLE_PIPE_OUTPUT], 1,
623 [Define to enable support for writing audio to a pipe])
625 AM_CONDITIONAL(ENABLE_PIPE_OUTPUT, test x$enable_pipe_output = xyes)
628 AS_HELP_STRING([--enable-jack],
629 [enable jack support]),,
632 MPD_AUTO_PKG(jack, JACK, [jack >= 0.4],
633 [JACK output plugin], [libjack not found])
634 if test x$enable_jack = xyes; then
635 AC_DEFINE([HAVE_JACK], 1, [Define to enable JACK support])
638 if test x$enable_jack = xyes; then
639 # check whether jack_set_info_function() is available
641 LIBS="$LIBS $JACK_LIBS"
643 AC_CHECK_FUNCS(jack_set_info_function)
648 AM_CONDITIONAL(HAVE_JACK, test x$enable_jack = xyes)
651 AS_HELP_STRING([--enable-mvp],
652 [enable support for Hauppauge Media MVP (default: disable)]),,
656 AS_HELP_STRING([--disable-oss],
657 [disable OSS support (default: enable)]),,
661 AS_HELP_STRING([--enable-pulse],
662 [enable support for the PulseAudio sound server]),,
665 MPD_AUTO_PKG(pulse, PULSE, [libpulse-simple],
666 [PulseAudio output plugin], [libpulse not found])
667 if test x$enable_pulse = xyes; then
668 AC_DEFINE([HAVE_PULSE], 1,
669 [Define to enable PulseAudio support])
672 AM_CONDITIONAL(HAVE_PULSE, test x$enable_pulse = xyes)
674 AC_ARG_ENABLE(httpd-output,
675 AS_HELP_STRING([--enable-httpd-output],
676 [enables the HTTP server output]),,
677 [enable_httpd_output=auto])
682 AC_DEFINE(HAVE_OSX, 1, [Define for compiling OS X support])
683 MPD_LIBS="$MPD_LIBS -framework AudioUnit -framework CoreServices"
687 AM_CONDITIONAL(HAVE_OSX, test x$enable_osx = xyes)
690 AS_HELP_STRING([--enable-shout],
691 [enables the shoutcast streaming output]),,
694 enable_shout2="$enable_shout"
695 MPD_AUTO_PKG(shout, SHOUT, [shout],
696 [shout output plugin], [libshout not found])
697 if test x$enable_shout = xyes && test x$enable_shout2 = xauto; then
703 AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support])
704 enable_solaris_output=yes
708 enable_solaris_output=no
712 AM_CONDITIONAL(ENABLE_SOLARIS_OUTPUT, test x$enable_solaris_output = xyes)
714 if test x$enable_oss = xyes; then
715 AC_CHECK_HEADER(sys/soundcard.h,
716 [enable_oss=yes;AC_DEFINE(HAVE_OSS,1,[Define to enable OSS])],
717 [AC_MSG_WARN(Soundcard headers not found -- disabling OSS support);
721 AM_CONDITIONAL(HAVE_OSS, test x$enable_oss = xyes)
723 if test x$enable_fifo = xyes; then
724 AC_CHECK_FUNC([mkfifo],
725 [enable_fifo=yes;AC_DEFINE([HAVE_FIFO], 1,
726 [Define to enable support for writing audio to a FIFO])],
727 [enable_fifo=no;AC_MSG_WARN([mkfifo not found -- disabling support for writing audio to a FIFO])])
730 AM_CONDITIONAL(HAVE_FIFO, test x$enable_fifo = xyes)
732 if test x$enable_mvp = xyes; then
733 AC_DEFINE(HAVE_MVP,1,[Define to enable Hauppauge Media MVP support])
736 AM_CONDITIONAL(HAVE_MVP, test x$enable_mvp = xyes)
738 MPD_AUTO_PKG(alsa, ALSA, [alsa >= 0.9.0],
739 [ALSA output plugin], [libasound not found])
741 if test x$enable_alsa = xyes; then
742 AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support])
745 AM_CONDITIONAL(HAVE_ALSA, test x$enable_alsa = xyes)
747 if test x$enable_id3 = xyes; then
748 PKG_CHECK_MODULES([ID3TAG], [id3tag],,
749 AC_CHECK_LIB(id3tag, id3_file_open,
750 [ID3TAG_LIBS="-lid3tag -lz" ID3TAG_CFLAGS=""],
754 if test x$enable_id3 = xyes; then
755 AC_DEFINE(HAVE_ID3TAG, 1, [Define to use id3tag])
758 AM_CONDITIONAL(HAVE_ID3TAG, test x$enable_id3 = xyes)
760 if test x$enable_mpc = xyes; then
761 if test "x$mpcdec_libraries" != "x" ; then
762 MPCDEC_LIBS="-L$mpcdec_libraries"
763 elif test "x$mpcdec_prefix" != "x" ; then
764 MPCDEC_LIBS="-L$mpcdec_prefix/lib"
767 MPCDEC_LIBS="$MPCDEC_LIBS -lmpcdec"
769 if test "x$mpcdec_includes" != "x" ; then
770 MPCDEC_CFLAGS="-I$mpcdec_includes"
771 elif test "x$mpcdec_prefix" != "x" ; then
772 MPCDEC_CFLAGS="-I$mpcdec_prefix/include"
777 oldcppflags=$CPPFLAGS
778 CFLAGS="$CFLAGS $MPD_CFLAGS $MPCDEC_CFLAGS -I."
779 LIBS="$LIBS $MPD_LIBS $MPCDEC_LIBS"
781 AC_CHECK_HEADER(mpc/mpcdec.h,
783 [AC_CHECK_HEADER(mpcdec/mpcdec.h,
786 if test x$enable_mpc = xyes; then
787 AC_CHECK_LIB(mpcdec,main,
788 [MPD_LIBS="$MPD_LIBS $MPCDEC_LIBS";
789 MPD_CFLAGS="$MPD_CFLAGS $MPCDEC_CFLAGS";],
792 if test x$enable_mpc = xyes; then
793 AC_DEFINE(HAVE_MPCDEC,1,
794 [Define to use libmpcdec for MPC decoding])
795 if test x$old_mpcdec = xyes; then
796 AC_DEFINE(MPC_IS_OLD_API, 1,
797 [Define if an old pre-SV8 libmpcdec is used])
800 AC_MSG_WARN([mpcdec lib needed for MPC support -- disabling MPC support])
804 CPPFLAGS=$oldcppflags
807 AM_CONDITIONAL(HAVE_MPCDEC, test x$enable_mpc = xyes)
809 if test x$enable_wavpack = xyes; then
810 PKG_CHECK_MODULES([WAVPACK], [wavpack],
812 AC_DEFINE([HAVE_WAVPACK], 1,
813 [Define to enable WavPack support])]
814 MPD_LIBS="$MPD_LIBS $WAVPACK_LIBS"
815 MPD_CFLAGS="$MPD_CFLAGS $WAVPACK_CFLAGS",
819 AM_CONDITIONAL(HAVE_WAVPACK, test x$enable_wavpack = xyes)
823 AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes)
825 AM_CONDITIONAL(HAVE_MP4, test x$enable_mp4 = xyes)
827 if test x$use_tremor = xyes; then
828 if test "x$tremor_libraries" != "x" ; then
829 TREMOR_LIBS="-L$tremor_libraries"
830 elif test "x$tremor_prefix" != "x" ; then
831 TREMOR_LIBS="-L$tremor_prefix/lib"
833 TREMOR_LIBS="$TREMOR_LIBS -lvorbisidec"
834 if test "x$tremor_includes" != "x" ; then
835 TREMOR_CFLAGS="-I$tremor_includes"
836 elif test "x$tremor_prefix" != "x" ; then
837 TREMOR_CFLAGS="-I$tremor_prefix/include"
839 ac_save_CFLAGS="$CFLAGS"
841 CFLAGS="$CFLAGS $TREMOR_CFLAGS"
842 LIBS="$LIBS $TREMOR_LIBS"
843 AC_CHECK_LIB(vorbisidec,ov_read,enable_vorbis=yes,enable_vorbis=no;
844 AC_MSG_WARN([vorbisidec lib needed for ogg support with tremor -- disabling ogg support]))
845 CFLAGS="$ac_save_CFLAGS"
847 if test x$enable_vorbis = xyes; then
848 AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support])
850 elif test x$enable_vorbis = xyes; then
851 PKG_CHECK_MODULES(VORBIS, [ogg vorbis vorbisfile],
852 AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]),
856 AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes)
858 if test x$use_tremor = xyes; then
859 AC_DEFINE(HAVE_TREMOR,1,
860 [Define to use tremor (libvorbisidec) for ogg support])
861 if test x$enable_oggflac = xyes; then
862 AC_MSG_WARN([disabling OggFLAC support because it is incompatible with tremor])
867 AC_SUBST(TREMOR_CFLAGS)
868 AC_SUBST(TREMOR_LIBS)
870 if test x$enable_flac = xyes; then
871 PKG_CHECK_MODULES(FLAC, [flac >= 1.1],
872 AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support]),
877 CFLAGS="$CFLAGS $FLAC_CFLAGS"
878 LIBS="$LIBS $FLAC_LIBS"
879 if test x$enable_flac = xyes && test x$enable_oggflac = xyes; then
880 AC_CHECK_DECL(FLAC_API_SUPPORTS_OGG_FLAC,
881 [enable_oggflac=flac], [],
882 [#include <FLAC/export.h>])
888 AM_CONDITIONAL(HAVE_FLAC, test x$enable_flac = xyes)
890 if test x$enable_oggflac = xyes; then
891 oldmpdcflags="$MPD_CFLAGS"
892 oldmpdlibs="$MPD_LIBS"
893 AM_PATH_LIBOGGFLAC(MPD_LIBS="$MPD_LIBS $LIBOGGFLAC_LIBS"
894 MPD_CFLAGS="$MPD_CFLAGS $LIBOGGFLAC_CFLAGS",
898 if test x$enable_oggflac = xyes; then
899 AC_DEFINE(HAVE_OGGFLAC,1,[Define for OggFLAC support])
902 AM_CONDITIONAL(HAVE_OGGFLAC, test x$enable_oggflac = xyes)
904 AM_CONDITIONAL(HAVE_FLAC_COMMON,
905 test x$enable_flac = xyes || test x$enable_oggflac = xyes)
906 AM_CONDITIONAL(HAVE_OGG_COMMON,
907 test x$enable_vorbis = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes)
909 if test x$enable_audiofile = xyes; then
910 PKG_CHECK_MODULES(AUDIOFILE, [audiofile >= 0.1.7],
911 AC_DEFINE(HAVE_AUDIOFILE, 1, [Define for audiofile support]),
915 AM_CONDITIONAL(HAVE_AUDIOFILE, test x$enable_audiofile = xyes)
917 MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat >= 52 libavcodec >= 51 libavutil >= 49],
918 [ffmpeg decoder library], [libavformat+libavcodec+libavutil not found])
920 if test x$enable_ffmpeg = xyes; then
921 # prior to ffmpeg svn12865, you had to specify include files
922 # without path prefix
923 old_CPPCFLAGS=$CPPFLAGS
924 CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
925 AC_CHECK_HEADER(libavcodec/avcodec.h,,
926 AC_DEFINE(OLD_FFMPEG_INCLUDES, 1,
927 [Define if avcodec.h instead of libavcodec/avcodec.h should be included]))
928 CPPCFLAGS=$old_CPPFLAGS
931 if test x$enable_ffmpeg = xyes; then
932 AC_DEFINE(HAVE_FFMPEG, 1, [Define for FFMPEG support])
935 AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes)
937 if test x$enable_fluidsynth = xyes; then
938 PKG_CHECK_MODULES(FLUIDSYNTH, [fluidsynth],
939 AC_DEFINE(ENABLE_FLUIDSYNTH, 1, [Define for fluidsynth support]),
940 enable_fluidsynth=no)
943 AM_CONDITIONAL(ENABLE_FLUIDSYNTH, test x$enable_fluidsynth = xyes)
945 if test x$enable_wildmidi = xyes; then
948 oldcppflags=$CPPFLAGS
950 AC_CHECK_LIB(WildMidi, WildMidi_Init,,
951 AC_MSG_ERROR([libwildmidi not found]))
953 AC_CHECK_LIB(WildMidi, WildMidi_SampledSeek,
954 [AC_DEFINE(HAVE_WILDMIDI_SAMPLED_SEEK, 1,
955 [Defined if WildMidi_SampledSeek() is available (libwildmidi <= 0.2.2)])])
959 CPPFLAGS=$oldcppflags
961 AC_SUBST(WILDMIDI_LIBS,-lWildMidi)
962 AC_SUBST(WILDMIDI_CFLAGS,)
964 AC_DEFINE(ENABLE_WILDMIDI, 1, [Define for wildmidi support])
967 AM_CONDITIONAL(ENABLE_WILDMIDI, test x$enable_wildmidi = xyes)
971 dnl Encoder API and shout/httpd output plugin
974 if test x$enable_shout = xyes || test x$enable_httpd_output = xyes; then
975 # at least one output using encoders is explicitly enabled
977 elif test x$enable_shout = xauto || test x$enable_httpd_output = xauto; then
980 # all outputs using encoders are disabled
983 # don't bother to check for encoder plugins
984 enable_vorbis_encoder=no
985 enable_lame_encoder=no
988 MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc],
989 [Ogg Vorbis encoder], [libvorbisenc not found])
991 if test x$enable_lame_encoder != xno; then
992 AM_PATH_LAME([found_lame_encoder=yes], [found_lame_encoder=no])
993 MPD_AUTO_RESULT(lame_encoder, [LAME encoder plugin],
997 AC_SUBST(LAME_CFLAGS)
1000 if test x$enable_vorbis_encoder != xno ||
1001 test x$enable_lame_encoder != xno; then
1002 # at least one encoder plugin is enabled
1005 # no encoder plugin is enabled: disable the whole encoder API
1008 if test x$need_encoder = xyes; then
1009 AC_MSG_ERROR([No encoder plugin found])
1014 if test x$enable_shout = xauto; then
1015 # handle shout auto-detection: disable if no encoder is
1017 if test x$enable_encoder = xyes; then
1020 AC_MSG_WARN([No encoder plugin -- disabling the shout output plugin])
1025 if test x$enable_httpd_output = xauto; then
1026 # handle HTTPD auto-detection: disable if no encoder is
1028 if test x$enable_encoder = xyes; then
1029 enable_httpd_output=yes
1031 AC_MSG_WARN([No encoder plugin -- disabling the HTTP output plugin])
1032 enable_httpd_output=no
1036 AM_CONDITIONAL(HAVE_SHOUT, test x$enable_shout = xyes)
1037 if test x$enable_shout = xyes; then
1038 AC_DEFINE(HAVE_SHOUT, 1, [Define to enable the shoutcast output])
1041 AM_CONDITIONAL(ENABLE_HTTPD_OUTPUT, test x$enable_httpd_output = xyes)
1042 if test x$enable_httpd_output = xyes; then
1043 AC_DEFINE(ENABLE_HTTPD_OUTPUT, 1, [Define to enable the HTTP server output])
1046 AM_CONDITIONAL(ENABLE_ENCODER, test x$enable_encoder = xyes)
1048 AM_CONDITIONAL(ENABLE_VORBIS_ENCODER, test x$enable_vorbis_encoder = xyes)
1049 if test x$enable_vorbis_encoder = xyes; then
1050 AC_DEFINE(ENABLE_VORBIS_ENCODER, 1,
1051 [Define to enable the vorbis encoder plugin])
1054 AM_CONDITIONAL(ENABLE_LAME_ENCODER, test x$enable_lame_encoder = xyes)
1055 if test x$enable_lame_encoder = xyes; then
1056 AC_DEFINE(ENABLE_LAME_ENCODER, 1,
1057 [Define to enable the lame encoder plugin])
1065 AC_ARG_ENABLE(documentation,
1066 AS_HELP_STRING([--enable-documentation],
1067 [build documentation (default: disable)]),,
1068 [enable_documentation=no])
1070 if test x$enable_documentation = xyes; then
1071 AC_PATH_PROG(XMLTO, xmlto)
1073 AM_CONDITIONAL(HAVE_XMLTO, test x$XMLTO != x)
1075 AC_PATH_PROG(DOXYGEN, doxygen)
1076 if test x$DOXYGEN = x; then
1077 AC_MSG_ERROR([doxygen not found])
1082 AM_CONDITIONAL(HAVE_XMLTO, false)
1085 AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes)
1092 AC_ARG_ENABLE(werror,
1093 AS_HELP_STRING([--enable-werror],
1094 [treat warnings as errors (default: disabled)]),,
1097 if test "x$enable_werror" = xyes; then
1098 AM_CFLAGS="$AM_CFLAGS -Werror -pedantic-errors"
1101 AC_ARG_ENABLE(debug,
1102 AS_HELP_STRING([--enable-debug],
1103 [enable debugging (default: disabled)]),,
1106 #if test "x$enable_debug" = xno; then
1107 # don't set NDEBUG for now, until MPD is stable
1108 #AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
1111 AC_ARG_ENABLE(gprof,
1112 AS_HELP_STRING([--enable-gprof],
1113 [enable profiling via gprof (default: disabled)]),,
1116 if test "x$enable_gprof" = xyes; then
1117 MPD_CFLAGS="$MPD_CFLAGS -pg"
1118 MPD_LIBS="$MPD_LIBS -pg"
1122 AS_HELP_STRING([--enable-test],
1123 [build the test programs (default: disabled)]),,
1126 AM_CONDITIONAL(ENABLE_TEST, test "x$enable_test" = xyes)
1133 if test x$GCC = xyes
1135 MPD_CHECK_FLAG([-Wall])
1136 MPD_CHECK_FLAG([-Wextra])
1137 MPD_CHECK_FLAG([-Wno-deprecated-declarations])
1138 MPD_CHECK_FLAG([-Wmissing-prototypes])
1139 MPD_CHECK_FLAG([-Wshadow])
1140 MPD_CHECK_FLAG([-Wpointer-arith])
1141 MPD_CHECK_FLAG([-Wstrict-prototypes])
1142 MPD_CHECK_FLAG([-Wcast-qual])
1143 MPD_CHECK_FLAG([-Wwrite-strings])
1144 MPD_CHECK_FLAG([-pedantic])
1148 dnl pretty-print result
1152 echo "########### MPD CONFIGURATION ############"
1155 echo " Client Support:"
1156 if test x$enable_ipv6 = xyes; then
1157 echo " IPv6 support ..................enabled"
1159 echo " IPv6 support ..................disabled"
1162 if test x$enable_tcp = xyes; then
1163 echo " TCP support ...................enabled"
1165 echo " TCP support ...................disabled"
1168 if test x$enable_un = xyes; then
1169 echo " Unix domain socket support ....enabled"
1171 echo " Unix domain socket support ....disabled"
1177 test x$enable_tcp = xno &&
1178 test x$enable_un = xno; then
1179 AC_MSG_ERROR([No client interfaces configured!])
1182 echo " Playback Support:"
1183 if test x$enable_alsa = xyes; then
1184 echo " ALSA support ..................enabled"
1186 echo " ALSA support ..................disabled"
1189 if test x$enable_fifo = xyes; then
1190 echo " FIFO support ..................enabled"
1192 echo " FIFO support ..................disabled"
1195 if test x$enable_httpd_output = xyes; then
1196 echo " HTTP daemon support ...........enabled"
1198 echo " HTTP daemon support ...........disabled"
1201 if test x$enable_jack = xyes; then
1202 echo " JACK support ..................enabled"
1204 echo " JACK support ..................disabled"
1207 if test x$enable_ao = xyes; then
1208 echo " libao support .................enabled"
1210 echo " libao support .................disabled"
1213 if test x$enable_oss = xyes; then
1214 echo " OSS support ...................enabled"
1216 echo " OSS support ...................disabled"
1219 if test x$enable_osx = xyes; then
1220 echo " OS X support ..................enabled"
1222 echo " OS X support ..................disabled"
1225 if test x$enable_pipe_output = xyes; then
1226 echo " Pipeline output support .......enabled"
1228 echo " Pipeline output support .......disabled"
1231 if test x$enable_pulse = xyes; then
1232 echo " PulseAudio support ............enabled"
1234 echo " PulseAudio support ............disabled"
1237 if test x$enable_mvp = xyes; then
1238 echo " Media MVP support .............enabled"
1240 echo " Media MVP support .............disabled"
1243 if test x$enable_shout = xyes; then
1244 echo " SHOUTcast support .............enabled"
1246 echo " SHOUTcast support .............disabled"
1249 if test x$enable_solaris_output = xyes; then
1250 echo " Solaris /dev/audio support ....enabled"
1252 echo " Solaris /dev/audio support ....disabled"
1258 test x$enable_ao = xno &&
1259 test x$enable_oss = xno &&
1260 test x$enable_shout = xno &&
1261 test x$enable_httpd_output = xno &&
1262 test x$enable_solaris_output = xno &&
1263 test x$enable_alsa = xno &&
1264 test x$enable_osx = xno &&
1265 test x$enable_pulse = xno &&
1266 test x$enable_jack = xno &&
1267 test x$enable_fifo = xno &&
1268 test x$enable_pipe_output = xno &&
1269 test x$enable_mvp = xno; then
1270 AC_MSG_ERROR([No Audio Output types configured!])
1274 test x$enable_shout = xyes ||
1275 test x$enable_httpd_output = xyes; then
1276 echo " Streaming Encoder Support:"
1277 if test x$enable_lame_encoder = xyes; then
1278 echo " LAME mp3 encoder ..............enabled"
1280 echo " LAME mp3 encoder ..............disabled"
1283 if test x$enable_vorbis_encoder = xyes; then
1284 echo " Ogg Vorbis encoder ............enabled"
1286 echo " Ogg Vorbis encoder ............disabled"
1291 echo " File Format Support:"
1293 if test x$enable_aac = xyes; then
1294 echo " AAC support ...................enabled"
1296 echo " AAC support ...................disabled"
1299 if test x$enable_sidplay = xyes; then
1300 echo " C64 SID support ...............enabled"
1302 echo " C64 SID support ...............disabled"
1305 if test x$enable_ffmpeg = xyes; then
1306 echo " FFMPEG support ................enabled"
1308 echo " FFMPEG support ................disabled"
1311 if test x$enable_flac = xyes; then
1312 echo " FLAC support ..................enabled"
1314 echo " FLAC support ..................disabled"
1317 if test x$enable_fluidsynth = xyes; then
1318 echo " fluidsynth MIDI support .......enabled"
1320 echo " fluidsynth MIDI support .......disabled"
1323 if test x$enable_mikmod = xyes; then
1324 echo " MikMod support ................enabled"
1326 echo " MikMod support ................disabled"
1329 if test x$enable_modplug = xyes; then
1330 echo " MODPLUG support ...............enabled"
1332 echo " MODPLUG support ...............disabled"
1335 if test x$enable_mad = xyes; then
1336 echo " MAD mp3 decoder support .......enabled"
1338 echo " MAD mp3 decoder support .......disabled"
1341 if test x$enable_mp4 = xyes; then
1342 echo " MP4 support ...................enabled"
1344 echo " MP4 support ...................disabled"
1347 if test x$enable_mpc = xyes; then
1348 echo " Musepack (MPC) support ........enabled"
1350 echo " Musepack (MPC) support ........disabled"
1353 case $enable_oggflac in
1355 echo " OggFLAC support ...............enabled"
1358 echo " OggFLAC support ...............enabled(FLAC 1.1.3)"
1361 echo " OggFLAC support ...............disabled"
1365 if test x$enable_vorbis = xyes; then
1366 echo " Ogg Vorbis support ............enabled"
1367 if test x$use_tremor = xyes; then
1368 echo " using tremor.................yes"
1370 echo " using tremor.................no"
1373 echo " Ogg Vorbis support ............disabled"
1376 if test x$enable_audiofile = xyes; then
1377 echo " Wave file support .............enabled"
1379 echo " Wave file support .............disabled"
1382 if test x$enable_wavpack = xyes; then
1383 echo " WavPack support ...............enabled"
1385 echo " WavPack support ...............disabled"
1388 if test x$enable_wildmidi = xyes; then
1389 echo " wildmidi MIDI support .........enabled"
1391 echo " wildmidi MIDI support .........disabled"
1397 test x$enable_mad = xno &&
1398 test x$enable_vorbis = xno &&
1399 test x$enable_flac = xno &&
1400 test x$enable_oggflac = xno &&
1401 test x$enable_audiofile = xno &&
1402 test x$enable_aac = xno &&
1403 test x$enable_mpc = xno &&
1404 test x$enable_wavpack = xno &&
1405 test x$enable_ffmpeg = xno &&
1406 test x$enable_modplug = xno &&
1407 test x$enable_sidplay = xno &&
1408 test x$enable_fluidsynth = xno &&
1409 test x$enable_wildmidi = xno &&
1410 test x$enable_mp4 = xno &&
1411 test x$enable_mikmod = xno; then
1412 AC_MSG_ERROR([No input plugins supported!])
1416 echo " Archive support:"
1418 if test x$enable_bzip2 = xyes; then
1419 echo " BZ2 archives support ..........enabled"
1421 echo " BZ2 archives support ..........disabled"
1424 if test x$enable_iso9660 = xyes; then
1425 echo " ISO 9660 archives support .....enabled"
1427 echo " ISO 9660 archives support .....disabled"
1430 if test x$enable_zip = xyes; then
1431 echo " ZIP archives support ..........enabled"
1433 echo " ZIP archives support ..........disabled"
1437 echo " Streaming support:"
1439 if test x$enable_lastfm = xyes; then
1440 echo " last.fm radio support .........enabled"
1442 echo " last.fm radio support .........disabled"
1445 if test x$enable_curl = xyes; then
1446 echo " libcurl support (streaming) ...enabled"
1448 echo " libcurl support (streaming) ...disabled"
1451 if test x$enable_mms = xyes; then
1452 echo " libmms support ................enabled"
1454 echo " libmms support ................disabled"
1458 echo " Other features:"
1460 if test x$enable_id3 = xyes; then
1461 echo " ID3 tag support ...............enabled"
1463 echo " ID3 tag support ...............disabled"
1466 if test x$enable_lsr = xyes; then
1467 echo " libsamplerate support .........enabled"
1469 echo " libsamplerate support .........disabled"
1472 if test x$with_zeroconf != xno; then
1473 echo " Zeroconf support ..............$with_zeroconf"
1475 echo " Zeroconf support ..............disabled"
1478 if test x$enable_cue = xyes; then
1479 echo " libcue support ................enabled"
1481 echo " libcue support ................disabled"
1485 echo "##########################################"
1488 echo "Generating needed files for compilation"
1499 echo "You are now ready to compile MPD"
1500 echo "Type \"make\" to compile MPD"