use pkg-config checks for some, falling back to the old one.
authorThomas Vander Stichele <thomas@apestaart.org>
Wed, 10 Mar 2004 17:21:14 +0000 (17:21 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Wed, 10 Mar 2004 17:21:14 +0000 (17:21 +0000)
Original commit message from CVS:
use pkg-config checks for some, falling back to the old one.

fixes #131270

ChangeLog
configure.ac
m4/libdv.m4 [deleted file]

index 21c50a0..f92fb01 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2004-03-10  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+       patch from: Stephane Loeuillet
+
+       * configure.ac:
+         use pkg-config for some libraries, falling back to the old .m4 way
+          (fixes #131270)
+       * m4/libdv.m4:
+          removed
+
+2004-03-10  Thomas Vander Stichele  <thomas at apestaart dot org>
+
        * configure.ac:
        * tools/Makefile.am:
        * tools/Makefile.in:
index 6cd0a19..212ed6a 100644 (file)
@@ -661,7 +661,13 @@ GST_CHECK_FEATURE(AALIB, [aasink plug-in], aasink, [
 dnl *** alsa ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
 GST_CHECK_FEATURE(ALSA, [alsa plug-ins], gstalsa, [
-   AM_PATH_ALSA(0.9.1, HAVE_ALSA=yes, HAVE_ALSA=no)
+  PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, [
+    HAVE_ALSA="yes"
+    AC_SUBST(ALSA_CFLAGS)
+    AC_SUBST(ALSA_LIBS)
+  ], [
+    AM_PATH_ALSA(0.9.1, HAVE_ALSA="yes", HAVE_ALSA="no")
+  ])
 ])
 
 dnl *** arts ***
@@ -819,8 +825,14 @@ GST_CHECK_FEATURE(DVDNAV, [dvdnav library], dvdnavsrc, [
 dnl **** ESound ****
 translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
 GST_CHECK_FEATURE(ESD, [esound plug-ins], esdsink esdmon, [
-  AM_PATH_ESD(0.2.12, HAVE_ESD=yes, HAVE_ESD=no)
-  AS_SCRUB_INCLUDE(ESD_CFLAGS)
+  PKG_CHECK_MODULES(ESD, esound >= 0.2.12, [
+    HAVE_ESD="yes"
+    AC_SUBST(ESD_CFLAGS)
+    AC_SUBST(ESD_LIBS)
+  ], [
+    AM_PATH_ESD(0.2.12, HAVE_ESD="yes", HAVE_ESD="no")
+    AS_SCRUB_INCLUDE(ESD_CFLAGS)
+  ])
 ])
 
 dnl **** Free AAC Encoder (FAAC) ****
@@ -1228,9 +1240,15 @@ GST_CHECK_FEATURE(SHOUT, [shout plug-in], icecastsend, [
 dnl *** shout2 *** 
 translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
 GST_CHECK_FEATURE(SHOUT2, [shout2 plug-in], shout2send, [
-  AM_PATH_SHOUT2(HAVE_SHOUT2=yes, HAVE_SHOUT2=no)
-  AC_SUBST(SHOUT2_CFLAGS)
-  AC_SUBST(SHOUT2_LIBS)
+  PKG_CHECK_MODULES(SHOUT2, shout >= 2.0, [
+    HAVE_SHOUT2="yes"
+    AC_SUBST(SHOUT2_CFLAGS)
+    AC_SUBST(SHOUT2_LIBS)
+  ], [
+    AM_PATH_SHOUT2(HAVE_SHOUT2="yes", HAVE_SHOUT2="no")
+    AC_SUBST(SHOUT2_CFLAGS)
+    AC_SUBST(SHOUT2_LIBS)
+  ])
 ])
 
 dnl *** sidplay ***
@@ -1256,9 +1274,15 @@ GST_CHECK_FEATURE(LIBPNG, [snapshot plug-in], snapshot, [
 dnl *** speex ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_SPEEX, true)
 GST_CHECK_FEATURE(SPEEX, [speex plug-in], speex, [
-  GST_CHECK_LIBHEADER(SPEEX, speex, speex_bits_init, , speex.h, HAVE_SPEEX="yes" SPEEX_LIBS="-lspeex")
-  AC_SUBST(SPEEX_CFLAGS)
-  AC_SUBST(SPEEX_LIBS)
+  PKG_CHECK_MODULES(SPEEX, speex >= 1.0 speex < 1.1, [
+    HAVE_SPEEX="yes"
+    AC_SUBST(SPEEX_CFLAGS)
+    AC_SUBST(SPEEX_LIBS)
+  ], [
+    GST_CHECK_LIBHEADER(SPEEX, speex, speex_bits_init, , speex.h, HAVE_SPEEX="yes" SPEEX_LIBS="-lspeex")
+    AC_SUBST(SPEEX_CFLAGS)
+    AC_SUBST(SPEEX_LIBS)
+  ])
 ])
 
 dnl *** sndfile ***
@@ -1288,8 +1312,14 @@ GST_CHECK_FEATURE(TARKIN, [tarkinenc tarkindec], tarkin, [
 dnl *** ogg ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_OGG, true)
 GST_CHECK_FEATURE(OGG, [ogg de/encoder], oggdemux oggmux, [
-  XIPH_PATH_OGG(HAVE_OGG=yes, HAVE_OGG=no)
-  AS_SCRUB_INCLUDE(OGG_CFLAGS)
+  PKG_CHECK_MODULES(OGG, ogg >= 1.0, [
+    HAVE_OGG="yes"
+    AC_SUBST(OGG_CFLAGS)
+    AC_SUBST(OGG_LIBS)
+  ], [
+    XIPH_PATH_OGG(HAVE_OGG="yes", HAVE_OGG="no")
+    AS_SCRUB_INCLUDE(OGG_CFLAGS)
+  ])
 ])
 
 dnl *** theora ***
@@ -1440,7 +1470,9 @@ esac],
 [BUILD_EXAMPLES=yes]) dnl Default value
 
 dnl seeking needs freetype, so check for it here
-AC_CHECK_FT2(2.0.9,HAVE_FT2=yes,HAVE_FT2=no)
+PKG_CHECK_MODULES(FT2, freetype2 >= 2.0.9, HAVE_FT2="yes", [
+  AC_CHECK_FT2(2.0.9, HAVE_FT2="yes", HAVE_FT2="no")
+])
 dnl make the HAVE_FT2 variable available to automake and Makefile.am
 AM_CONDITIONAL(HAVE_FT2, test "x$HAVE_FT2" = "xyes")
 AC_SUBST(FT2_CFLAGS)
diff --git a/m4/libdv.m4 b/m4/libdv.m4
deleted file mode 100644 (file)
index 108b640..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-# Configure paths for libdv
-# copied from vorbis.m4 by Thomas
-# checks for libdv 0.9.5 since that added an extra argument to _init
-# Shamelessly stolen from Owen Taylor and Manish Singh
-
-dnl AM_PATH_LIBDV([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for liblibdv, and define LIBDV_CFLAGS and LIBDV_LIBS
-dnl
-AC_DEFUN([AM_PATH_LIBDV],
-[dnl 
-dnl Get the cflags and libraries
-
-AC_ARG_WITH(libdv,[  --with-libdv=PFX   Prefix where libdv is installed (optional)], libdv_prefix="$withval", libdv_prefix="")
-AC_ARG_WITH(libdv-libraries,[  --with-libdv-libraries=DIR   Directory where libdv library is installed (optional)], libdv_libraries="$withval", libdv_libraries="")
-AC_ARG_WITH(libdv-includes,[  --with-libdv-includes=DIR   Directory where libdv header files are installed (optional)], libdv_includes="$withval", libdv_includes="")
-AC_ARG_ENABLE(libdvtest, [  --disable-libdvtest       Do not try to compile and run a test libdv program],, enable_libdvtest=yes)
-
-  if test "x$libdv_libraries" != "x" ; then
-    LIBDV_LIBS="-L$libdv_libraries"
-  elif test "x$libdv_prefix" != "x" ; then
-    LIBDV_LIBS="-L$libdv_prefix/lib"
-  elif test "x$prefix" != "xNONE"; then
-    LIBDV_LIBS="-L$prefix/lib"
-  fi
-
-  LIBDV_LIBS="$LIBDV_LIBS -ldv -lm"
-
-  if test "x$libdv_includes" != "x" ; then
-    LIBDV_CFLAGS="-I$libdv_includes"
-  elif test "x$libdv_prefix" != "x" ; then
-    LIBDV_CFLAGS="-I$libdv_prefix/include"
-  elif test "x$prefix" != "xNONE"; then
-    LIBDV_CFLAGS="-I$prefix/include"
-  fi
-
-
-  AC_MSG_CHECKING(for libdv)
-  no_libdv=""
-
-
-  if test "x$enable_libdvtest" = "xyes" ; then
-    ac_save_CFLAGS="$CFLAGS"
-    ac_save_LIBS="$LIBS"
-    CFLAGS="$CFLAGS $LIBDV_CFLAGS"
-    LIBS="$LIBS $LIBDV_LIBS"
-dnl
-dnl Now check if the installed libdv is sufficiently new.
-dnl
-      dnl rm -f conf.libdvtest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libdv/dv.h>
-
-int main ()
-{
-  dv_decoder_new (0, 0, 0);
-  return 0;
-}
-
-],, no_libdv=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-  fi
-
-  if test "x$no_libdv" = "x" ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$1], , :, [$1])     
-  else
-     AC_MSG_RESULT(no)
-     if test -f conf.libdvtest ; then
-       :
-     else
-       echo "*** Could not run libdv test program, checking why..."
-       CFLAGS="$CFLAGS $LIBDV_CFLAGS"
-       LIBS="$LIBS $LIBDV_LIBS"
-       AC_TRY_LINK([
-#include <stdio.h>
-#include <libdv/dv.h>
-],     [ return 0; ],
-       [ echo "*** The test program compiled, but did not run. This usually means"
-       echo "*** that the run-time linker is not finding libdv or finding the wrong"
-       echo "*** version of libdv. If it is not finding libdv, you'll need to set your"
-       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-       echo "*** is required on your system"
-       echo "***"
-       echo "*** If you have an old version installed, it is best to remove it, although"
-       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
-       [ echo "*** The test program failed to compile or link. See the file config.log for the"
-       echo "*** exact error that occured. This usually means libdv was incorrectly installed"
-       echo "*** or that you have moved libdv since it was installed." ])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-     LIBDV_CFLAGS=""
-     LIBDV_LIBS=""
-     LIBDVFILE_LIBS=""
-     LIBDVENC_LIBS=""
-     ifelse([$2], , :, [$2])
-  fi
-  AC_SUBST(LIBDV_CFLAGS)
-  AC_SUBST(LIBDV_LIBS)
-  AC_SUBST(LIBDVFILE_LIBS)
-  AC_SUBST(LIBDVENC_LIBS)
-  dnl rm -f conf.libdvtest
-])