From 53ac72a8783c54467f7462cf536d637e058da0fd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 1 Sep 2011 10:09:46 +0200 Subject: Makefile.am: use AVAHI_CFLAGS, AVAHI_LIBS Don't add those to MPD_CFLAGS / MPD_LIBS. --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b362592cf..cf992eb9d 100644 --- a/configure.ac +++ b/configure.ac @@ -542,8 +542,7 @@ enable_bounjour=no if test x$with_zeroconf != xno; then if test x$with_zeroconf = xavahi || test x$with_zeroconf = xauto; then PKG_CHECK_MODULES([AVAHI], [avahi-client avahi-glib], - [enable_avahi=yes;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])] - MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS") + [enable_avahi=yes;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])]) fi if test x$enable_avahi = xyes; then -- cgit v1.2.3 From e635d479129fe3a6ea4cff13b682be6cc97db81c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 1 Sep 2011 10:07:58 +0200 Subject: configure.ac: use MPD_AUTO_PKG to detect avahi Don't abort the configure script when avahi could not be auto-detected. It previously did, because there was no custom "fail" action for PKG_CHECK_MODULES. --- configure.ac | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index cf992eb9d..4de63dac9 100644 --- a/configure.ac +++ b/configure.ac @@ -530,27 +530,31 @@ dnl --------------------------------------------------------------------------- dnl --------------------------------- zeroconf -------------------------------- case $with_zeroconf in -no|avahi|bonjour) +no|bonjour) + enable_avahi=no ;; + +avahi) + enable_avahi=yes + ;; + *) with_zeroconf=auto + enable_avahi=auto ;; esac -enable_avahi=no -enable_bounjour=no -if test x$with_zeroconf != xno; then - if test x$with_zeroconf = xavahi || test x$with_zeroconf = xauto; then - PKG_CHECK_MODULES([AVAHI], [avahi-client avahi-glib], - [enable_avahi=yes;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])]) - fi +MPD_AUTO_PKG(avahi, AVAHI, [avahi-client avahi-glib], + [avahi client library], [avahi client+glib not found]) +if test x$enable_avahi = xyes; then + AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support]) + with_zeroconf=avahi +fi - if test x$enable_avahi = xyes; then - with_zeroconf=avahi - elif test x$with_zeroconf = xavahi; then - AC_MSG_ERROR([Avahi support requested but not found]) - fi +AM_CONDITIONAL(HAVE_AVAHI, test x$enable_avahi = xyes) +enable_bounjour=no +if test x$with_zeroconf != xno; then if test x$with_zeroconf = xbonjour || test x$with_zeroconf = xauto; then AC_CHECK_HEADER(dns_sd.h, [enable_bonjour=yes;AC_DEFINE([HAVE_BONJOUR], 1, [Define to enable Bonjour Zeroconf support])]) @@ -573,7 +577,6 @@ if test x$with_zeroconf != xno; then fi AM_CONDITIONAL(HAVE_ZEROCONF, test x$with_zeroconf != xno) -AM_CONDITIONAL(HAVE_AVAHI, test x$with_zeroconf = xavahi) AM_CONDITIONAL(HAVE_BONJOUR, test x$with_zeroconf = xbonjour) dnl --------------------------------------------------------------------------- -- cgit v1.2.3 From a1b880642244b9f732d327e1d93162652838bb06 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 1 Sep 2011 09:18:16 +0200 Subject: configure.ac: fail if libid3tag was enabled explicitly, but not found Add M4 function MPD_AUTO_PKG_LIB for pkg-config with AC_CHECK_LIB fallback. --- configure.ac | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 4de63dac9..74aef61de 100644 --- a/configure.ac +++ b/configure.ac @@ -196,9 +196,9 @@ AC_ARG_ENABLE(httpd-output, [enable_httpd_output=auto]) AC_ARG_ENABLE(id3, - AS_HELP_STRING([--disable-id3], - [disable id3 support (default: enable)]),, - enable_id3=yes) + AS_HELP_STRING([--enable-id3], + [disable id3 support]),, + enable_id3=auto) AC_ARG_ENABLE(inotify, AS_HELP_STRING([--disable-inotify], @@ -510,13 +510,8 @@ fi AM_CONDITIONAL(HAVE_CUE, test x$enable_cue = xyes) dnl -------------------------------- libid3tag -------------------------------- -if test x$enable_id3 = xyes; then - PKG_CHECK_MODULES([ID3TAG], [id3tag],, - AC_CHECK_LIB(id3tag, id3_file_open, - [ID3TAG_LIBS="-lid3tag -lz" ID3TAG_CFLAGS=""], - enable_id3=no)) -fi - +MPD_AUTO_PKG_LIB(id3, ID3TAG, id3tag, id3tag, id3_file_open, [-lid3tag -lz], [], + [id3tag], [libid3tag not found]) if test x$enable_id3 = xyes; then AC_DEFINE(HAVE_ID3TAG, 1, [Define to use id3tag]) fi -- cgit v1.2.3 From 13cdc9a9f8944d124da3f6a25dfc93cd9f11997b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 1 Sep 2011 09:22:18 +0200 Subject: configure.ac: auto-detect libmad without pkg-config The pkg-config file was added by the Debian package maintainers, and unfortunately, the rest of the world doesn't have it. --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 74aef61de..4d855a70b 100644 --- a/configure.ac +++ b/configure.ac @@ -799,7 +799,8 @@ if test x$enable_gme = xyes; then fi dnl ---------------------------------- libmad --------------------------------- -MPD_AUTO_PKG(mad, MAD, [mad], +MPD_AUTO_PKG_LIB(mad, MAD, [mad], + mad, mad_stream_init, [-lmad], [], [libmad MP3 decoder plugin], [libmad not found]) if test x$enable_mad = xyes; then AC_DEFINE(HAVE_MAD, 1, [Define to use libmad]) -- cgit v1.2.3 From 446f9973cc020490b649c3b40feae2fa9ca98c0d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 1 Sep 2011 18:37:40 +0200 Subject: configure.ac: fail if FLAC was enabled explicitly, but not found --- configure.ac | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 4d855a70b..508775c09 100644 --- a/configure.ac +++ b/configure.ac @@ -171,9 +171,9 @@ AC_ARG_ENABLE(fifo, enable_fifo=yes) AC_ARG_ENABLE(flac, - AS_HELP_STRING([--disable-flac], - [disable flac support (default: enable)]),, - enable_flac=yes) + AS_HELP_STRING([--enable-flac], + [enable FLAC decoder]),, + enable_flac=auto) AC_ARG_ENABLE(fluidsynth, AS_HELP_STRING([--enable-fluidsynth], @@ -750,10 +750,12 @@ fi AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes) dnl ----------------------------------- FLAC ---------------------------------- + +MPD_AUTO_PKG(flac, FLAC, [flac >= 1.1], + [FLAC decoder], [libFLAC not found]) + if test x$enable_flac = xyes; then - PKG_CHECK_MODULES(FLAC, [flac >= 1.1], - AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support]), - enable_flac=no) + AC_DEFINE(HAVE_FLAC, 1, [Define for FLAC support]) oldcflags="$CFLAGS" oldlibs="$LIBS" -- cgit v1.2.3 From 2556449b361c00d9c66cf85beb64d7c6458763ed Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 1 Sep 2011 18:42:17 +0200 Subject: configure.ac: fail if Vorbis was enabled explicitly, but not found .. and a minor tweak for libFLAC+libogg detection. --- configure.ac | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 508775c09..502560110 100644 --- a/configure.ac +++ b/configure.ac @@ -353,9 +353,9 @@ AC_ARG_ENABLE(un, [enable_un=yes]) AC_ARG_ENABLE(vorbis, - AS_HELP_STRING([--disable-vorbis], - [disable Ogg Vorbis support (default: enable)]),, - enable_vorbis=yes) + AS_HELP_STRING([--enable-vorbis], + [enable Ogg Vorbis decoder]),, + enable_vorbis=auto) AC_ARG_ENABLE(vorbis-encoder, AS_HELP_STRING([--enable-vorbis-encoder], @@ -631,11 +631,6 @@ if test x$enable_lastfm = xyes; then fi AM_CONDITIONAL(ENABLE_LASTFM, test x$enable_lastfm = xyes) -dnl ---------------------------------- libogg --------------------------------- -if test x$with_tremor = xno || test -z $with_tremor; then - PKG_CHECK_MODULES(OGG, [ogg], enable_ogg=yes, enable_ogg=no) -fi - dnl ---------------------------------- libmms --------------------------------- MPD_AUTO_PKG(mms, MMS, [libmms >= 0.4], [libmms mms:// protocol support], [libmms not found]) @@ -770,12 +765,10 @@ if test x$enable_flac = xyes; then LIBS="$oldlibs" if test x$enable_oggflac = xflac; then - if test x$enable_ogg = xyes; then - FLAC_LIBS="${FLAC_LIBS} -logg" - else - enable_oggflac=yes - AC_MSG_WARN("FLAC has the ogg API built in, but couldn't find ogg. Disabling oggflac.") - fi + PKG_CHECK_MODULES(OGG, [ogg], + [FLAC_LIBS="${FLAC_LIBS} ${OGG_LIBS}" FLAC_CFLAGS="${FLAC_CFLAGS} ${OGG_CFLAGS}"], + [enable_oggflac=yes; + AC_MSG_WARN("FLAC has the ogg API built in, but couldn't find ogg. Disabling oggflac.")]) fi fi @@ -943,7 +936,7 @@ fi if test x$enable_tremor = xyes; then AC_DEFINE(HAVE_TREMOR,1, [Define to use tremor (libvorbisidec) for ogg support]) - AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]), + AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]) else TREMOR_CFLAGS= TREMOR_LIBS= @@ -972,18 +965,18 @@ fi AM_CONDITIONAL(HAVE_OGGFLAC, test x$enable_oggflac = xyes) dnl -------------------------------- Ogg Vorbis ------------------------------- -if test x$enable_vorbis = xyes; then - if test x$enable_tremor = xyes; then + +if test x$enable_tremor = xyes; then + if test x$enable_vorbis = xyes; then AC_MSG_WARN(["OggTremor detected, could not enable Vorbis."]) - enable_vorbis=no - elif test x$enable_ogg = xyes; then - PKG_CHECK_MODULES(VORBIS, [vorbis vorbisfile], - AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]), - enable_vorbis=no) - else - AC_MSG_WARN(["Ogg not detected, could not enable Vorbis."]) - enable_vorbis=no fi + enable_vorbis=no +fi + +MPD_AUTO_PKG(vorbis, VORBIS, [vorbis vorbisfile ogg], + [Ogg Vorbis decoder], [libvorbis not found]) +if test x$enable_vorbis = xyes; then + AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]) fi AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes || test x$enable_tremor = xyes) -- cgit v1.2.3