cdparanoia: check for cdparanoia with pkg-config first

cdparanoia now has a .pc file in post-0.10.2 SVN, so use
that to check for cdparanoia before we try all the other
checks. Besides being generally nicer, this may help with
correctly detecting cdparanoia on OSX some day (see #609918).
This commit is contained in:
Tim-Philipp Müller 2010-06-11 22:16:26 +01:00
parent b5a7e96291
commit dab38bb8a0
2 changed files with 35 additions and 26 deletions

View file

@ -584,38 +584,43 @@ AG_GST_CHECK_FEATURE(ALSA, [ALSA], alsa, [
])
dnl *** CDParanoia ***
dnl Note: upstream has a pkg-config file only in post-10.2 SVN so far
translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
AG_GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
AG_GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
cdda_open, -lm,
cdda_interface.h,
CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
HEADER_DIR="no"
FOUND_CDPARANOIA="yes")
if test "x$FOUND_CDPARANOIA" != "xyes";
then
PKG_CHECK_MODULES(CDPARANOIA, cdparanoia-3 >= 10.2, [
HAVE_CDPARANOIA="yes"
], [
AG_GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
cdda_open, -lm,
cdda/cdda_interface.h,
cdda_interface.h,
CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
HEADER_DIR="yes"
HEADER_DIR="no"
FOUND_CDPARANOIA="yes")
fi
if test "x$HEADER_DIR" = "xyes";
then
AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
defined if cdda headers are in a cdda/ directory)
fi
if test "x$FOUND_CDPARANOIA" = "xyes";
then
AC_CHECK_LIB(cdda_paranoia,
paranoia_cachemodel_size,
: ,
HAVE_CDPARANOIA=no,
[-lcdda_interface])
fi
if test "x$FOUND_CDPARANOIA" != "xyes";
then
AG_GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface,
cdda_open, -lm,
cdda/cdda_interface.h,
CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
HEADER_DIR="yes"
FOUND_CDPARANOIA="yes")
fi
if test "x$HEADER_DIR" = "xyes";
then
AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
defined if cdda headers are in a cdda/ directory)
fi
if test "x$FOUND_CDPARANOIA" = "xyes";
then
AC_CHECK_LIB(cdda_paranoia,
paranoia_cachemodel_size,
: ,
HAVE_CDPARANOIA=no,
[-lcdda_interface])
fi
AC_SUBST(CDPARANOIA_LIBS)
AC_SUBST(CDPARANOIA_LIBS)
])
])
dnl FIXME : add second check somehow if that is necessary
dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )

View file

@ -1,7 +1,11 @@
plugin_LTLIBRARIES = libgstcdparanoia.la
libgstcdparanoia_la_SOURCES = gstcdparanoiasrc.c
libgstcdparanoia_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstcdparanoia_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
$(CDPARANOIA_CFLAGS)
libgstcdparanoia_la_LIBADD = \
$(top_builddir)/gst-libs/gst/cdda/libgstcdda-$(GST_MAJORMINOR).la \
$(GST_BASE_LIBS) \