prefer pkg-config checks over old checks

svn path=/trunk/vorbis-tools/; revision=9468
parent 16749569
......@@ -101,8 +101,47 @@ dnl --------------------------------------------------
dnl Check for generally needed libraries
dnl --------------------------------------------------
XIPH_PATH_OGG(,AC_MSG_ERROR(Ogg needed!))
XIPH_PATH_VORBIS(,AC_MSG_ERROR(Vorbis needed!))
HAVE_OGG=no
dnl first check through pkg-config
dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
if test "x$HAVE_PKG_CONFIG" = "xyes"
then
PKG_CHECK_MODULES(OGG, ogg >= 1.0, HAVE_OGG=yes, HAVE_OGG=no)
fi
if test "x$HAVE_OGG" = "xno"
then
dnl fall back to the old school test
XIPH_PATH_OGG(,AC_MSG_ERROR(Ogg needed!))
libs_save=$LIBS
LIBS="$OGG_LIBS $VORBIS_LIBS"
AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
LIBS=$libs_save
fi
dnl check for Vorbis
HAVE_VORBIS=no
dnl first check through pkg-config since it's more flexible
if test "x$HAVE_PKG_CONFIG" = "xyes"
then
PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0.1, HAVE_VORBIS=yes, HAVE_VORBIS=no)
dnl also set VORBISENC_LIBS since an examples needs it
dnl the old .m4 sets this to a value to use on top of VORBIS_LIBS,
dnl so we do the same here.
VORBISENC_LIBS="-lvorbisenc"
VORBISFILE_LIBS="-lvorbisfile"
AC_SUBST(VORBISENC_LIBS)
AC_SUBST(VORBISFILE_LIBS)
fi
if test "x$HAVE_VORBIS" = "xno"
then
dnl fall back to the old school test
XIPH_PATH_VORBIS(,AC_MSG_ERROR(Vorbis needed!))
fi
SHARE_LIBS='$(top_builddir)/share/libutf8.a $(top_builddir)/share/libgetopt.a'
SHARE_CFLAGS='-I$(top_srcdir)/include'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment