From 2c348dfdc54a62d70c4271145534cbc1a2563836 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 27 Feb 2006 18:37:47 +0000 Subject: [PATCH] configure.ac: Make the id3tag and mad checks check for both a header and the appropriate library if the pkg-config is... Original commit message from CVS: * configure.ac: Make the id3tag and mad checks check for both a header and the appropriate library if the pkg-config is missing. (Closes #331842) Split the id3tag and mad checks into 2 pieces. Sometime soon I might do the same for the plugins themselves. --- ChangeLog | 8 ++++++++ configure.ac | 40 ++++++++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5597de..beced5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-02-27 Jan Schmidt + + * configure.ac: + Make the id3tag and mad checks check for both a header and the + appropriate library if the pkg-config is missing. (Closes #331842) + Split the id3tag and mad checks into 2 pieces. Sometime soon I might + do the same for the plugins themselves. + 2006-02-27 Luca Ognibene Reviewed by: Tim-Philipp Müller diff --git a/configure.ac b/configure.ac index 0a37892..16aa463 100644 --- a/configure.ac +++ b/configure.ac @@ -330,23 +330,39 @@ int main (int argc, char *argv[]) ]) ]) -dnl *** mad *** -dnl FIXME: we could use header checks here as well IMO -translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true) -GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [ +dnl *** id3tag from the MAD project *** +translit(dnm, m, l) AM_CONDITIONAL(USE_ID3TAG, true) +GST_CHECK_FEATURE(ID3TAG, [id3tag reading and writing from the MAD project], id3tag, [ dnl check with pkg-config first - PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15, HAVE_MAD="yes", HAVE_MAD="no") - if test "x$HAVE_MAD" = "xno"; then + PKG_CHECK_MODULES(ID3TAG, id3tag >= 0.15, HAVE_ID3TAG="yes", HAVE_ID3TAG="no") + if test "x$HAVE_ID3TAG" = "xno"; then dnl fall back to oldskool detection - AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad") - if test "x$HAVE_MAD" = "xyes"; then - HAVE_MAD="no" + AC_CHECK_HEADER(id3tag.h, [ save_LIBS=$LIBS LIBS="-lz" - AC_CHECK_LIB(id3tag, id3_tag_options, HAVE_MAD="yes" MAD_LIBS="-lmad -lid3tag -lz") + AC_CHECK_LIB(id3tag, id3_tag_options, HAVE_ID3TAG="yes" ID3TAG_LIBS="-lid3tag -lz") LIBS=$save_LIBS - fi - fi + ]) + fi +]) +AC_SUBST(ID3TAG_LIBS) + +dnl *** mad *** +translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true) +GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [ + if test "x$HAVE_ID3TAG" = "xyes"; then + dnl check with pkg-config first + PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15, HAVE_MAD="yes", HAVE_MAD="no") + if test "x$HAVE_MAD" = "xno"; then + dnl fall back to oldskool detection + AC_CHECK_HEADER(mad.h, [ + AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad $ID3TAG_LIBS") + ]) + fi + else + HAVE_MAD="no" + AC_MSG_WARN([libid3tag was not available, cannot build MAD MP3 decoder plugin]) + fi ]) AC_SUBST(MAD_LIBS) -- 2.7.4