2 AC_INIT(mpd, 0.14~beta1, 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])
15 AC_DEFINE(PROTOCOL_VERSION, "0.14.0", [The mpd protocol version])
20 if test -z "$prefix" || test "x$prefix" = xNONE; then
24 # aren't autotools supposed to be smart enough to figure this out? oh
25 # well, the git-core Makefile managed to do some of the work for us :)
28 local_lib='/sw/lib /opt/local/lib'
29 local_include='/sw/include /opt/local/include'
32 local_lib=/usr/local/lib
33 local_include=/usr/local/include
36 local_lib=/usr/pkg/lib
37 local_include=/usr/pkg/include
38 LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/pkg/lib"
42 for d in $local_lib; do
44 LDFLAGS="$LDFLAGS -L$d"
48 for d in $local_include; do
62 AS_HELP_STRING([--enable-werror],
63 [Treat warnings as errors (default: disabled)]),
64 ENABLE_WERROR=$enableval,
68 AS_HELP_STRING([--enable-debug],
69 [Enable debugging (default: disabled)]),
70 ENABLE_DEBUG=$enableval,
74 AS_HELP_STRING([--enable-gprof],
75 [Enable profiling via gprof (default: disabled)]),
76 ENABLE_GPROF=$enableval,
85 AS_HELP_STRING([--disable-ipv6],
86 [disable IPv6 support (default: enable)]),
87 [enable_ipv6=$enableval],
91 AS_HELP_STRING([--disable-tcp],
92 [disable support for clients connecting via TCP (default: enable)]),
93 [enable_tcp=$enableval],
97 AS_HELP_STRING([--enable-un],
98 [enable support for clients connecting via unix domain sockets (default: disable)]),
99 [enable_un=$enableval],
108 AS_HELP_STRING([--disable-curl],
109 [enable support obtaining song data via HTTP (default: enable)]),
110 [enable_curl=$enableval],
115 dnl audio output plugins
119 AS_HELP_STRING([--enable-ao],
120 [enable support for libao (default: disable)]),
121 enable_ao=$enableval,
124 AC_ARG_ENABLE(shout_ogg,
125 AS_HELP_STRING([--disable-shout_ogg],
126 [disable support for ogg streaming through shout (default: enable)]),
127 [enable_shout_ogg=$enableval],
128 [enable_shout_ogg=yes])
130 AC_ARG_ENABLE(shout_mp3,
131 AS_HELP_STRING([--disable-shout_mp3],
132 [disable support for mp3 streaming through shout (default: enable)]),
133 [enable_shout_mp3=$enableval],
134 [enable_shout_mp3=yes])
137 AS_HELP_STRING([--disable-oss],
138 [disable OSS support (default: enable)]),
139 enable_oss=$enableval,
143 AS_HELP_STRING([--disable-alsa],
144 [disable ALSA support (default: enable)]),
145 enable_alsa=$enableval,
149 AS_HELP_STRING([--disable-jack],
150 [disable jack support (default: enable)]),
151 enable_jack=$enableval,
155 AS_HELP_STRING([--disable-pulse],
156 [disable support for the PulseAudio sound server (default: enable)]),
157 enable_pulse=$enableval,
161 AS_HELP_STRING([--disable-fifo],
162 [disable support for writing audio to a FIFO (default: enable)]),
163 enable_fifo=$enableval,
167 AS_HELP_STRING([--enable-mvp],
168 [enable support for Hauppauge Media MVP (default: disable)]),
169 enable_mvp=$enableval,
177 AC_ARG_ENABLE(oggvorbis,
178 AS_HELP_STRING([--disable-oggvorbis],
179 [disable Ogg Vorbis support (default: enable)]),
180 enable_oggvorbis=$enableval,
181 enable_oggvorbis=yes)
183 AC_ARG_ENABLE(oggflac,
184 AS_HELP_STRING([--disable-oggflac],
185 [disable OggFLAC support (default: enable)]),
186 enable_oggflac=$enableval,
190 AS_HELP_STRING([--disable-flac],
191 [disable flac support (default: enable)]),
192 enable_flac=$enableval,
196 AS_HELP_STRING([--disable-mp3],
197 [disable mp3 support (default: enable)]),
198 enable_mp3=$enableval,
202 AS_HELP_STRING([--disable-lame],
203 [disable lame support (default: enable)]),
204 enable_lame=$enableval,
208 AS_HELP_STRING([--disable-aac],
209 [disable AAC support (default: enable)]),
210 enable_aac=$enableval,
213 AC_ARG_ENABLE(audiofile,
214 AS_HELP_STRING([--disable-audiofile],
215 [disable audiofile support, disables wave support (default: enable)]),
216 enable_audiofile=$enableval,
217 enable_audiofile=yes)
220 AS_HELP_STRING([--enable-mod],
221 [enable MOD support (default: disable)]),
222 enable_mod=$enableval,
226 AS_HELP_STRING([--disable-mpc],
227 [disable musepack (MPC) support (default: enable)]),
228 enable_mpc=$enableval,
231 AC_ARG_ENABLE(wavpack,
232 AS_HELP_STRING([--disable-wavpack],
233 [disable WavPack support (default: enable)]),
234 enable_wavpack=$enableval,
237 AC_ARG_ENABLE(ffmpeg,
238 AS_HELP_STRING([--disable-ffmpeg],
239 [enable FFMPEG support (default: enable)]),
240 enable_ffmpeg=$enableval,
244 AS_HELP_STRING([--disable-id3],
245 [disable id3 support (default: enable)]),
246 enable_id3=$enableval,
250 AS_HELP_STRING([--disable-lsr],
251 [disable libsamplerate support (default: enable)]),
252 enable_lsr=$enableval,
256 AC_ARG_WITH(tremor,[[ --with-tremor[=PFX] Use Tremor(vorbisidec) integer Ogg-Vorbis decoder (with optional prefix)]], use_tremor=yes; test x$withval != xyes && tremor_prefix="$withval",)
257 AC_ARG_WITH(tremor-libraries,[ --with-tremor-libraries=DIR Directory where Tremor library is installed (optional)], tremor_libraries="$withval", tremor_libraries="")
258 AC_ARG_WITH(tremor-includes,[ --with-tremor-includes=DIR Directory where Tremor header files are installed (optional)], tremor_includes="$withval", tremor_includes="")
260 AC_ARG_WITH(faad,[ --with-faad=PFX Prefix where faad2 is installed], faad_prefix="$withval", faad_prefix="")
261 AC_ARG_WITH(faad-libraries,[ --with-faad-libraries=DIR Directory where faad2 library is installed (optional)], faad_libraries="$withval", faad_libraries="")
262 AC_ARG_WITH(faad-includes,[ --with-faad-includes=DIR Directory where faad2 header files are installed (optional)], faad_includes="$withval", faad_includes="")
263 AC_ARG_WITH(zeroconf,[[ --with-zeroconf=[auto|avahi|bonjour|no] Enable zeroconf backend (default=auto)]], with_zeroconf="$withval", with_zeroconf="auto")
267 AC_CHECK_HEADER(sys/inttypes.h,AC_DEFINE(HAVE_SYS_INTTYPES_H,1,[Define if sys/inttypes.h present]),)
269 AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
270 AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
272 AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)
273 AC_CHECK_FUNCS(setenv)
275 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.4 gthread-2.0],,
276 [AC_MSG_ERROR([glib-2.4 is required])])
278 dnl doesn't work for systems that don't have CODESET like OpenBSD
279 dnl AC_CHECK_HEADER(langinfo.h,[enable_langinfo=yes;AC_DEFINE(HAVE_LANGINFO,1,[Define if nl_langinfo.h is present])],enable_langinfo=no)
281 AC_CHECK_HEADER(locale.h,[enable_locale=yes;AC_DEFINE(HAVE_LOCALE,1,[Define if locale.h is present])],enable_locale=no)
283 ACX_PTHREAD([CC="$PTHREAD_CC"
284 LIBS="$PTHREAD_LIBS $LIBS"
285 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"])
287 if test x$enable_tcp = xno; then
288 # if we don't support TCP, we don't need IPv6 either
292 if test x$enable_ipv6 = xyes; then
293 AC_MSG_CHECKING(for ipv6)
294 AC_EGREP_CPP([AP_maGiC_VALUE],
296 #include <sys/types.h>
297 #include <sys/socket.h>
305 AC_DEFINE(HAVE_IPV6, 1, [Define if IPv6 support present])
306 AC_MSG_RESULT([yes]),
311 if test x$enable_tcp = xyes; then
312 AC_DEFINE(HAVE_TCP, 1, [Define if TCP socket support is enabled])
315 if test x$enable_un = xyes; then
316 AC_DEFINE(HAVE_UN, 1, [Define if unix domain socket support is enabled])
323 AC_DEFINE(HAVE_OSX, 1, [Define for compiling OS X support])
324 MPD_LIBS="$MPD_LIBS -framework AudioUnit -framework CoreServices"
328 AM_CONDITIONAL(HAVE_OSX, test x$enable_osx = xyes)
330 if test x$enable_curl = xyes; then
331 PKG_CHECK_MODULES(CURL, [libcurl],
332 AC_DEFINE(HAVE_CURL, 1, [Define when libcurl is used for HTTP streaming]),
335 AM_CONDITIONAL(HAVE_CURL, test x$enable_curl = xyes)
337 if test x$enable_shout_ogg = xyes || test x$enable_shout_mp3 = xyes; then
339 PKG_CHECK_MODULES([SHOUT], [shout],
340 AC_DEFINE(HAVE_SHOUT, 1, [Define to enable libshout support]),
344 if test x$enable_shout_ogg = xyes; then
345 if test x$enable_oggvorbis = xno; then
346 AC_MSG_WARN([disabling ogg shout streaming support because vorbis is not enabled])
349 if test x$use_tremor = xyes; then
350 AC_MSG_WARN([disabling ogg shout streaming support because tremor does not support vorbis encoding])
353 if test x$enable_shout = xno; then
354 AC_MSG_WARN([disabling ogg shout streaming support because libshout is not found])
357 if test x$enable_shout_ogg = xyes; then
358 PKG_CHECK_MODULES(VORBISENC, [vorbisenc],
359 AC_DEFINE(HAVE_SHOUT_OGG, 1, [Define to enable ogg streaming support]),
364 if test x$enable_shout_mp3 = xyes; then
365 if test x$enable_lame = xno; then
366 AC_MSG_WARN([disabling mp3 shout streaming support because lame is not enabled])
369 if test x$enable_shout = xno; then
370 AC_MSG_WARN([disabling mp3 shout streaming support because libshout is not found])
373 if test x$enable_shout_mp3 = xyes; then
374 AC_DEFINE(HAVE_SHOUT_MP3, 1, [Define to enable mp3 streaming support])
378 AM_CONDITIONAL(HAVE_SHOUT, test x$enable_shout = xyes)
379 AM_CONDITIONAL(HAVE_SHOUT_OGG, test x$enable_shout_ogg = xyes)
380 AM_CONDITIONAL(HAVE_SHOUT_MP3, test x$enable_shout_mp3 = xyes)
382 if test x$enable_ao = xyes; then
383 PKG_CHECK_MODULES(AO, [ao],
384 AC_DEFINE(HAVE_AO, 1, [Define to play with ao]),
388 AM_CONDITIONAL(HAVE_AO, test x$enable_ao = xyes)
390 if test x$enable_oss = xyes; then
391 AC_CHECK_HEADER(sys/soundcard.h,[enable_oss=yes;AC_DEFINE(HAVE_OSS,1,[Define to enable OSS])],[AC_MSG_WARN(Soundcard headers not found -- disabling OSS support);enable_oss=no])
394 AM_CONDITIONAL(HAVE_OSS, test x$enable_oss = xyes)
398 if test x$enable_pulse = xyes; then
399 PKG_CHECK_MODULES([PULSE], [libpulse-simple],
400 [enable_pulse=yes;AC_DEFINE([HAVE_PULSE], 1, [Define to enable PulseAudio support])] MPD_LIBS="$MPD_LIBS $PULSE_LIBS" MPD_CFLAGS="$MPD_CFLAGS $PULSE_CFLAGS",
401 [enable_pulse=no;AC_MSG_WARN([PulseAudio not found -- disabling])])
404 AM_CONDITIONAL(HAVE_PULSE, test x$enable_pulse = xyes)
406 if test x$enable_lsr = xyes; then
407 PKG_CHECK_MODULES([SAMPLERATE], [samplerate >= 0.0.15],
408 [enable_lsr=yes;AC_DEFINE([HAVE_LIBSAMPLERATE], 1, [Define to enable libsamplerate])] MPD_LIBS="$MPD_LIBS $SAMPLERATE_LIBS" MPD_CFLAGS="$MPD_CFLAGS $SAMPLERATE_CFLAGS",
409 [enable_lsr=no;AC_MSG_WARN([libsamplerate not found -- disabling])])
412 if test x$enable_lsr = xyes; then
413 PKG_CHECK_MODULES([SAMPLERATE_013], [samplerate >= 0.1.3],,
414 [AC_DEFINE([HAVE_LIBSAMPLERATE_NOINT], 1, [libsamplerate doesn't provide src_int_to_float_array() (<0.1.3)])])
417 AM_CONDITIONAL(HAVE_LIBSAMPLERATE, test x$enable_lsr = xyes)
419 if test x$enable_fifo = xyes; then
420 AC_CHECK_FUNC([mkfifo],
421 [enable_fifo=yes;AC_DEFINE([HAVE_FIFO], 1, [Define to enable support for writing audio to a FIFO])],
422 [enable_fifo=no;AC_MSG_WARN([mkfifo not found -- disabling support for writing audio to a FIFO])])
425 AM_CONDITIONAL(HAVE_FIFO, test x$enable_fifo = xyes)
427 if test x$enable_mvp = xyes; then
428 AC_DEFINE(HAVE_MVP,1,[Define to enable Hauppauge Media MVP support])
431 AM_CONDITIONAL(HAVE_MVP, test x$enable_mvp = xyes)
433 if test x$enable_alsa = xyes; then
434 PKG_CHECK_MODULES(ALSA, [alsa >= 0.9.0],
435 AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support]),
439 AM_CONDITIONAL(HAVE_ALSA, test x$enable_alsa = xyes)
441 if test x$enable_jack = xyes; then
442 PKG_CHECK_MODULES([JACK], [jack >= 0.4],
443 [enable_jack=yes;AC_DEFINE([HAVE_JACK], 1, [Define to enable JACK support])] MPD_LIBS="$MPD_LIBS $JACK_LIBS" MPD_CFLAGS="$MPD_CFLAGS $JACK_CFLAGS",
444 [enable_jack=no;AC_MSG_WARN([JACK not found -- disabling])])
447 AM_CONDITIONAL(HAVE_JACK, test x$enable_jack = xyes)
449 if test x$enable_id3 = xyes; then
450 PKG_CHECK_MODULES([ID3TAG], [id3tag],
451 AC_DEFINE(HAVE_ID3TAG, 1, [Define to use id3tag]),
455 AM_CONDITIONAL(HAVE_ID3TAG, test x$enable_id3 = xyes)
457 if test x$enable_mp3 = xyes; then
458 PKG_CHECK_MODULES([MAD], [mad],
459 AC_DEFINE(HAVE_MAD, 1, [Define to use libmad]),
463 AM_CONDITIONAL(HAVE_MAD, test x$enable_mp3 = xyes)
465 if test x$enable_lame = xyes; then
466 AM_PATH_LAME([MPD_LIBS="$MPD_LIBS $LAME_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LAME_CFLAGS"],
467 [enable_lame=no;AC_MSG_WARN(You need lame -- disabling lame support)])
471 if test x$enable_mpc = xyes; then
472 if test "x$mpcdec_libraries" != "x" ; then
473 MPCDEC_LIBS="-L$mpcdec_libraries"
474 elif test "x$mpcdec_prefix" != "x" ; then
475 MPCDEC_LIBS="-L$mpcdec_prefix/lib"
478 MPCDEC_LIBS="$MPCDEC_LIBS -lmpcdec"
480 if test "x$mpcdec_includes" != "x" ; then
481 MPCDEC_CFLAGS="-I$mpcdec_includes"
482 elif test "x$mpcdec_prefix" != "x" ; then
483 MPCDEC_CFLAGS="-I$mpcdec_prefix/include"
488 oldcppflags=$CPPFLAGS
489 CFLAGS="$CFLAGS $MPD_CFLAGS $MPCDEC_CFLAGS -I."
490 LIBS="$LIBS $MPD_LIBS $MPCDEC_LIBS"
492 AC_CHECK_HEADER(mpcdec/mpcdec.h,,enable_mpc=no)
493 if test x$enable_mpc = xyes; then
494 AC_CHECK_LIB(mpcdec,main,[MPD_LIBS="$MPD_LIBS $MPCDEC_LIBS";MPD_CFLAGS="$MPD_CFLAGS $MPCDEC_CFLAGS";],enable_mpc=no)
496 if test x$enable_mpc = xyes; then
497 AC_DEFINE(HAVE_MPCDEC,1,[Define to use libmpcdec for MPC decoding])
499 AC_MSG_WARN([mpcdec lib needed for MPC support -- disabling MPC support])
503 CPPFLAGS=$oldcppflags
506 AM_CONDITIONAL(HAVE_MPCDEC, test x$enable_mpc = xyes)
508 if test x$enable_wavpack = xyes; then
509 PKG_CHECK_MODULES([WAVPACK], [wavpack],
510 [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",
511 [enable_wavpack=no;AC_MSG_WARN([WavPack not found -- disabling])])
514 AM_CONDITIONAL(HAVE_WAVPACK, test x$enable_wavpack = xyes)
516 if test x$enable_aac = xyes; then
517 if test "x$faad_libraries" != "x" ; then
518 FAAD_LIBS="-L$faad_libraries"
519 elif test "x$faad_prefix" != "x" ; then
520 FAAD_LIBS="-L$faad_prefix/lib"
523 FAAD_LIBS="$FAAD_LIBS -lfaad"
525 if test "x$faad_includes" != "x" ; then
526 FAAD_CFLAGS="-I$faad_includes"
527 elif test "x$faad_prefix" != "x" ; then
528 FAAD_CFLAGS="-I$faad_prefix/include"
533 oldcppflags=$CPPFLAGS
534 CFLAGS="$CFLAGS $MPD_CFLAGS $FAAD_CFLAGS -I."
535 LIBS="$LIBS $MPD_LIBS $FAAD_LIBS"
537 AC_CHECK_HEADER(faad.h,,enable_aac=no)
538 if test x$enable_aac = xyes; then
539 AC_CHECK_DECL(FAAD2_VERSION,,enable_aac=no,[#include <faad.h>])
541 if test x$enable_aac = xyes; then
542 AC_CHECK_DECL(faacDecInit2,,enable_aac=no,[#include <faad.h>])
544 if test x$enable_aac = xyes; then
545 AC_CHECK_LIB(faad,faacDecInit2,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS"],enable_aac=no)
546 if test x$enable_aac = xno; then
548 AC_CHECK_LIB(faad,NeAACDecInit2,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS"],enable_aac=no)
551 if test x$enable_aac = xyes; then
552 AC_MSG_CHECKING(that FAAD2 uses buffer and bufferlen)
559 faacDecHandle decoder;
560 faacDecFrameInfo frameInfo;
561 faacDecConfigurationPtr config;
562 unsigned char channels;
564 mp4AudioSpecificConfig mp4ASC;
566 decoder = faacDecOpen();
567 config = faacDecGetCurrentConfiguration(decoder);
568 config->outputFormat = FAAD_FMT_16BIT;
569 faacDecSetConfiguration(decoder,config);
570 AudioSpecificConfig(&buffer, bufferlen, &mp4ASC);
571 faacDecInit(decoder,&buffer,bufferlen,&sampleRate,&channels);
572 faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
573 faacDecDecode(decoder,&frameInfo,&buffer,bufferlen);
577 ],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FAAD_BUFLEN_FUNCS,1,[Define if FAAD2 uses buflen in function calls])],[AC_MSG_RESULT(no);
578 AC_MSG_CHECKING(that FAAD2 can even be used)
584 faacDecHandle decoder;
585 faacDecFrameInfo frameInfo;
586 faacDecConfigurationPtr config;
587 unsigned char channels;
590 unsigned long dummy1_32;
591 unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
594 decoder = faacDecOpen();
595 config = faacDecGetCurrentConfiguration(decoder);
596 config->outputFormat = FAAD_FMT_16BIT;
597 faacDecSetConfiguration(decoder,config);
598 AudioSpecificConfig(&buffer,&dummy1_32,&dummy2_8,
599 &dummy3_8,&dummy4_8,&dummy5_8,
600 &dummy6_8,&dummy7_8,&dummy8_8);
601 faacDecInit(decoder,&buffer,&sampleRate,&channels);
602 faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
603 faacDecDecode(decoder,&frameInfo,&buffer);
604 faacDecClose(decoder);
608 ],AC_MSG_RESULT(yes),[AC_MSG_RESULT(no);enable_aac=no])
611 if test x$enable_aac = xyes; then
612 AC_CHECK_TYPES(mp4AudioSpecificConfig,,,[#include <faad.h>])
613 AC_CHECK_MEMBERS([faacDecConfiguration.downMatrix,faacDecConfiguration.dontUpSampleImplicitSBR,faacDecFrameInfo.samplerate],,,[#include <faad.h>])
614 AC_DEFINE(HAVE_FAAD,1,[Define to use FAAD2 for AAC decoding])
616 AC_MSG_WARN([faad2 lib needed for MP4/AAC support -- disabling MP4/AAC support])
620 CPPFLAGS=$oldcppflags
623 AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes)
625 if test x$enable_aac = xyes; then
628 oldcppflags=$CPPFLAGS
629 CFLAGS="$CFLAGS $MPD_CFLAGS $FAAD_CFLAGS -Werror"
630 LIBS="$LIBS $MPD_LIBS $FAAD_LIBS"
633 AC_MSG_CHECKING(for broken libfaad headers)
640 unsigned char channels;
641 uint32_t sample_rate;
643 faacDecInit2(NULL, NULL, 0, &sample_rate, &channels);
647 [AC_MSG_RESULT(correct)],
648 [AC_MSG_RESULT(broken);
649 AC_DEFINE(HAVE_FAAD_LONG, 1, [Define if faad.h uses the broken "unsigned long" pointers])])
653 CPPFLAGS=$oldcppflags
656 if test x$enable_aac = xyes; then
662 oldcppflags=$CPPFLAGS
663 CFLAGS="$CFLAGS $FAAD_CFLAGS"
664 LIBS="$LIBS $MP4FF_LIBS"
667 AC_CHECK_HEADER(mp4ff.h,,enable_mp4=no)
669 if test x$enable_mp4 = xyes; then
670 AC_CHECK_LIB(mp4ff,mp4ff_open_read,,enable_mp4=no)
673 if test x$enable_mp4 = xyes; then
675 AC_DEFINE(HAVE_MP4, 1, [Define to use FAAD2+mp4ff for MP4 decoding])
677 AC_MSG_WARN([libmp4ff needed for MP4 support -- disabling MP4 support])
683 CPPFLAGS=$oldcppflags
686 AM_CONDITIONAL(HAVE_MP4, test x$enable_mp4 = xyes)
688 if test x$use_tremor = xyes; then
689 if test "x$tremor_libraries" != "x" ; then
690 TREMOR_LIBS="-L$tremor_libraries"
691 elif test "x$tremor_prefix" != "x" ; then
692 TREMOR_LIBS="-L$tremor_prefix/lib"
694 TREMOR_LIBS="$TREMOR_LIBS -lvorbisidec"
695 if test "x$tremor_includes" != "x" ; then
696 TREMOR_CFLAGS="-I$tremor_includes"
697 elif test "x$tremor_prefix" != "x" ; then
698 TREMOR_CFLAGS="-I$tremor_prefix/include"
700 ac_save_CFLAGS="$CFLAGS"
702 CFLAGS="$CFLAGS $TREMOR_CFLAGS"
703 LIBS="$LIBS $TREMOR_LIBS"
704 AC_CHECK_LIB(vorbisidec,ov_read,enable_oggvorbis=yes,enable_oggvorbis=no;AC_MSG_WARN([vorbisidec lib needed for ogg support with tremor -- disabling ogg support]))
705 if test x$enable_oggvorbis = xno; then
706 CFLAGS="$ac_save_CFLAGS"
709 elif test x$enable_oggvorbis = xyes; then
710 PKG_CHECK_MODULES(OGGVORBIS, [ogg vorbis vorbisfile],
711 AC_DEFINE(HAVE_OGGVORBIS, 1, [Define for Ogg Vorbis support]),
715 AM_CONDITIONAL(HAVE_OGGVORBIS, test x$enable_oggvorbis = xyes)
717 if test x$use_tremor = xyes; then
718 AC_DEFINE(HAVE_TREMOR,1,[Define to use tremor (libvorbisidec) for ogg support])
719 if test x$enable_oggflac = xyes; then
720 AC_MSG_WARN([disabling OggFLAC support because it is incompatible with tremor])
725 if test x$enable_flac = xyes; then
726 PKG_CHECK_MODULES(FLAC, [flac >= 1.1],
727 AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support]),
732 CFLAGS="$CFLAGS $FLAC_CFLAGS"
733 LIBS="$LIBS $FLAC_LIBS"
734 if test x$enable_flac = xyes && test x$enable_oggflac = xyes; then
735 AC_CHECK_DECL(FLAC_API_SUPPORTS_OGG_FLAC,
736 [enable_oggflac=flac], [],
737 [#include <FLAC/export.h>])
743 AM_CONDITIONAL(HAVE_FLAC, test x$enable_flac = xyes)
745 if test x$enable_oggflac = xyes; then
746 oldmpdcflags="$MPD_CFLAGS"
747 oldmpdlibs="$MPD_LIBS"
748 AM_PATH_LIBOGGFLAC(MPD_LIBS="$MPD_LIBS $LIBOGGFLAC_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LIBOGGFLAC_CFLAGS",enable_oggflac=no)
751 if test x$enable_oggflac = xyes; then
752 AC_DEFINE(HAVE_OGGFLAC,1,[Define for OggFLAC support])
755 AM_CONDITIONAL(HAVE_OGGFLAC, test x$enable_oggflac = xyes)
757 AM_CONDITIONAL(HAVE_FLAC_COMMON, test x$enable_flac = xyes || test x$enable_oggflac = xyes)
758 AM_CONDITIONAL(HAVE_OGG_COMMON, test x$enable_oggvorbis = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes)
760 if test x$enable_audiofile = xyes; then
761 PKG_CHECK_MODULES(AUDIOFILE, [audiofile >= 0.1.7],
762 AC_DEFINE(HAVE_AUDIOFILE, 1, [Define for audiofile support]),
766 AM_CONDITIONAL(HAVE_AUDIOFILE, test x$enable_audiofile = xyes)
768 if test x$enable_mod = xyes; then
769 AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config)
770 if test x$LIBMIKMOD_CONFIG != x ; then
771 AC_SUBST(LIBMIKMOD_CFLAGS, `$LIBMIKMOD_CONFIG --cflags`)
772 AC_SUBST(LIBMIKMOD_LIBS, `$LIBMIKMOD_CONFIG --libs`)
773 AC_DEFINE(HAVE_MIKMOD, 1, [Define for mikmod support])
779 AM_CONDITIONAL(HAVE_MIKMOD, test x$enable_mod = xyes)
781 if test x$enable_ffmpeg = xyes; then
782 PKG_CHECK_MODULES(FFMPEG, [libavformat libavcodec libavutil],
783 AC_DEFINE(HAVE_FFMPEG, 1, [Define for FFMPEG support]),
787 if test x$enable_ffmpeg = xyes; then
789 LIBS="$LIBS $FFMPEG_LIBS"
790 AC_CHECK_LIB(avcodec, avcodec_decode_audio2,,
795 if test x$enable_ffmpeg = xyes; then
796 # prior to ffmpeg svn12865, you had to specify include files
797 # without path prefix
798 old_CPPCFLAGS=$CPPFLAGS
799 CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
800 AC_CHECK_HEADER(libavcodec/avcodec.h,,
801 AC_DEFINE(OLD_FFMPEG_INCLUDES, 1,
802 [Define if avcodec.h instead of libavcodec/avcodec.h should be included]))
803 CPPCFLAGS=$old_CPPFLAGS
806 AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes)
808 case $with_zeroconf in
816 if test x$with_zeroconf != xno; then
817 if test x$with_zeroconf = xavahi || test x$with_zeroconf = xauto; then
818 PKG_CHECK_MODULES([AVAHI], [avahi-client],
819 [found_avahi=1;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])]
820 MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS",
824 if test x$found_avahi = x1; then
826 elif test x$with_zeroconf = xavahi; then
827 AC_MSG_ERROR([Avahi support requested but not found])
830 if test x$with_zeroconf = xbonjour || test x$with_zeroconf = xauto; then
831 AC_CHECK_HEADER(dns_sd.h,
832 [found_bonjour=1;AC_DEFINE([HAVE_BONJOUR], 1, [Define to enable Bonjour Zeroconf support])],
834 AC_CHECK_LIB(dns_sd, DNSServiceRegister,
835 MPD_LIBS="$MPD_LIBS -ldns_sd")
838 if test x$found_bonjour = x1; then
839 with_zeroconf=bonjour
840 elif test x$with_zeroconf = xbonjour; then
841 AC_MSG_ERROR([Bonjour support requested but not found])
844 if test x$with_zeroconf = xauto; then
845 AC_MSG_WARN([No supported Zeroconf backend found, disabling Zeroconf])
848 AC_DEFINE([HAVE_ZEROCONF], 1, [Define to enable Zeroconf support])
852 AM_CONDITIONAL(HAVE_ZEROCONF, test x$with_zeroconf != xno)
859 AC_MSG_CHECKING([for xmlto (DocBook processing)])
860 AC_PATH_PROG(XMLTO, xmlto)
861 if test x$XMLTO != x; then
863 AC_MSG_RESULT($XMLTO)
868 AM_CONDITIONAL(HAVE_XMLTO, test x$XMLTO != x)
875 if test "x$ENABLE_WERROR" = xyes; then
876 MPD_CFLAGS="$MPD_CFLAGS -Werror -pedantic-errors"
879 #if test "x$ENABLE_DEBUG" = xno; then
880 # don't set NDEBUG for now, until MPD is stable
881 #MPD_CFLAGS="$MPD_CFLAGS -DNDEBUG"
884 if test "x$ENABLE_GPROF" = xyes; then
885 MPD_CFLAGS="$MPD_CFLAGS -pg"
895 MPD_CHECK_FLAG([-Wall])
896 MPD_CHECK_FLAG([-Wextra])
897 MPD_CHECK_FLAG([-Wno-deprecated-declarations])
898 MPD_CHECK_FLAG([-Wmissing-prototypes])
899 MPD_CHECK_FLAG([-Wdeclaration-after-statement])
900 MPD_CHECK_FLAG([-Wshadow])
901 MPD_CHECK_FLAG([-Wpointer-arith])
902 MPD_CHECK_FLAG([-Wstrict-prototypes])
903 MPD_CHECK_FLAG([-Wcast-qual])
904 MPD_CHECK_FLAG([-Wwrite-strings])
905 MPD_CHECK_FLAG([-pedantic])
914 AC_OUTPUT(doc/Makefile src/Makefile Makefile)
918 dnl pretty-print result
922 echo "########### MPD CONFIGURATION ############"
925 echo " Client Support:"
926 if test x$enable_tcp = xyes; then
927 echo " TCP support ...................enabled"
929 echo " TCP support ...................disabled"
932 if test x$enable_ipv6 = xyes; then
933 echo " IPv6 support ..................enabled"
935 echo " IPv6 support ..................disabled"
938 if test x$enable_un = xyes; then
939 echo " Unix domain socket support ....enabled"
941 echo " Unix domain socket support ....disabled"
947 test x$enable_tcp = xno &&
948 test x$enable_un = xno; then
949 AC_MSG_ERROR([No client interfaces configured!])
952 echo " Playback Support:"
953 if test x$enable_ao = xyes; then
954 echo " libao support .................enabled"
956 echo " libao support .................disabled"
959 if test x$enable_oss = xyes; then
960 echo " OSS support ...................enabled"
962 echo " OSS support ...................disabled"
965 if test x$enable_alsa = xyes; then
966 echo " ALSA support ..................enabled"
968 echo " ALSA support ..................disabled"
971 if test x$enable_jack = xyes; then
972 echo " JACK support ..................enabled"
974 echo " JACK support ..................disabled"
977 if test x$enable_osx = xyes; then
978 echo " OS X support ..................enabled"
980 echo " OS X support ..................disabled"
983 if test x$enable_pulse = xyes; then
984 echo " PulseAudio support ............enabled"
986 echo " PulseAudio support ............disabled"
989 if test x$enable_fifo = xyes; then
990 echo " FIFO support ..................enabled"
992 echo " FIFO support ..................disabled"
995 if test x$enable_mvp = xyes; then
996 echo " Media MVP support .............enabled"
998 echo " Media MVP support .............disabled"
1001 if test x$enable_shout_ogg = xyes; then
1002 echo " Shout ogg streaming support ...enabled"
1004 echo " Shout ogg streaming support ...disabled"
1007 if test x$enable_shout_mp3 = xyes; then
1008 echo " Shout mp3 streaming support ...enabled"
1010 echo " Shout mp3 streaming support ...disabled"
1015 if test x$enable_ao = xno &&
1016 test x$enable_oss = xno &&
1017 test x$enable_shout_ogg = xno &&
1018 test x$enable_shout_mp3 = xno &&
1019 test x$enable_alsa = xno &&
1020 test x$enable_osx = xno &&
1021 test x$enable_pulse = xno &&
1022 test x$enable_jack = xno &&
1023 test x$enable_fifo = xno &&
1024 test x$enable_mvp = xno; then
1025 AC_MSG_ERROR([No Audio Output types configured!])
1028 echo " File Format Support:"
1030 if test x$enable_id3 = xyes; then
1031 echo " ID3 tag support ...............enabled"
1033 echo " ID3 tag support ...............disabled"
1036 if test x$enable_mp3 = xyes; then
1037 echo " mp3 support ...................enabled"
1039 echo " mp3 support ...................disabled"
1042 if test x$enable_lame = xyes; then
1043 echo " lame support ..................enabled"
1045 echo " lame support ..................disabled"
1048 if test x$enable_oggvorbis = xyes; then
1049 echo " Ogg Vorbis support ............enabled"
1050 if test x$use_tremor = xyes; then
1051 echo " using tremor.................yes"
1053 echo " using tremor.................no"
1056 echo " Ogg Vorbis support ............disabled"
1059 if test x$enable_flac = xyes; then
1060 echo " FLAC support ..................enabled"
1062 echo " FLAC support ..................disabled"
1065 case $enable_oggflac in
1067 echo " OggFLAC support ...............enabled"
1070 echo " OggFLAC support ...............enabled(FLAC 1.1.3)"
1073 echo " OggFLAC support ...............disabled"
1077 if test x$enable_audiofile = xyes; then
1078 echo " Wave file support .............enabled"
1080 echo " Wave file support .............disabled"
1083 if test x$enable_aac = xyes; then
1084 echo " AAC support ...................enabled"
1086 echo " AAC support ...................disabled"
1089 if test x$enable_mp4 = xyes; then
1090 echo " MP4 support ...................enabled"
1092 echo " MP4 support ...................disabled"
1095 if test x$enable_mpc = xyes; then
1096 echo " Musepack (MPC) support ........enabled"
1098 echo " Musepack (MPC) support ........disabled"
1101 if test x$enable_wavpack = xyes; then
1102 echo " WavPack support ...............enabled"
1104 echo " WavPack support ...............disabled"
1107 if test x$enable_mod = xyes; then
1108 echo " MOD support ...................enabled"
1110 echo " MOD support ...................disabled"
1113 if test x$enable_ffmpeg = xyes; then
1114 echo " FFMPEG support ................enabled"
1116 echo " FFMPEG support ................disabled"
1120 test x$enable_mp3 = xno &&
1121 test x$enable_oggvorbis = xno &&
1122 test x$enable_flac = xno &&
1123 test x$enable_oggflac = xno &&
1124 test x$enable_audiofile = xno &&
1125 test x$enable_aac = xno &&
1126 test x$enable_mpc = xno &&
1127 test x$enable_wavpack = xno &&
1128 test x$enable_ffmpeg = xno &&
1129 test x$enable_mod = xno; then
1130 AC_MSG_ERROR([No input plugins supported!])
1134 echo " Other features:"
1136 if test x$enable_lsr = xyes; then
1137 echo " libsamplerate support .........enabled"
1139 echo " libsamplerate support .........disabled"
1143 if test x$with_zeroconf != xno; then
1144 echo " Zeroconf support ..............$with_zeroconf"
1146 echo " Zeroconf support ..............disabled"
1150 echo "##########################################"
1152 echo "You are now ready to compile MPD"
1153 echo "Type \"make\" to compile MPD"