[xiph-commits] r3891 - libfishsound/trunk

conrad at svn.annodex.net conrad at svn.annodex.net
Thu Mar 19 21:12:46 PDT 2009


Author: conrad
Date: 2009-03-19 21:12:45 -0700 (Thu, 19 Mar 2009)
New Revision: 3891

Modified:
   libfishsound/trunk/configure.ac
Log:
check for vorbis by pkgconfig first, fallback to previous method
of directly looking up library symbols and headers.
pkg-config patch by Viktor Gal

Modified: libfishsound/trunk/configure.ac
===================================================================
--- libfishsound/trunk/configure.ac	2009-03-19 13:12:55 UTC (rev 3890)
+++ libfishsound/trunk/configure.ac	2009-03-20 04:12:45 UTC (rev 3891)
@@ -140,10 +140,18 @@
      [ ac_enable_vorbis=no ], [ ac_enable_vorbis=yes] )
 
 if test "x${ac_enable_vorbis}" = xyes ; 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")
+  PKG_CHECK_MODULES(VORBIS, vorbis, 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
+
   if test "x$HAVE_VORBIS" = xyes ; then
     AC_DEFINE(HAVE_VORBIS, [1], [Define to 1 if you have libvorbis])
     fishsound_pkgdeps="$fishsound_pkgdeps vorbis"
@@ -152,28 +160,35 @@
   fi
 
   if test "x${ac_enable_encode}" = xyes ; then
-    AC_CHECK_LIB(vorbisenc, vorbis_encode_init, HAVE_VORBISENC="maybe", ,
-                 [-lm -logg -lvorbis])
-    if test "x$HAVE_VORBISENC" = xmaybe ; then
-      AC_CHECK_HEADER(vorbis/vorbisenc.h, HAVE_VORBISENC="yes",
-                      HAVE_VORBISENC="no")
+    PKG_CHECK_MODULES(VORBISENC, vorbisenc, HAVE_VORBISENC="yes", HAVE_VORBISENC="no")
+
+    if test "x$HAVE_VORBISENC" = "xno" ; then
+      AC_CHECK_LIB(vorbisenc, vorbis_encode_init, HAVE_VORBISENC="maybe", ,
+                   [-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
+
     if test "x$HAVE_VORBISENC" = xyes ; then
       AC_DEFINE(HAVE_VORBISENC, [1], [Define to 1 if you have libvorbisenc])
       fishsound_pkgdeps="$fishsound_pkgdeps vorbisenc"
     else
       AC_DEFINE(HAVE_VORBISENC, [0], [Define to 1 if you have libvorbisenc])
     fi
+
   else
     AC_DEFINE(HAVE_VORBISENC, [0], [Define to 1 if you have libvorbisenc])
   fi
 
   if test "x$HAVE_VORBIS" = "xyes" && test "x$HAVE_VORBISENC" = "xyes" ; then
-    VORBIS_LIBS="-lvorbisenc -lvorbis -logg -lm"
     AC_SUBST(VORBIS_LIBS)
     VORBIS_SUPPORT="yes"
   elif test "x$HAVE_VORBIS" = xyes ; then
-    VORBIS_LIBS="-lvorbis -logg -lm"
     AC_SUBST(VORBIS_LIBS)
     VORBIS_SUPPORT="decode only"
   fi



More information about the commits mailing list