Use pkg-config for ogg and vorbis libs.

Modern versions of ogg and vorbis provide pc files, so might as well make
the most of it.
This commit is contained in:
Bill Currie 2012-02-05 22:27:27 +09:00
parent f5eec3d930
commit 47ee9d0355

View file

@ -37,12 +37,23 @@ AC_ARG_ENABLE(vorbis,
)
HAVE_VORBIS=no
if test "x$enable_vorbis" != "xno"; then
XIPH_PATH_OGG(HAVE_OGG=yes, HAVE_OGG=no)
if test "x$HAVE_OGG" = xyes; then
XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
if test "x$HAVE_VORBIS" = xyes; then
AC_DEFINE(HAVE_VORBIS, 1, [define this if you have ogg/vorbis libs])
fi
if test "x$PKG_CONFIG" != "x"; then
PKG_CHECK_MODULES([OGG], [ogg], HAVE_OGG=yes, HAVE_OGG=no)
if test "x$HAVE_OGG" = xyes; then
PKG_CHECK_MODULES([VORBIS], [vorbis], HAVE_VORBIS=yes, HAVE_VORBIS=no)
if test "x$HAVE_VORBIS" = xyes; then
PKG_CHECK_MODULES([VORBISFILE], [vorbisfile], HAVE_VORBISFILE=yes, HAVE_VORBISFILE=no)
AC_DEFINE(HAVE_VORBIS, 1, [define this if you have ogg/vorbis libs])
fi
fi
else
XIPH_PATH_OGG(HAVE_OGG=yes, HAVE_OGG=no)
if test "x$HAVE_OGG" = xyes; then
XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
if test "x$HAVE_VORBIS" = xyes; then
AC_DEFINE(HAVE_VORBIS, 1, [define this if you have ogg/vorbis libs])
fi
fi
fi
fi
AM_CONDITIONAL(HAVE_VORBIS, test "x$HAVE_VORBIS" = "xyes")