[Easytag-mailing] [patch] better Ogg Vorbis detection



It doesn't make sense (and is incrrect - see the need for the libm 
check) to check the availability of libraries through pkg-config, and 
then AC_CHECK_LIB() for individual libraries.

Simply use the CFLAGS and LIBS returned by PKG_CHECK_MODULES().

Also removed by this patch is a AC_MSG_CHECKING() that was placed after 
the actual check (and isn't required since PKG_CHECK_MODULES() already 
has a similar printout).

BTW:
The following is really confusing:
  --disable-ogg           Disable support for Ogg Vorbis files
  --disable-speex         Disable support for Ogg Speex files

Can I rename the --disable-ogg to --disable-vorbis ?


 configure.in |   21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/configure.in b/configure.in
index 1fdec48..d3d5607 100644
--- a/configure.in
+++ b/configure.in
@@ -88,38 +88,27 @@ AC_CHECK_LIB(socket, recv)
 dnl ################################################
 dnl # Ogg Vorbis librairies
 dnl ################################################
-dnl XIPH_PATH_OGG(enable_ogg="yes",enable_ogg="no")
 
 if test "x$enable_ogg" = "xyes"; then
-    PKG_CHECK_MODULES(OGG, ogg >= 1.0, , ogg_available=no)
+    PKG_CHECK_MODULES(OGG, ogg >= 1.0 vorbis >= 1.0.1 vorbisfile, , ogg_available=no)
     if test "x$ogg_available" = "xno"; then
         echo "***"
-        echo "*** Warning: libogg >= 1.0 needed"
-        echo "***"
-    fi
-    PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0.1, , ogg_available=no)
-    if test "x$ogg_available" = "xno"; then
-        echo "***"
-        echo "*** Warning: libvorbis >= 1.0.1 needed"
+        echo "*** Warning: libogg >= 1.0 and vorbis >= 1.0.1 needed"
         echo "***"
+    else
+        CFLAGS="$CFLAGS $OGG_CFLAGS"
+        LIBS="$LIBS $OGG_LIBS"
     fi
-    AC_CHECK_LIB(m, cos) dnl Patch from Christian Weisgerber
-    AC_CHECK_LIB(ogg, ogg_sync_init, , ogg_available=no)
-    AC_CHECK_LIB(vorbis, vorbis_comment_init, , ogg_available=no)
-    AC_CHECK_LIB(vorbisfile, ov_open, , ogg_available=no)
 fi
 
-AC_MSG_CHECKING(for Ogg Vorbis file support)
 if test "x$enable_ogg" = "xyes"; then
     if test "x$ogg_available" = "xno"; then
-        AC_MSG_RESULT(no)
         enable_ogg="no"
         echo "***"
         echo "*** Warning: Ogg Vorbis file support disabled"
         echo "*** (Install libogg and libvorbis libraries to enable it)"
         echo "***"
     else
-        AC_MSG_RESULT(yes)
         AC_DEFINE(ENABLE_OGG,1,[Define for Ogg Vorbis support])
     fi
 else





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]