[xiph-commits] r9468 - trunk/vorbis-tools
thomasvs at motherfish-iii.xiph.org
thomasvs at motherfish-iii.xiph.org
Sat Jun 18 08:51:36 PDT 2005
Author: thomasvs
Date: 2005-06-18 08:51:34 -0700 (Sat, 18 Jun 2005)
New Revision: 9468
Modified:
trunk/vorbis-tools/configure.in
Log:
prefer pkg-config checks over old checks
Modified: trunk/vorbis-tools/configure.in
===================================================================
--- trunk/vorbis-tools/configure.in 2005-06-18 15:48:17 UTC (rev 9467)
+++ trunk/vorbis-tools/configure.in 2005-06-18 15:51:34 UTC (rev 9468)
@@ -101,9 +101,48 @@
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'
More information about the commits
mailing list