Commit a35a7807 authored by conrad's avatar conrad
Browse files

check for vorbis by pkgconfig first, fallback to previous method

of directly looking up library symbols and headers.
pkg-config patch by Viktor Gal

git-svn-id: http://svn.annodex.net/libfishsound/trunk@3891 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 91548c9a
...@@ -140,10 +140,18 @@ AC_ARG_ENABLE(vorbis, ...@@ -140,10 +140,18 @@ AC_ARG_ENABLE(vorbis,
[ ac_enable_vorbis=no ], [ ac_enable_vorbis=yes] ) [ ac_enable_vorbis=no ], [ ac_enable_vorbis=yes] )
if test "x${ac_enable_vorbis}" = xyes ; then if test "x${ac_enable_vorbis}" = xyes ; then
AC_CHECK_LIB(vorbis, vorbis_info_init, HAVE_VORBIS="maybe", , [-lm -logg]) PKG_CHECK_MODULES(VORBIS, vorbis, HAVE_VORBIS="yes", HAVE_VORBIS="no")
if test "x$HAVE_VORBIS" = xmaybe; then
AC_CHECK_HEADER(vorbis/codec.h, HAVE_VORBIS="yes", HAVE_VORBIS="no") if test "x$HAVE_VORBIS" = "xno" ; then
AC_CHECK_LIB(vorbis, vorbis_info_init, HAVE_VORBIS="maybe", , [-lm -logg])
if test "x$HAVE_VORBIS" = xmaybe; then
AC_CHECK_HEADER(vorbis/codec.h, HAVE_VORBIS="yes", HAVE_VORBIS="no")
fi
if test "x$HAVE_VORBIS" = xyes ; then
VORBIS_LIBS="-lvorbis -logg -lm"
fi
fi fi
if test "x$HAVE_VORBIS" = xyes ; then if test "x$HAVE_VORBIS" = xyes ; then
AC_DEFINE(HAVE_VORBIS, [1], [Define to 1 if you have libvorbis]) AC_DEFINE(HAVE_VORBIS, [1], [Define to 1 if you have libvorbis])
fishsound_pkgdeps="$fishsound_pkgdeps vorbis" fishsound_pkgdeps="$fishsound_pkgdeps vorbis"
...@@ -152,28 +160,35 @@ if test "x${ac_enable_vorbis}" = xyes ; then ...@@ -152,28 +160,35 @@ if test "x${ac_enable_vorbis}" = xyes ; then
fi fi
if test "x${ac_enable_encode}" = xyes ; then if test "x${ac_enable_encode}" = xyes ; then
AC_CHECK_LIB(vorbisenc, vorbis_encode_init, HAVE_VORBISENC="maybe", , PKG_CHECK_MODULES(VORBISENC, vorbisenc, HAVE_VORBISENC="yes", HAVE_VORBISENC="no")
[-lm -logg -lvorbis])
if test "x$HAVE_VORBISENC" = xmaybe ; then if test "x$HAVE_VORBISENC" = "xno" ; then
AC_CHECK_HEADER(vorbis/vorbisenc.h, HAVE_VORBISENC="yes", AC_CHECK_LIB(vorbisenc, vorbis_encode_init, HAVE_VORBISENC="maybe", ,
HAVE_VORBISENC="no") [-lm -logg -lvorbis])
if test "x$HAVE_VORBISENC" = xmaybe ; then
AC_CHECK_HEADER(vorbis/vorbisenc.h, HAVE_VORBISENC="yes",
HAVE_VORBISENC="no")
fi
if test "x$HAVE_VORBISENC" = xyes ; then
VORBIS_LIBS="-lvorbisenc $VORBIS_LIBS"
fi
fi fi
if test "x$HAVE_VORBISENC" = xyes ; then if test "x$HAVE_VORBISENC" = xyes ; then
AC_DEFINE(HAVE_VORBISENC, [1], [Define to 1 if you have libvorbisenc]) AC_DEFINE(HAVE_VORBISENC, [1], [Define to 1 if you have libvorbisenc])
fishsound_pkgdeps="$fishsound_pkgdeps vorbisenc" fishsound_pkgdeps="$fishsound_pkgdeps vorbisenc"
else else
AC_DEFINE(HAVE_VORBISENC, [0], [Define to 1 if you have libvorbisenc]) AC_DEFINE(HAVE_VORBISENC, [0], [Define to 1 if you have libvorbisenc])
fi fi
else else
AC_DEFINE(HAVE_VORBISENC, [0], [Define to 1 if you have libvorbisenc]) AC_DEFINE(HAVE_VORBISENC, [0], [Define to 1 if you have libvorbisenc])
fi fi
if test "x$HAVE_VORBIS" = "xyes" && test "x$HAVE_VORBISENC" = "xyes" ; then if test "x$HAVE_VORBIS" = "xyes" && test "x$HAVE_VORBISENC" = "xyes" ; then
VORBIS_LIBS="-lvorbisenc -lvorbis -logg -lm"
AC_SUBST(VORBIS_LIBS) AC_SUBST(VORBIS_LIBS)
VORBIS_SUPPORT="yes" VORBIS_SUPPORT="yes"
elif test "x$HAVE_VORBIS" = xyes ; then elif test "x$HAVE_VORBIS" = xyes ; then
VORBIS_LIBS="-lvorbis -logg -lm"
AC_SUBST(VORBIS_LIBS) AC_SUBST(VORBIS_LIBS)
VORBIS_SUPPORT="decode only" VORBIS_SUPPORT="decode only"
fi fi
......
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