configure.ac: Move wavpack to Decoder Plugins, add header.
[mpd-mk.git] / configure.ac
blob2fa93efba68205e450f4f88b134a1dc62a359682
1 AC_PREREQ(2.60)
2 AC_INIT(mpd, 0.16~git, musicpd-dev-team@lists.sourceforge.net)
3 AC_CONFIG_SRCDIR([src/main.c])
4 AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects])
5 AM_CONFIG_HEADER(config.h)
6 AC_CONFIG_MACRO_DIR([m4])
8 AC_DEFINE(PROTOCOL_VERSION, "0.16.0", [The MPD protocol version])
11 dnl ---------------------------------------------------------------------------
12 dnl Programs
13 dnl ---------------------------------------------------------------------------
14 AC_PROG_CC_C99
15 AC_PROG_CXX
17 HAVE_CXX=yes
18 if test x$CXX = xg++; then
19         # CXX=g++ probably means that autoconf hasn't found any C++
20         # compiler; to be sure, we check again
21         AC_PATH_PROG(CXX, $CXX, no)
22         if test x$CXX = xno; then
23                 # no, we don't have C++ - the following hack is
24                 # required because automake insists on using $(CXX)
25                 # for linking the MPD binary
26                 AC_MSG_NOTICE([Disabling C++ support])
27                 CXX="$CC"
28                 HAVE_CXX=no
29         fi
32 AC_PROG_INSTALL
33 AC_PROG_MAKE_SET
34 PKG_PROG_PKG_CONFIG
36 dnl ---------------------------------------------------------------------------
37 dnl Declare Variables
38 dnl ---------------------------------------------------------------------------
39 AC_SUBST(AM_CFLAGS,"")
41 AC_SUBST(MPD_LIBS)
42 AC_SUBST(MPD_CFLAGS)
43 MPD_LIBS=""
44 MPD_CFLAGS=""
46 dnl ---------------------------------------------------------------------------
47 dnl OS Specific Defaults
48 dnl ---------------------------------------------------------------------------
49 AC_CANONICAL_HOST
51 case "$host_os" in
52 mingw32* | windows*)
53         MPD_LIBS="$MPD_LIBS -lws2_32"
54         ;;
55 esac
57 if test -z "$prefix" || test "x$prefix" = xNONE; then
58         local_lib=
59         local_include=
61         # aren't autotools supposed to be smart enough to figure this out?  oh
62         # well, the git-core Makefile managed to do some of the work for us :)
63         case "$host_os" in
64         darwin*)
65                 local_lib='/sw/lib /opt/local/lib'
66                 local_include='/sw/include /opt/local/include'
67                 ;;
68         freebsd* | openbsd*)
69                 local_lib=/usr/local/lib
70                 local_include=/usr/local/include
71                 ;;
72         netbsd*)
73                 local_lib=/usr/pkg/lib
74                 local_include=/usr/pkg/include
75                 LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/pkg/lib"
76                 ;;
77         esac
79         for d in $local_lib; do
80                 if test -d "$d"; then
81                         LDFLAGS="$LDFLAGS -L$d"
82                         break
83                 fi
84         done
85         for d in $local_include; do
86                 if test -d "$d"; then
87                         CFLAGS="$CFLAGS -I$d"
88                         break
89                 fi
90         done
93 dnl ---------------------------------------------------------------------------
94 dnl Header/Library Checks
95 dnl ---------------------------------------------------------------------------
96 AC_CHECK_FUNCS(daemon fork syslog)
97 if test $ac_cv_func_syslog = no; then
98         # syslog is not in the default libraries.  See if it's in some other.
99         for lib in bsd socket inet; do
100                 AC_CHECK_LIB($lib, syslog,
101                         [AC_DEFINE(HAVE_SYSLOG)
102                         LIBS="$LIBS -l$lib"; break])
103         done
106 AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
107 AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
109 AC_CHECK_FUNCS(pipe2 accept4)
111 AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)
113 AC_CHECK_HEADERS(locale.h)
114 AC_CHECK_HEADERS(valgrind/memcheck.h)
116 dnl ---------------------------------------------------------------------------
117 dnl Allow tools to be specifically built
118 dnl ---------------------------------------------------------------------------
119 AC_ARG_ENABLE(alsa,
120         AS_HELP_STRING([--enable-alsa], [enable ALSA support]),,
121         [enable_alsa=auto])
123 AC_ARG_ENABLE(ao,
124         AS_HELP_STRING([--enable-ao],
125                 [enable support for libao]),,
126         enable_ao=auto)
128 AC_ARG_ENABLE(audiofile,
129         AS_HELP_STRING([--enable-audiofile],
130                 [enable audiofile support (WAV and others)]),,
131         enable_audiofile=auto)
133 AC_ARG_ENABLE(bzip2,
134         AS_HELP_STRING([--enable-bzip2],
135                 [enable bzip2 archive support (default: disabled)]),,
136         enable_bzip2=no)
138 AC_ARG_ENABLE(cue,
139         AS_HELP_STRING([--enable-cue],
140                 [enable support for libcue support]),,
141         enable_cue=auto)
143 AC_ARG_ENABLE(curl,
144         AS_HELP_STRING([--enable-curl],
145                 [enable support for libcurl HTTP streaming (default: auto)]),,
146         [enable_curl=auto])
148 AC_ARG_ENABLE(debug,
149         AS_HELP_STRING([--enable-debug],
150                 [enable debugging (default: disabled)]),,
151         enable_debug=no)
153 AC_ARG_ENABLE(documentation,
154         AS_HELP_STRING([--enable-documentation],
155                 [build documentation (default: disable)]),,
156         [enable_documentation=no])
158 AC_ARG_ENABLE(ffmpeg,
159         AS_HELP_STRING([--enable-ffmpeg],
160                 [enable FFMPEG support]),,
161         enable_ffmpeg=auto)
163 AC_ARG_ENABLE(fifo,
164         AS_HELP_STRING([--disable-fifo],
165                 [disable support for writing audio to a FIFO (default: enable)]),,
166         enable_fifo=yes)
168 AC_ARG_ENABLE(flac,
169         AS_HELP_STRING([--disable-flac],
170                 [disable flac support (default: enable)]),,
171         enable_flac=yes)
173 AC_ARG_ENABLE(fluidsynth,
174         AS_HELP_STRING([--enable-fluidsynth],
175                 [enable MIDI support via fluidsynth (default: disable)]),,
176         enable_fluidsynth=no)
178 AC_ARG_ENABLE(gme,
179         AS_HELP_STRING([--enable-gme],
180                 [enable Blargg's game music emulator plugin]),,
181         enable_gme=auto)
183 AC_ARG_ENABLE(gprof,
184         AS_HELP_STRING([--enable-gprof],
185                 [enable profiling via gprof (default: disabled)]),,
186         enable_gprof=no)
188 AC_ARG_ENABLE(httpd-output,
189         AS_HELP_STRING([--enable-httpd-output],
190                 [enables the HTTP server output]),,
191         [enable_httpd_output=auto])
193 AC_ARG_ENABLE(id3,
194         AS_HELP_STRING([--disable-id3],
195                 [disable id3 support (default: enable)]),,
196         enable_id3=yes)
198 AC_ARG_ENABLE(inotify,
199         AS_HELP_STRING([--disable-inotify],
200                 [disable support Inotify automatic database update (default: enabled) ]),,
201         [enable_inotify=yes])
203 AC_ARG_ENABLE(ipv6,
204         AS_HELP_STRING([--disable-ipv6],
205                 [disable IPv6 support (default: enable)]),,
206         [enable_ipv6=yes])
208 AC_ARG_ENABLE(iso9660,
209         AS_HELP_STRING([--enable-iso9660],
210                 [enable iso9660 archive support (default: disabled)]),,
211         enable_iso9660=no)
213 AC_ARG_ENABLE(jack,
214         AS_HELP_STRING([--enable-jack],
215                 [enable jack support]),,
216         enable_jack=auto)
218 AC_SYS_LARGEFILE
220 AC_ARG_ENABLE(lastfm,
221         AS_HELP_STRING([--enable-lastfm],
222                 [enable support for last.fm radio (default: disable)]),,
223         [enable_lastfm=no])
225 AC_ARG_ENABLE(lame-encoder,
226         AS_HELP_STRING([--enable-lame-encoder],
227                 [enable the LAME mp3 encoder]),,
228         enable_lame_encoder=auto)
230 AC_ARG_ENABLE([libwrap],
231         AS_HELP_STRING([--enable-libwrap], [use libwrap]),,
232         [enable_libwrap=auto])
234 AC_ARG_ENABLE(lsr,
235         AS_HELP_STRING([--enable-lsr],
236                 [enable libsamplerate support]),,
237         enable_lsr=auto)
239 AC_ARG_ENABLE(mad,
240         AS_HELP_STRING([--enable-mad],
241                 [enable libmad mp3 decoder plugin]),,
242         enable_mad=auto)
244 AC_ARG_ENABLE(mikmod,
245         AS_HELP_STRING([--enable-mikmod],
246                 [enable the mikmod decoder (default: disable)]),,
247         enable_mikmod=no)
249 AC_ARG_ENABLE(mms,
250         AS_HELP_STRING([--enable-mms],
251                 [enable the MMS protocol with libmms]),,
252         [enable_mms=auto])
254 AC_ARG_ENABLE(modplug,
255         AS_HELP_STRING([--enable-modplug],
256                 [enable modplug decoder plugin]),,
257         enable_modplug=auto)
259 AC_ARG_ENABLE(mpc,
260         AS_HELP_STRING([--disable-mpc],
261                 [disable musepack (MPC) support (default: enable)]),,
262         enable_mpc=yes)
264 AC_ARG_ENABLE(mpg123,
265         AS_HELP_STRING([--enable-mpg123],
266                 [enable libmpg123 decoder plugin]),,
267         enable_mpg123=auto)
269 AC_ARG_ENABLE(mvp,
270         AS_HELP_STRING([--enable-mvp],
271                 [enable support for Hauppauge Media MVP (default: disable)]),,
272         enable_mvp=no)
274 AC_ARG_ENABLE(oggflac,
275         AS_HELP_STRING([--disable-oggflac],
276                 [disable OggFLAC support (default: enable)]),,
277         enable_oggflac=yes)
279 AC_ARG_ENABLE(openal,
280         AS_HELP_STRING([--enable-openal],
281                 [enable OpenAL support (default: disable)]),,
282         enable_openal=no)
284 AC_ARG_ENABLE(oss,
285         AS_HELP_STRING([--disable-oss],
286                 [disable OSS support (default: enable)]),,
287         enable_oss=yes)
289 AC_ARG_ENABLE(pipe-output,
290         AS_HELP_STRING([--enable-pipe-output],
291                 [enable support for writing audio to a pipe (default: disable)]),,
292         enable_pipe_output=no)
294 AC_ARG_ENABLE(pulse,
295         AS_HELP_STRING([--enable-pulse],
296                 [enable support for the PulseAudio sound server]),,
297         enable_pulse=auto)
299 AC_ARG_ENABLE(recorder-output,
300         AS_HELP_STRING([--enable-recorder-output],
301                 [enables the recorder file output plugin (default: disable)]),,
302         [enable_recorder_output=auto])
304 AC_ARG_ENABLE(sidplay,
305         AS_HELP_STRING([--enable-sidplay],
306                 [enable C64 SID support via libsidplay2]),,
307         enable_sidplay=auto)
310 AC_ARG_ENABLE(shout,
311         AS_HELP_STRING([--enable-shout],
312                 [enables the shoutcast streaming output]),,
313         [enable_shout=auto])
315 AC_ARG_ENABLE(sndfile,
316         AS_HELP_STRING([--enable-sndfile],
317                 [enable sndfile support]),,
318         enable_sndfile=auto)
320 AC_ARG_ENABLE(sqlite,
321         AS_HELP_STRING([--enable-sqlite],
322                 [enable support for the SQLite database]),,
323         [enable_sqlite=auto])
325 AC_ARG_ENABLE(tcp,
326         AS_HELP_STRING([--disable-tcp],
327                 [disable support for clients connecting via TCP (default: enable)]),,
328         [enable_tcp=yes])
330 AC_ARG_ENABLE(test,
331         AS_HELP_STRING([--enable-test],
332                 [build the test programs (default: disabled)]),,
333         enable_test=no)
335 AC_ARG_WITH(tremor,
336         AS_HELP_STRING([--with-tremor=PFX],
337                 [use Tremor (vorbisidec) integer Ogg Vorbis decoder (with optional prefix)]),,
338         with_tremor=no)
340 AC_ARG_ENABLE(twolame-encoder,
341         AS_HELP_STRING([--enable-twolame-encoder],
342                 [enable the TwoLAME mp2 encoder]),,
343         enable_twolame_encoder=auto)
345 AC_ARG_ENABLE(un,
346         AS_HELP_STRING([--disable-un],
347                 [disable support for clients connecting via unix domain sockets (default: enable)]),,
348         [enable_un=yes])
350 AC_ARG_ENABLE(vorbis,
351         AS_HELP_STRING([--disable-vorbis],
352                 [disable Ogg Vorbis support (default: enable)]),,
353         enable_vorbis=yes)
355 AC_ARG_ENABLE(vorbis-encoder,
356         AS_HELP_STRING([--enable-vorbis-encoder],
357                 [enable the Ogg Vorbis encoder]),,
358         [enable_vorbis_encoder=auto])
360 AC_ARG_ENABLE(wave-encoder,
361         AS_HELP_STRING([--enable-wave-encoder],
362                 [enable the PCM wave encoder]),,
363         enable_wave_encoder=yes)
365 AC_ARG_ENABLE(wavpack,
366         AS_HELP_STRING([--enable-wavpack],
367                 [enable WavPack support]),,
368         enable_wavpack=auto)
370 AC_ARG_ENABLE(werror,
371         AS_HELP_STRING([--enable-werror],
372                 [treat warnings as errors (default: disabled)]),,
373         enable_werror=no)
375 AC_ARG_ENABLE(wildmidi,
376         AS_HELP_STRING([--enable-wildmidi],
377                 [enable MIDI support via wildmidi (default: disable)]),,
378         enable_wildmidi=no)
380 AC_ARG_WITH(zeroconf,
381         AS_HELP_STRING([--with-zeroconf=@<:@auto|avahi|bonjour|no@:>@],
382                 [enable zeroconf backend (default=auto)]),,
383         with_zeroconf="auto")
385 AC_ARG_ENABLE(zzip,
386         AS_HELP_STRING([--enable-zzip],
387                 [enable zip archive support (default: disabled)]),,
388         enable_zzip=no)
391 AC_ARG_WITH(tremor-libraries,
392         AS_HELP_STRING([--with-tremor-libraries=DIR],
393                 [directory where Tremor library is installed (optional)]),,
394         tremor_libraries="")
396 AC_ARG_WITH(tremor-includes,
397         AS_HELP_STRING([--with-tremor-includes=DIR],
398                 [directory where Tremor header files are installed (optional)]),,
399         tremor_includes="")
401 dnl ---------------------------------------------------------------------------
402 dnl Mandatory Libraries
403 dnl ---------------------------------------------------------------------------
404 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.12 gthread-2.0],,
405                 [AC_MSG_ERROR([GLib 2.12 is required])])
407 dnl ---------------------------------------------------------------------------
408 dnl Protocol Options
409 dnl ---------------------------------------------------------------------------
411 if test x$enable_tcp = xno; then
412         # if we don't support TCP, we don't need IPv6 either
413         enable_ipv6=no
416 if test x$enable_ipv6 = xyes; then
417         AC_MSG_CHECKING(for ipv6)
418         AC_EGREP_CPP([AP_maGiC_VALUE],
419         [
420 #include <sys/types.h>
421 #include <sys/socket.h>
422 #include <netdb.h>
423 #ifdef PF_INET6
424 #ifdef AF_INET6
425 AP_maGiC_VALUE
426 #endif
427 #endif
428         ],
429         AC_DEFINE(HAVE_IPV6, 1, [Define if IPv6 support present])
430         AC_MSG_RESULT([yes]),
431         AC_MSG_RESULT([no])
435 if test x$enable_tcp = xyes; then
436         AC_DEFINE(HAVE_TCP, 1, [Define if TCP socket support is enabled])
439 case "$host_os" in
440 mingw* | windows*)
441         enable_un=no
442         ;;
443 esac
445 if test x$enable_un = xyes; then
446         AC_DEFINE(HAVE_UN, 1, [Define if unix domain socket support is enabled])
447         STRUCT_UCRED
450 dnl ---------------------------------------------------------------------------
451 dnl LIBC Features
452 dnl ---------------------------------------------------------------------------
453 if test x$enable_largefile != xno; then
454         AC_DEFINE([ENABLE_LARGEFILE], 1, [Define if large file support is enabled])
457 dnl ---------------------------------------------------------------------------
458 dnl Miscellaneous Libraries
459 dnl ---------------------------------------------------------------------------
461 dnl --------------------------------- inotify ---------------------------------
462 AC_CHECK_FUNCS(inotify_init inotify_init1)
464 if test x$ac_cv_func_inotify_init = xno; then
465         enable_inotify=no
468 if test x$enable_inotify = xyes; then
469         AC_DEFINE([ENABLE_INOTIFY], 1, [Define to enable inotify support])
471 AM_CONDITIONAL(ENABLE_INOTIFY, test x$enable_inotify = xyes)
473 dnl --------------------------------- libwrap ---------------------------------
474 if test x$enable_libwrap != xno; then
475         AC_CHECK_LIBWRAP(found_libwrap=yes, found_libwrap=no)
476         MPD_AUTO_RESULT(libwrap, libwrap, [libwrap not found])
479 if test x$enable_libwrap = xyes; then
480         AC_SUBST(LIBWRAP_CFLAGS)
481         AC_SUBST(LIBWRAP_LDFLAGS)
482         AC_DEFINE(HAVE_LIBWRAP, 1, [define to enable libwrap library])
485 dnl ---------------------------------------------------------------------------
486 dnl Metadata Plugins
487 dnl ---------------------------------------------------------------------------
489 dnl ---------------------------------- libcue ---------------------------------
490 MPD_AUTO_PKG(cue, CUE, [libcue],
491         [libcue parsing library], [libcue not found])
492 if test x$enable_cue = xyes; then
493         AC_DEFINE([HAVE_CUE], 1,
494                 [Define to enable libcue support])
497 AM_CONDITIONAL(HAVE_CUE, test x$enable_cue = xyes)
499 dnl -------------------------------- libid3tag --------------------------------
500 if test x$enable_id3 = xyes; then
501         PKG_CHECK_MODULES([ID3TAG], [id3tag],,
502                 AC_CHECK_LIB(id3tag, id3_file_open,
503                         [ID3TAG_LIBS="-lid3tag -lz" ID3TAG_CFLAGS=""],
504                         enable_id3=no))
507 if test x$enable_id3 = xyes; then
508         AC_DEFINE(HAVE_ID3TAG, 1, [Define to use id3tag])
511 AM_CONDITIONAL(HAVE_ID3TAG, test x$enable_id3 = xyes)
513 dnl ---------------------------------------------------------------------------
514 dnl Autodiscovery
515 dnl ---------------------------------------------------------------------------
517 dnl --------------------------------- zeroconf --------------------------------
519 case $with_zeroconf in
520 no|avahi|bonjour)
521         ;;
523         with_zeroconf=auto
524         ;;
525 esac
527 if test x$with_zeroconf != xno; then
528         if test x$with_zeroconf = xavahi || test x$with_zeroconf = xauto; then
529                 PKG_CHECK_MODULES([AVAHI], [avahi-client avahi-glib],
530                          [found_avahi=1;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])]
531                          MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS",
532                          [found_avahi=0])
533         fi
535         if test x$found_avahi = x1; then
536                 with_zeroconf=avahi
537         elif test x$with_zeroconf = xavahi; then
538                 AC_MSG_ERROR([Avahi support requested but not found])
539         fi
541         if test x$with_zeroconf = xbonjour || test x$with_zeroconf = xauto; then
542                 AC_CHECK_HEADER(dns_sd.h,
543                         [found_bonjour=1;AC_DEFINE([HAVE_BONJOUR], 1, [Define to enable Bonjour Zeroconf support])],
544                         [found_bonjour=0])
545                 AC_CHECK_LIB(dns_sd, DNSServiceRegister,
546                         MPD_LIBS="$MPD_LIBS -ldns_sd")
547         fi
549         if test x$found_bonjour = x1; then
550                 with_zeroconf=bonjour
551         elif test x$with_zeroconf = xbonjour; then
552                 AC_MSG_ERROR([Bonjour support requested but not found])
553         fi
555         if test x$with_zeroconf = xauto; then
556                 AC_MSG_WARN([No supported Zeroconf backend found, disabling Zeroconf])
557                 with_zeroconf=no
558         else
559                 AC_DEFINE([HAVE_ZEROCONF], 1, [Define to enable Zeroconf support])
560         fi
563 AM_CONDITIONAL(HAVE_ZEROCONF, test x$with_zeroconf != xno)
564 AM_CONDITIONAL(HAVE_AVAHI, test x$with_zeroconf = xavahi)
565 AM_CONDITIONAL(HAVE_BONJOUR, test x$with_zeroconf = xbonjour)
567 dnl ---------------------------------------------------------------------------
568 dnl Sticker Database
569 dnl ---------------------------------------------------------------------------
571 dnl ---------------------------------- sqlite ---------------------------------
573 MPD_AUTO_PKG(sqlite, SQLITE, [sqlite3],
574         [SQLite database support], [sqlite not found])
575 if test x$enable_sqlite = xyes; then
576         AC_DEFINE([ENABLE_SQLITE], 1, [Define to enable sqlite database support])
579 AM_CONDITIONAL(ENABLE_SQLITE, test x$enable_sqlite = xyes)
581 dnl ---------------------------------------------------------------------------
582 dnl Converter Plugins
583 dnl ---------------------------------------------------------------------------
585 dnl ------------------------------ libsamplerate ------------------------------
586 MPD_AUTO_PKG(lsr, SAMPLERATE, [samplerate >= 0.0.15],
587         [libsamplerate resampling], [libsamplerate not found])
588 if test x$enable_lsr = xyes; then
589         AC_DEFINE([HAVE_LIBSAMPLERATE], 1,
590                 [Define to enable libsamplerate])
593 if test x$enable_lsr = xyes; then
594         PKG_CHECK_MODULES([SAMPLERATE_013],
595                 [samplerate >= 0.1.3],,
596                 [AC_DEFINE([HAVE_LIBSAMPLERATE_NOINT], 1,
597                 [libsamplerate doesn't provide src_int_to_float_array() (<0.1.3)])])
600 AM_CONDITIONAL(HAVE_LIBSAMPLERATE, test x$enable_lsr = xyes)
602 dnl ---------------------------------------------------------------------------
603 dnl Input Plugins
604 dnl ---------------------------------------------------------------------------
606 dnl ----------------------------------- CURL ----------------------------------
607 MPD_AUTO_PKG(curl, CURL, [libcurl],
608         [libcurl HTTP streaming], [libcurl not found])
609 if test x$enable_curl = xyes; then
610         AC_DEFINE(ENABLE_CURL, 1, [Define when libcurl is used for HTTP streaming])
612 AM_CONDITIONAL(ENABLE_CURL, test x$enable_curl = xyes)
614 dnl --------------------------------- Last.FM ---------------------------------
615 if test x$enable_lastfm = xyes; then
616         if test x$enable_curl != xyes; then
617                 AC_MSG_ERROR([Cannot enable last.fm radio without curl])
618         fi
620         AC_DEFINE(ENABLE_LASTFM, 1, [Define when last.fm radio is enabled])
622 AM_CONDITIONAL(ENABLE_LASTFM, test x$enable_lastfm = xyes)
624 dnl ---------------------------------- libmms ---------------------------------
625 MPD_AUTO_PKG(mms, MMS, [libmms >= 0.4],
626         [libmms mms:// protocol support], [libmms not found])
627 if test x$enable_mms = xyes; then
628         AC_DEFINE(ENABLE_MMS, 1,
629                 [Define when libmms is used for the MMS protocol])
631 AM_CONDITIONAL(ENABLE_MMS, test x$enable_mms = xyes)
633 dnl ---------------------------------------------------------------------------
634 dnl Archive Plugins
635 dnl ---------------------------------------------------------------------------
637 dnl --------------------------------- iso9660 ---------------------------------
638 MPD_AUTO_PKG(iso9660, ISO9660, [libiso9660],
639         [libiso9660 archive library], [libiso9660 not found])
641 AM_CONDITIONAL(HAVE_ISO9660, test x$enable_iso9660 = xyes)
642 if test x$enable_iso9660 = xyes; then
643         AC_DEFINE(HAVE_ISO9660, 1, [Define to have ISO9660 archive support])
645         AC_PATH_PROG(MKISOFS, mkisofs, no)
646 else
647         MKISOFS="no"
650 AM_CONDITIONAL(ENABLE_ISO9660_TEST, test x$MKISOFS != xno)
652 dnl ---------------------------------- libbz2 ---------------------------------
653 if test x$enable_bzip2 = xyes; then
654         AC_CHECK_LIB(bz2, BZ2_bzDecompressInit,
655                 [MPD_LIBS="$MPD_LIBS -lbz2"],
656                 [AC_MSG_ERROR([libbz2 not found])])
659 AM_CONDITIONAL(HAVE_BZ2, test x$enable_bzip2 = xyes)
660 if test x$enable_bzip2 = xyes; then
661         AC_DEFINE(HAVE_BZ2, 1, [Define to have bz2 archive support])
663         AC_PATH_PROG(BZIP2, bzip2, no)
664 else
665         BZIP2="no"
668 AM_CONDITIONAL(ENABLE_BZIP2_TEST, test x$BZIP2 != xno)
670 dnl --------------------------------- libzzip ---------------------------------
671 MPD_AUTO_PKG(zzip, ZZIP, [zziplib >= 0.13],
672         [libzzip archive library], [libzzip not found])
674 AM_CONDITIONAL(HAVE_ZZIP, test x$enable_zzip = xyes)
675 if test x$enable_zzip = xyes; then
676         AC_DEFINE(HAVE_ZZIP, 1, [Define to have zip archive support])
678         AC_PATH_PROG(ZIP, zip, no)
679 else
680         ZIP="no"
683 AM_CONDITIONAL(ENABLE_ZZIP_TEST, test x$ZIP != xno)
685 dnl ------------------------------- Archive API -------------------------------
687         test x$enable_bzip2 = xyes ||
688         test x$enable_zzip = xyes ||
689         test x$enable_iso9660 = xyes; then
690                 enable_archive=yes
691                 AC_DEFINE(ENABLE_ARCHIVE, 1, [The archive API is available])
692 else
693         enable_archive=no
696 AM_CONDITIONAL(ENABLE_ARCHIVE, test x$enable_archive = xyes)
698 dnl ---------------------------------------------------------------------------
699 dnl Encoders for Streaming Audio Output Plugins
700 dnl ---------------------------------------------------------------------------
702 dnl ---------------------------------------------------------------------------
703 dnl Audio Output Plugins (Nonstreaming)
704 dnl ---------------------------------------------------------------------------
706 dnl ----------------------------------- ALSA ----------------------------------
707 MPD_AUTO_PKG(alsa, ALSA, [alsa >= 0.9.0],
708         [ALSA output plugin], [libasound not found])
710 if test x$enable_alsa = xyes; then
711         AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support])
714 AM_CONDITIONAL(HAVE_ALSA, test x$enable_alsa = xyes)
716 dnl ----------------------------------- FIFO ----------------------------------
717 if test x$enable_fifo = xyes; then
718         AC_CHECK_FUNC([mkfifo],
719                 [enable_fifo=yes;AC_DEFINE([HAVE_FIFO], 1,
720                         [Define to enable support for writing audio to a FIFO])],
721                 [enable_fifo=no;AC_MSG_WARN([mkfifo not found -- disabling support for writing audio to a FIFO])])
724 AM_CONDITIONAL(HAVE_FIFO, test x$enable_fifo = xyes)
726 dnl ----------------------------------- JACK ----------------------------------
727 MPD_AUTO_PKG(jack, JACK, [jack >= 0.100],
728         [JACK output plugin], [libjack not found])
729 if test x$enable_jack = xyes; then
730         AC_DEFINE([HAVE_JACK], 1, [Define to enable JACK support])
733 if test x$enable_jack = xyes; then
734         # check whether jack_set_info_function() is available
735         old_LIBS=$LIBS
736         LIBS="$LIBS $JACK_LIBS"
738         AC_CHECK_FUNCS(jack_set_info_function)
740         LIBS=$old_LIBS
743 AM_CONDITIONAL(HAVE_JACK, test x$enable_jack = xyes)
745 dnl ---------------------------------- libao ----------------------------------
746 MPD_AUTO_PKG(ao, AO, [ao],
747         [libao output plugin], [libao not found])
748 if test x$enable_ao = xyes; then
749         AC_DEFINE(HAVE_AO, 1, [Define to play with ao])
752 AM_CONDITIONAL(HAVE_AO, test x$enable_ao = xyes)
754 dnl ---------------------------------- OpenAL ---------------------------------
755 AC_SUBST(OPENAL_CFLAGS,"")
756 AC_SUBST(OPENAL_LIBS,"")
758 if test x$enable_openal = xyes; then
759         if test x$enable_osx = xyes; then
760                 AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h], [], [enable_openal=no])
761                 if test x$enable_openal = xyes; then
762                         OPENAL_LIBS="-framework OpenAL"
763                         AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support])
764                 else
765                         AC_MSG_WARN(OpenAL headers not found -- disabling OpenAL support)
766                 fi
767         else
768                 PKG_CHECK_MODULES([OPENAL], [openal],
769                         AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]),
770                         enable_openal=no)
771         fi
774 AM_CONDITIONAL(HAVE_OPENAL, test x$enable_openal = xyes)
776 dnl ---------------------------- Open Sound System ----------------------------
777 if test x$enable_oss = xyes; then
778         AC_CHECK_HEADER(sys/soundcard.h,
779                 [enable_oss=yes;AC_DEFINE(HAVE_OSS,1,[Define to enable OSS])],
780                 [AC_MSG_WARN(Soundcard headers not found -- disabling OSS support);
781                         enable_oss=no])
784 AM_CONDITIONAL(HAVE_OSS, test x$enable_oss = xyes)
786 dnl ----------------------------------- OSX -----------------------------------
787 enable_osx=no
788 case "$host_os" in
789         darwin*)
790                 AC_DEFINE(HAVE_OSX, 1, [Define for compiling OS X support])
791                 MPD_LIBS="$MPD_LIBS -framework AudioUnit -framework CoreServices"
792                 enable_osx=yes ;;
793 esac
795 AM_CONDITIONAL(HAVE_OSX, test x$enable_osx = xyes)
797 dnl ------------------------------- Pipe Output -------------------------------
798 if test x$enable_pipe_output = xyes; then
799         AC_DEFINE([ENABLE_PIPE_OUTPUT], 1,
800                 [Define to enable support for writing audio to a pipe])
802 AM_CONDITIONAL(ENABLE_PIPE_OUTPUT, test x$enable_pipe_output = xyes)
804 dnl -------------------------------- PulseAudio -------------------------------
805 MPD_AUTO_PKG(pulse, PULSE, [libpulse],
806         [PulseAudio output plugin], [libpulse not found])
807 if test x$enable_pulse = xyes; then
808         AC_DEFINE([HAVE_PULSE], 1,
809                 [Define to enable PulseAudio support])
812 AM_CONDITIONAL(HAVE_PULSE, test x$enable_pulse = xyes)
814 dnl ----------------------------------- MVP -----------------------------------
815 if test x$enable_mvp = xyes; then
816    AC_DEFINE(HAVE_MVP,1,[Define to enable Hauppauge Media MVP support])
819 AM_CONDITIONAL(HAVE_MVP, test x$enable_mvp = xyes)
821 dnl --------------------------------- Solaris ---------------------------------
822 case "$host_os" in
823         solaris*)
824                 AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support])
825                 enable_solaris_output=yes
826                 ;;
828         *)
829                 enable_solaris_output=no
830                 ;;
831 esac
833 AM_CONDITIONAL(ENABLE_SOLARIS_OUTPUT, test x$enable_solaris_output = xyes)
835 dnl ---------------------------------------------------------------------------
836 dnl Decoder Plugins
837 dnl ---------------------------------------------------------------------------
839 dnl -------------------------------- audiofile --------------------------------
840 MPD_AUTO_PKG(audiofile, AUDIOFILE, [audiofile >= 0.1.7],
841         [audiofile decoder plugin], [libaudiofile not found])
842 AM_CONDITIONAL(HAVE_AUDIOFILE, test x$enable_audiofile = xyes)
843 if test x$enable_audiofile = xyes; then
844         AC_DEFINE(HAVE_AUDIOFILE, 1, [Define for audiofile support])
847 dnl ----------------------------------- FAAD ----------------------------------
848 AM_PATH_FAAD()
850 AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes)
851 AM_CONDITIONAL(HAVE_MP4, test x$enable_mp4 = xyes)
853 dnl ----------------------------------- FLAC ----------------------------------
854 if test x$enable_flac = xyes; then
855         PKG_CHECK_MODULES(FLAC, [flac >= 1.1],
856                 AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support]),
857                 enable_flac=no)
859         oldcflags="$CFLAGS"
860         oldlibs="$LIBS"
861         CFLAGS="$CFLAGS $FLAC_CFLAGS"
862         LIBS="$LIBS $FLAC_LIBS"
863         if test x$enable_flac = xyes && test x$enable_oggflac = xyes; then
864                 AC_CHECK_DECL(FLAC_API_SUPPORTS_OGG_FLAC,
865                         [enable_oggflac=flac], [],
866                         [#include <FLAC/export.h>])
867         fi
868         CFLAGS="$oldcflags"
869         LIBS="$oldlibs"
872 AM_CONDITIONAL(HAVE_FLAC, test x$enable_flac = xyes)
874 enable_flac_encoder=$enable_flac
876 dnl -------------------------------- FluidSynth -------------------------------
877 if test x$enable_fluidsynth = xyes; then
878         PKG_CHECK_MODULES(FLUIDSYNTH, [fluidsynth],
879                 AC_DEFINE(ENABLE_FLUIDSYNTH, 1, [Define for fluidsynth support]),
880                 enable_fluidsynth=no)
883 AM_CONDITIONAL(ENABLE_FLUIDSYNTH, test x$enable_fluidsynth = xyes)
885 dnl ---------------------------------- libgme ---------------------------------
886 MPD_AUTO_PKG(gme, GME, [libgme],
887         [gme decoder plugin], [libgme not found])
888 AM_CONDITIONAL(HAVE_GME, test x$enable_gme = xyes)
889 if test x$enable_gme = xyes; then
890         AC_DEFINE(HAVE_GME, 1, [Define for gme support])
893 dnl ---------------------------------- libmad ---------------------------------
894 MPD_AUTO_PKG(mad, MAD, [mad],
895         [libmad MP3 decoder plugin], [libmad not found])
896 if test x$enable_mad = xyes; then
897         AC_DEFINE(HAVE_MAD, 1, [Define to use libmad])
899 AM_CONDITIONAL(HAVE_MAD, test x$enable_mad = xyes)
901 enable_shout2="$enable_shout"
902 MPD_AUTO_PKG(shout, SHOUT, [shout],
903         [shout output plugin], [libshout not found])
904 if test x$enable_shout = xyes && test x$enable_shout2 = xauto; then
905         enable_shout=auto
908 dnl -------------------------------- libmpg123 --------------------------------
909 MPD_AUTO_PKG(mpg123, MPG123, [libmpg123],
910         [libmpg123 decoder plugin], [libmpg123 not found])
911 if test x$enable_mpg123 = xyes; then
912         AC_DEFINE(HAVE_MPG123, 1, [Define to use libmpg123])
914 AM_CONDITIONAL(HAVE_MPG123, test x$enable_mpg123 = xyes)
916 dnl -------------------------------- libmikmod --------------------------------
917 if test x$enable_mikmod = xyes; then
918         AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config)
919         if test x$LIBMIKMOD_CONFIG != x ; then
920                 AC_SUBST(LIBMIKMOD_CFLAGS, `$LIBMIKMOD_CONFIG --cflags`)
921                 AC_SUBST(LIBMIKMOD_LIBS, `$LIBMIKMOD_CONFIG --libs`)
922                 AC_DEFINE(ENABLE_MIKMOD_DECODER, 1, [Define for mikmod support])
923         else
924                 enable_mikmod=no
925         fi
928 AM_CONDITIONAL(ENABLE_MIKMOD_DECODER, test x$enable_mikmod = xyes)
930 dnl -------------------------------- libmodplug -------------------------------
931 found_modplug=$HAVE_CXX
932 MPD_AUTO_PRE(modplug, [modplug decoder plugin], [No C++ compiler found])
934 MPD_AUTO_PKG(modplug, MODPLUG, [libmodplug],
935         [modplug decoder plugin], [libmodplug not found])
937 if test x$enable_modplug = xyes; then
938         AC_DEFINE(HAVE_MODPLUG, 1, [Define for modplug support])
940 AM_CONDITIONAL(HAVE_MODPLUG, test x$enable_modplug = xyes)
942 dnl --------------------------- sndfile/modplug test --------------------------
943 if test x$enable_sndfile = xauto && test x$enable_modplug = xyes; then
944         dnl If modplug is enabled, enable sndfile only if explicitly
945         dnl requested - modplug's modplug/sndfile.h is known to
946         dnl conflict with libsndfile's sndfile.h.
947         AC_MSG_NOTICE([disabling libsndfile auto-detection, because the modplug decoder is enabled])
948         enable_sndfile=no
951 dnl -------------------------------- libsndfile -------------------------------
952 MPD_AUTO_PKG(sndfile, SNDFILE, [sndfile],
953         [libsndfile decoder plugin], [libsndfile not found])
955 if test x$enable_sndfile = xyes; then
956         AC_DEFINE(ENABLE_SNDFILE, 1, [Define to enable the sndfile decoder plugin])
958 AM_CONDITIONAL(ENABLE_SNDFILE, test x$enable_sndfile = xyes)
960 dnl --------------------------------- musepack --------------------------------
961 if test x$enable_mpc = xyes; then
962         if test "x$mpcdec_libraries" != "x" ; then
963                 MPCDEC_LIBS="-L$mpcdec_libraries"
964         elif test "x$mpcdec_prefix" != "x" ; then
965                 MPCDEC_LIBS="-L$mpcdec_prefix/lib"
966         fi
968         MPCDEC_LIBS="$MPCDEC_LIBS -lmpcdec"
970         if test "x$mpcdec_includes" != "x" ; then
971                 MPCDEC_CFLAGS="-I$mpcdec_includes"
972         elif test "x$mpcdec_prefix" != "x" ; then
973                 MPCDEC_CFLAGS="-I$mpcdec_prefix/include"
974         fi
976         oldcflags=$CFLAGS
977         oldlibs=$LIBS
978         oldcppflags=$CPPFLAGS
979         CFLAGS="$CFLAGS $MPD_CFLAGS $MPCDEC_CFLAGS -I."
980         LIBS="$LIBS $MPD_LIBS $MPCDEC_LIBS"
981         CPPFLAGS=$CFLAGS
982         AC_CHECK_HEADER(mpc/mpcdec.h,
983                 old_mpcdec=no,
984                 [AC_CHECK_HEADER(mpcdec/mpcdec.h,
985                         old_mpcdec=yes,
986                         enable_mpc=no)])
987         if test x$enable_mpc = xyes; then
988                 AC_CHECK_LIB(mpcdec,main,
989                         [MPD_LIBS="$MPD_LIBS $MPCDEC_LIBS";
990                         MPD_CFLAGS="$MPD_CFLAGS $MPCDEC_CFLAGS";],
991                         enable_mpc=no)
992         fi
993         if test x$enable_mpc = xyes; then
994                 AC_DEFINE(HAVE_MPCDEC,1,
995                         [Define to use libmpcdec for MPC decoding])
996                 if test x$old_mpcdec = xyes; then
997                         AC_DEFINE(MPC_IS_OLD_API, 1,
998                                 [Define if an old pre-SV8 libmpcdec is used])
999                 fi
1000         else
1001                 AC_MSG_WARN([mpcdec lib needed for MPC support -- disabling MPC support])
1002         fi
1003         CFLAGS=$oldcflags
1004         LIBS=$oldlibs
1005         CPPFLAGS=$oldcppflags
1008 AM_CONDITIONAL(HAVE_MPCDEC, test x$enable_mpc = xyes)
1010 dnl -------------------------------- Ogg Tremor -------------------------------
1011 if test x$with_tremor = xyes || test x$with_tremor = xno; then
1012         use_tremor="$with_tremor"
1013 else
1014         tremor_prefix="$with_tremor"
1015         use_tremor=yes
1018 if test x$use_tremor = xyes; then
1019         if test "x$tremor_libraries" != "x" ; then
1020                 TREMOR_LIBS="-L$tremor_libraries"
1021         elif test "x$tremor_prefix" != "x" ; then
1022                 TREMOR_LIBS="-L$tremor_prefix/lib"
1023         fi
1024         TREMOR_LIBS="$TREMOR_LIBS -lvorbisidec"
1025         if test "x$tremor_includes" != "x" ; then
1026                 TREMOR_CFLAGS="-I$tremor_includes"
1027         elif test "x$tremor_prefix" != "x" ; then
1028                 TREMOR_CFLAGS="-I$tremor_prefix/include"
1029         fi
1030         ac_save_CFLAGS="$CFLAGS"
1031         ac_save_LIBS="$LIBS"
1032         CFLAGS="$CFLAGS $TREMOR_CFLAGS"
1033         LIBS="$LIBS $TREMOR_LIBS"
1034         AC_CHECK_LIB(vorbisidec,ov_read,enable_vorbis=yes,enable_vorbis=no;
1035                 AC_MSG_WARN([vorbisidec lib needed for ogg support with tremor -- disabling ogg support]))
1036         CFLAGS="$ac_save_CFLAGS"
1037         LIBS="$ac_save_LIBS"
1038         if test x$enable_vorbis = xyes; then
1039                 AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support])
1040         fi
1043 if test x$use_tremor = xyes; then
1044         AC_DEFINE(HAVE_TREMOR,1,
1045                 [Define to use tremor (libvorbisidec) for ogg support])
1046         if test x$enable_oggflac = xyes; then
1047                 AC_MSG_WARN([disabling OggFLAC support because it is incompatible with tremor])
1048                 enable_oggflac=no
1049         fi
1052 AC_SUBST(TREMOR_CFLAGS)
1053 AC_SUBST(TREMOR_LIBS)
1055 dnl --------------------------------- OggFLAC ---------------------------------
1056 dnl OggFLAC must go after Ogg Tremor 
1057 if test x$enable_oggflac = xyes; then
1058         oldmpdcflags="$MPD_CFLAGS"
1059         oldmpdlibs="$MPD_LIBS"
1060         AM_PATH_LIBOGGFLAC(MPD_LIBS="$MPD_LIBS $LIBOGGFLAC_LIBS"
1061                                 MPD_CFLAGS="$MPD_CFLAGS $LIBOGGFLAC_CFLAGS",
1062                            enable_oggflac=no)
1065 if test x$enable_oggflac = xyes; then
1066         AC_DEFINE(HAVE_OGGFLAC,1,[Define for OggFLAC support])
1069 AM_CONDITIONAL(HAVE_OGGFLAC, test x$enable_oggflac = xyes)
1071 AM_CONDITIONAL(HAVE_FLAC_COMMON,
1072           test x$enable_flac = xyes || test x$enable_oggflac = xyes)
1074 dnl -------------------------------- Ogg Vorbis -------------------------------
1075 if test x$enable_tremor != xyes -a test x$enable_vorbis = xyes; then
1076         PKG_CHECK_MODULES(VORBIS, [ogg vorbis vorbisfile],
1077                 AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]),
1078                 enable_vorbis=no)
1081 AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes)
1083 AM_CONDITIONAL(HAVE_OGG_COMMON,
1084           test x$enable_vorbis = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes)
1086 dnl --------------------------------- sidplay ---------------------------------
1087 found_sidplay=$HAVE_CXX
1088 MPD_AUTO_PRE(sidplay, [sidplay decoder plugin], [No C++ compiler found])
1090 if test x$enable_sidplay != xno; then
1091         # we're not using pkg-config here
1092         # because libsidplay2's .pc file requires libtool
1093         AC_HAVE_LIBRARY(sidplay2, [found_sidplay=yes], [found_sidplay=no])
1094         MPD_AUTO_PRE(sidplay, [sidplay decoder plugin],
1095                 [libsidplay2 not found])
1098 if test x$enable_sidplay != xno; then
1099         # can't use AC_HAVE_LIBRARY here, because the dash in the
1100         # library name triggers an autoconf bug
1101         AC_CHECK_LIB(resid-builder, main,
1102                 [found_sidplay=yes], [found_sidplay=no])
1104         if test x$found_sidplay = xyes; then
1105                 AC_HAVE_LIBRARY(sidutils,, [found_sidplay=no])
1106         fi
1108         MPD_AUTO_RESULT(sidplay, [sidplay decoder plugin],
1109                 [libresid-builder or libsidutils not found])
1112 if test x$enable_sidplay = xyes; then
1113         AC_SUBST(SIDPLAY_LIBS,"-lsidplay2 -lresid-builder -lsidutils")
1114         AC_SUBST(SIDPLAY_CFLAGS,)
1116         AC_DEFINE(ENABLE_SIDPLAY, 1, [Define for libsidplay2 support])
1119 AM_CONDITIONAL(ENABLE_SIDPLAY, test x$enable_sidplay = xyes)
1121 dnl --------------------------------- wavpack ---------------------------------
1122 MPD_AUTO_PKG(wavpack, WAVPACK, [wavpack],
1123         [WavPack decoder plugin], [libwavpack not found])
1124 AM_CONDITIONAL(HAVE_WAVPACK, test x$enable_wavpack = xyes)
1125 if test x$enable_wavpack = xyes; then
1126         AC_DEFINE([HAVE_WAVPACK], 1, [Define to enable WavPack support])
1132 MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat libavcodec libavutil],
1133         [ffmpeg decoder library], [libavformat+libavcodec+libavutil not found])
1135 if test x$enable_ffmpeg = xyes; then
1136         old_LIBS=$LIBS
1137         LIBS="$LIBS $FFMPEG_LIBS"
1138         AC_CHECK_LIB(avcodec, avcodec_decode_audio2,,
1139                 enable_ffmpeg=no)
1140         LIBS=$old_LIBS
1143 if test x$enable_ffmpeg = xyes; then
1144         # prior to ffmpeg svn12865, you had to specify include files
1145         # without path prefix
1146         old_CPPCFLAGS=$CPPFLAGS
1147         CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
1148         AC_CHECK_HEADER(libavcodec/avcodec.h,,
1149                 AC_DEFINE(OLD_FFMPEG_INCLUDES, 1,
1150                         [Define if avcodec.h instead of libavcodec/avcodec.h should be included]))
1151         CPPCFLAGS=$old_CPPFLAGS
1154 if test x$enable_ffmpeg = xyes; then
1155         AC_DEFINE(HAVE_FFMPEG, 1, [Define for FFMPEG support])
1158 AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes)
1162 if test x$enable_wildmidi = xyes; then
1163         oldcflags=$CFLAGS
1164         oldlibs=$LIBS
1165         oldcppflags=$CPPFLAGS
1167         AC_CHECK_LIB(WildMidi, WildMidi_Init,,
1168                 AC_MSG_ERROR([libwildmidi not found]))
1170         CFLAGS=$oldcflags
1171         LIBS=$oldlibs
1172         CPPFLAGS=$oldcppflags
1174         AC_SUBST(WILDMIDI_LIBS,-lWildMidi)
1175         AC_SUBST(WILDMIDI_CFLAGS,)
1177         AC_DEFINE(ENABLE_WILDMIDI, 1, [Define for wildmidi support])
1180 AM_CONDITIONAL(ENABLE_WILDMIDI, test x$enable_wildmidi = xyes)
1184 dnl Encoder API and shout/httpd output plugin
1187 if test x$enable_shout = xyes || \
1188         test x$enable_recorder_output = xyes || \
1189         test x$enable_httpd_output = xyes; then
1190         # at least one output using encoders is explicitly enabled
1191         need_encoder=yes
1192 elif test x$enable_shout = xauto || \
1193         test x$enable_recorder_output = xauto || \
1194         test x$enable_httpd_output = xauto; then
1195         need_encoder=auto
1196 else
1197         # all outputs using encoders are disabled
1198         need_encoder=no
1200         # don't bother to check for encoder plugins
1201         enable_vorbis_encoder=no
1202         enable_lame_encoder=no
1203         enable_twolame_encoder=no
1204         enable_wave_encoder=no
1205         enable_flac_encoder=no
1208 MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc],
1209         [Ogg Vorbis encoder], [libvorbisenc not found])
1211 if test x$enable_lame_encoder != xno; then
1212         AC_CHECK_HEADERS(lame/lame.h,,
1213                 [AC_CHECK_HEADERS(lame.h,, using_lame=no)])
1214         AC_CHECK_LIB(mp3lame, lame_init,, using_lame=no)
1215         if test x$using_lame != xno; then
1216                 AC_DEFINE(HAVE_LAME, 1, [Define to 1 if you have lame 3.98 or greater.])
1217                 LAME_LIBS="-lmp3lame -lm"
1218                 enable_lame_encoder=yes
1219         fi
1221         if test "$enable_lame_encoder" = "yes" -a "$using_lame" = "no"; then
1222                 AC_MSG_ERROR([LAME libraries and development support files not found.])
1223         fi
1226 AC_SUBST(LAME_LIBS)
1228 MPD_AUTO_PKG(twolame_encoder, TWOLAME, [twolame],
1229         [TwoLAME encoder], [libtwolame not found])
1231 if test x$enable_vorbis_encoder != xno ||
1232         test x$enable_lame_encoder != xno ||
1233         test x$enable_twolame_encoder != xno ||
1234         test x$enable_flac_encoder != xno ||
1235         test x$enable_wave_encoder != xno; then
1236         # at least one encoder plugin is enabled
1237         enable_encoder=yes
1238 else
1239         # no encoder plugin is enabled: disable the whole encoder API
1240         enable_encoder=no
1242         if test x$need_encoder = xyes; then
1243                 AC_MSG_ERROR([No encoder plugin found])
1244         fi
1248 if test x$enable_shout = xauto; then
1249         # handle shout auto-detection: disable if no encoder is
1250         # available
1251         if test x$enable_encoder = xyes; then
1252                 enable_shout=yes
1253         else
1254                 AC_MSG_WARN([No encoder plugin -- disabling the shout output plugin])
1255                 enable_shout=no
1256         fi
1259 if test x$enable_recorder_output = xauto; then
1260         # handle recorder auto-detection: disable if no encoder is
1261         # available
1262         if test x$enable_encoder = xyes; then
1263                 enable_recorder_output=yes
1264         else
1265                 AC_MSG_WARN([No encoder plugin -- disabling the recorder output plugin])
1266                 enable_recorder_output=no
1267         fi
1270 if test x$enable_httpd_output = xauto; then
1271         # handle HTTPD auto-detection: disable if no encoder is
1272         # available
1273         if test x$enable_encoder = xyes; then
1274                 enable_httpd_output=yes
1275         else
1276                 AC_MSG_WARN([No encoder plugin -- disabling the HTTP output plugin])
1277                 enable_httpd_output=no
1278         fi
1281 AM_CONDITIONAL(HAVE_SHOUT, test x$enable_shout = xyes)
1282 if test x$enable_shout = xyes; then
1283         AC_DEFINE(HAVE_SHOUT, 1, [Define to enable the shoutcast output])
1286 AM_CONDITIONAL(ENABLE_RECORDER_OUTPUT, test x$enable_recorder_output = xyes)
1287 if test x$enable_recorder_output = xyes; then
1288         AC_DEFINE(ENABLE_RECORDER_OUTPUT, 1, [Define to enable the recorder output])
1291 AM_CONDITIONAL(ENABLE_HTTPD_OUTPUT, test x$enable_httpd_output = xyes)
1292 if test x$enable_httpd_output = xyes; then
1293         AC_DEFINE(ENABLE_HTTPD_OUTPUT, 1, [Define to enable the HTTP server output])
1296 AM_CONDITIONAL(ENABLE_ENCODER, test x$enable_encoder = xyes)
1297 if test x$enable_encoder = xyes; then
1298         AC_DEFINE(ENABLE_ENCODER, 1,
1299                 [Define to enable the encoder plugins])
1302 AM_CONDITIONAL(ENABLE_VORBIS_ENCODER, test x$enable_vorbis_encoder = xyes)
1303 if test x$enable_vorbis_encoder = xyes; then
1304         AC_DEFINE(ENABLE_VORBIS_ENCODER, 1,
1305                 [Define to enable the vorbis encoder plugin])
1308 AM_CONDITIONAL(ENABLE_LAME_ENCODER, test x$enable_lame_encoder = xyes)
1309 if test x$enable_lame_encoder = xyes; then
1310         AC_DEFINE(ENABLE_LAME_ENCODER, 1,
1311                 [Define to enable the lame encoder plugin])
1314 AM_CONDITIONAL(ENABLE_TWOLAME_ENCODER, test x$enable_twolame_encoder = xyes)
1315 if test x$enable_twolame_encoder = xyes; then
1316         AC_DEFINE(ENABLE_TWOLAME_ENCODER, 1,
1317                 [Define to enable the TwoLAME encoder plugin])
1320 AM_CONDITIONAL(ENABLE_WAVE_ENCODER, test x$enable_wave_encoder = xyes)
1321 if test x$enable_wave_encoder = xyes; then
1322         AC_DEFINE(ENABLE_WAVE_ENCODER, 1,
1323                 [Define to enable the PCM wave encoder plugin])
1326 AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes)
1327 if test x$enable_flac_encoder = xyes; then
1328         AC_DEFINE(ENABLE_FLAC_ENCODER, 1,
1329                 [Define to enable the FLAC encoder plugin])
1332 dnl ---------------------------------------------------------------------------
1333 dnl Documentation
1334 dnl ---------------------------------------------------------------------------
1337 if test x$enable_documentation = xyes; then
1338         AC_PATH_PROG(XMLTO, xmlto)
1339         AC_SUBST(XMLTO)
1340         AM_CONDITIONAL(HAVE_XMLTO, test x$XMLTO != x)
1342         AC_PATH_PROG(DOXYGEN, doxygen)
1343         if test x$DOXYGEN = x; then
1344                 AC_MSG_ERROR([doxygen not found])
1345         fi
1347         AC_SUBST(DOXYGEN)
1348 else
1349         AM_CONDITIONAL(HAVE_XMLTO, false)
1352 AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes)
1356 dnl build options
1360 if test "x$enable_werror" = xyes; then
1361         AM_CFLAGS="$AM_CFLAGS -Werror -pedantic-errors"
1364 #if test "x$enable_debug" = xno; then
1365         # don't set NDEBUG for now, until MPD is stable
1366         #AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
1369 if test "x$enable_gprof" = xyes; then
1370         MPD_CFLAGS="$MPD_CFLAGS -pg"
1371         MPD_LIBS="$MPD_LIBS -pg"
1374 dnl ---------------------------------------------------------------------------
1375 dnl test suite
1376 dnl ---------------------------------------------------------------------------
1377 AM_CONDITIONAL(ENABLE_TEST, test "x$enable_test" = xyes)
1379 dnl ---------------------------------------------------------------------------
1380 dnl CFLAGS
1381 dnl ---------------------------------------------------------------------------
1382 if test x$GCC = xyes
1383 then
1384         MPD_CHECK_FLAG([-Wall])
1385         MPD_CHECK_FLAG([-Wextra])
1386         MPD_CHECK_FLAG([-Wno-deprecated-declarations])
1387         MPD_CHECK_FLAG([-Wmissing-prototypes])
1388         MPD_CHECK_FLAG([-Wshadow])
1389         MPD_CHECK_FLAG([-Wpointer-arith])
1390         MPD_CHECK_FLAG([-Wstrict-prototypes])
1391         MPD_CHECK_FLAG([-Wcast-qual])
1392         MPD_CHECK_FLAG([-Wwrite-strings])
1393         MPD_CHECK_FLAG([-pedantic])
1396 dnl ---------------------------------------------------------------------------
1397 dnl Pretty-Print Results
1398 dnl ---------------------------------------------------------------------------
1399 echo ""
1400 echo "########### MPD CONFIGURATION ############"
1401 echo ""
1403 echo " Client Support:"
1404 if test x$enable_ipv6 = xyes; then
1405         echo " IPv6 support ..................enabled"
1406 else
1407         echo " IPv6 support ..................disabled"
1410 if test x$enable_tcp = xyes; then
1411         echo " TCP support ...................enabled"
1412 else
1413         echo " TCP support ...................disabled"
1416 if test x$enable_un = xyes; then
1417         echo " Unix domain socket support ....enabled"
1418 else
1419         echo " Unix domain socket support ....disabled"
1422 echo ""
1425         test x$enable_tcp = xno &&
1426         test x$enable_un = xno; then
1427         AC_MSG_ERROR([No client interfaces configured!])
1430 echo " Playback Support:"
1431 if test x$enable_alsa = xyes; then
1432         echo " ALSA support ..................enabled"
1433 else
1434         echo " ALSA support ..................disabled"
1437 if test x$enable_fifo = xyes; then
1438         echo " FIFO support ..................enabled"
1439 else
1440         echo " FIFO support ..................disabled"
1443 if test x$enable_recorder_output = xyes; then
1444         echo " File Recorder support .........enabled"
1445 else
1446         echo " File Recorder support .........disabled"
1449 if test x$enable_httpd_output = xyes; then
1450         echo " HTTP daemon support ...........enabled"
1451 else
1452         echo " HTTP daemon support ...........disabled"
1455 if test x$enable_jack = xyes; then
1456         echo " JACK support ..................enabled"
1457 else
1458         echo " JACK support ..................disabled"
1461 if test x$enable_ao = xyes; then
1462         echo " libao support .................enabled"
1463 else
1464         echo " libao support .................disabled"
1467 if test x$enable_oss = xyes; then
1468         echo " OSS support ...................enabled"
1469 else
1470         echo " OSS support ...................disabled"
1473 if test x$enable_openal = xyes; then
1474         echo " OpenAL support ................enabled"
1475 else
1476         echo " OpenAL support ................disabled"
1479 if test x$enable_osx = xyes; then
1480         echo " OS X support ..................enabled"
1481 else
1482         echo " OS X support ..................disabled"
1485 if test x$enable_pipe_output = xyes; then
1486         echo " Pipeline output support .......enabled"
1487 else
1488         echo " Pipeline output support .......disabled"
1491 if test x$enable_pulse = xyes; then
1492         echo " PulseAudio support ............enabled"
1493 else
1494         echo " PulseAudio support ............disabled"
1497 if test x$enable_mvp = xyes; then
1498         echo " Media MVP support .............enabled"
1499 else
1500         echo " Media MVP support .............disabled"
1503 if test x$enable_shout = xyes; then
1504         echo " SHOUTcast support .............enabled"
1505 else
1506         echo " SHOUTcast support .............disabled"
1509 if test x$enable_solaris_output = xyes; then
1510         echo " Solaris /dev/audio support ....enabled"
1511 else
1512         echo " Solaris /dev/audio support ....disabled"
1515 echo ""
1518         test x$enable_ao = xno &&
1519         test x$enable_oss = xno &&
1520         test x$enable_openal = xno &&
1521         test x$enable_shout = xno &&
1522         test x$enable_recorder_output = xno &&
1523         test x$enable_httpd_output = xno &&
1524         test x$enable_solaris_output = xno &&
1525         test x$enable_alsa = xno &&
1526         test x$enable_osx = xno &&
1527         test x$enable_pulse = xno &&
1528         test x$enable_jack = xno &&
1529         test x$enable_fifo = xno &&
1530         test x$enable_pipe_output = xno &&
1531         test x$enable_mvp = xno; then
1532                 AC_MSG_ERROR([No Audio Output types configured!])
1536         test x$enable_shout = xyes ||
1537         test x$enable_recorder = xyes ||
1538         test x$enable_httpd_output = xyes; then
1539                 echo " Streaming Encoder Support:"
1540                 if test x$enable_lame_encoder = xyes; then
1541                         echo " LAME mp3 encoder ..............enabled"
1542                 else
1543                         echo " LAME mp3 encoder ..............disabled"
1544                 fi
1546                 if test x$enable_vorbis_encoder = xyes; then
1547                         echo " Ogg Vorbis encoder ............enabled"
1548                 else
1549                         echo " Ogg Vorbis encoder ............disabled"
1550                 fi
1552                 if test x$enable_twolame_encoder = xyes; then
1553                         echo " TwoLAME mp3 encoder ...........enabled"
1554                 else
1555                         echo " TwoLAME mp3 encoder ...........disabled"
1556                 fi
1558                 if test x$enable_flac_encoder = xyes; then
1559                         echo " FLAC encoder ..................enabled"
1560                 else
1561                         echo " FLAC encoder ..................disabled"
1562                 fi
1564                 if test x$enable_wave_encoder = xyes; then
1565                         echo " PCM wave encoder ..............enabled"
1566                 else
1567                         echo " PCM wave encoder ..............disabled"
1568                 fi
1570                 echo ""
1573 echo " File Format Support:"
1575 if test x$enable_aac = xyes; then
1576         echo " AAC support ...................enabled"
1577 else
1578         echo " AAC support ...................disabled"
1581 if test x$enable_sidplay = xyes; then
1582         echo " C64 SID support ...............enabled"
1583 else
1584         echo " C64 SID support ...............disabled"
1587 if test x$enable_ffmpeg = xyes; then
1588         echo " FFMPEG support ................enabled"
1589 else
1590         echo " FFMPEG support ................disabled"
1593 if test x$enable_flac = xyes; then
1594         echo " FLAC support ..................enabled"
1595 else
1596         echo " FLAC support ..................disabled"
1599 if test x$enable_fluidsynth = xyes; then
1600         echo " fluidsynth MIDI support .......enabled"
1601 else
1602         echo " fluidsynth MIDI support .......disabled"
1605 if test x$enable_mikmod = xyes; then
1606         echo " MikMod support ................enabled"
1607 else
1608         echo " MikMod support ................disabled"
1611 if test x$enable_modplug = xyes; then
1612         echo " MODPLUG support ...............enabled"
1613 else
1614         echo " MODPLUG support ...............disabled"
1617 if test x$enable_gme = xyes; then
1618         echo " GME support ....................enabled"
1619 else
1620         echo " GME support ...................disabled"
1623 if test x$enable_mad = xyes; then
1624         echo " MAD mp3 decoder support .......enabled"
1625 else
1626         echo " MAD mp3 decoder support .......disabled"
1629 if test x$enable_mpg123 = xyes; then
1630         echo " libmpg123 decoder support .....enabled"
1631 else
1632         echo " libmpg123 decoder support .....disabled"
1635 if test x$enable_mp4 = xyes; then
1636         echo " MP4 support ...................enabled"
1637 else
1638         echo " MP4 support ...................disabled"
1641 if test x$enable_mpc = xyes; then
1642         echo " Musepack (MPC) support ........enabled"
1643 else
1644         echo " Musepack (MPC) support ........disabled"
1647 case $enable_oggflac in
1648 yes)
1649         echo " OggFLAC support ...............enabled"
1650         ;;
1651 flac)
1652         echo " OggFLAC support ...............enabled(FLAC 1.1.3)"
1653         ;;
1655         echo " OggFLAC support ...............disabled"
1656         ;;
1657 esac
1659 if test x$enable_vorbis = xyes; then
1660         echo " Ogg Vorbis support ............enabled"
1661         if test x$use_tremor = xyes; then
1662                 echo "   using tremor.................yes"
1663         else
1664                 echo "   using tremor.................no"
1665         fi
1666 else
1667         echo " Ogg Vorbis support ............disabled"
1670 if test x$enable_sndfile = xyes; then
1671         echo " libsndfile ....................enabled"
1672 else
1673         echo " libsndfile ....................disabled"
1676 if test x$enable_audiofile = xyes; then
1677         echo " Wave file support .............enabled"
1678 else
1679         echo " Wave file support .............disabled"
1682 if test x$enable_wavpack = xyes; then
1683         echo " WavPack support ...............enabled"
1684 else
1685         echo " WavPack support ...............disabled"
1688 if test x$enable_wildmidi = xyes; then
1689         echo " wildmidi MIDI support .........enabled"
1690 else
1691         echo " wildmidi MIDI support .........disabled"
1697         test x$enable_mad = xno &&
1698         test x$enable_mpg123 = xno &&
1699         test x$enable_vorbis = xno &&
1700         test x$enable_flac = xno && 
1701         test x$enable_oggflac = xno &&
1702         test x$enable_audiofile = xno && 
1703         test x$enable_aac = xno &&
1704         test x$enable_mpc = xno &&
1705         test x$enable_wavpack = xno &&
1706         test x$enable_ffmpeg = xno &&
1707         test x$enable_modplug = xno &&
1708         test x$enable_sidplay = xno &&
1709         test x$enable_gme = xno &&
1710         test x$enable_fluidsynth = xno &&
1711         test x$enable_wildmidi = xno &&
1712         test x$enable_mp4 = xno &&
1713         test x$enable_mikmod = xno; then
1714                 AC_MSG_ERROR([No input plugins supported!])
1717 echo ""
1718 echo " Archive support:"
1720 if test x$enable_bzip2 = xyes; then
1721         echo " BZ2 archives support ..........enabled"
1722 else
1723         echo " BZ2 archives support ..........disabled"
1726 if test x$enable_iso9660 = xyes; then
1727         echo " ISO 9660 archives support .....enabled"
1728 else
1729         echo " ISO 9660 archives support .....disabled"
1732 if test x$enable_zzip = xyes; then
1733         echo " ZIP archives support ..........enabled"
1734 else
1735         echo " ZIP archives support ..........disabled"
1738 echo ""
1739 echo " Streaming support:"
1741 if test x$enable_lastfm = xyes; then
1742         echo " last.fm radio support .........enabled"
1743 else
1744         echo " last.fm radio support .........disabled"
1747 if test x$enable_curl = xyes; then
1748         echo " libcurl support (streaming) ...enabled"
1749 else
1750         echo " libcurl support (streaming) ...disabled"
1753 if test x$enable_mms = xyes; then
1754         echo " libmms support ................enabled"
1755 else
1756         echo " libmms support ................disabled"
1759 echo ""
1760 echo " Other features:"
1762 if test x$enable_id3 = xyes; then
1763         echo " ID3 tag support ...............enabled"
1764 else
1765         echo " ID3 tag support ...............disabled"
1768 if test x$enable_lsr = xyes; then
1769         echo " libsamplerate support .........enabled"
1770 else
1771         echo " libsamplerate support .........disabled"
1774 if test x$with_zeroconf != xno; then
1775         echo " Zeroconf support ..............$with_zeroconf"
1776 else
1777         echo " Zeroconf support ..............disabled"
1780 if test x$enable_cue = xyes; then
1781         echo " libcue support ................enabled"
1782 else
1783         echo " libcue support ................disabled"
1786 if test x$enable_inotify = xyes; then
1787         echo " Inotify support (autoupdate) ..enabled"
1788 else
1789         echo " Inotify support (autoupdate) ..disabled"
1792 echo ""
1793 echo "##########################################"
1794 echo ""
1796 if test x$enable_sndfile = xyes && test x$enable_modplug = xyes; then
1797         AC_MSG_WARN([compilation may fail, because libmodplug conflicts with libsndfile])
1798         AC_MSG_WARN([libmodplug ships modplug/sndfile.h, which hides libsndfile's sndfile.h])
1801 echo "Generating needed files for compilation"
1802 echo ""
1805 dnl generate files
1808 AC_OUTPUT(Makefile)
1810 echo ""
1812 echo "You are now ready to compile MPD"
1813 echo "Type \"make\" to compile MPD"