configure.ac: Make sure libcaca can actually be used instead of just checking for...
authorTim-Philipp Müller <tim@centricular.net>
Sat, 16 Dec 2006 11:42:56 +0000 (11:42 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Sat, 16 Dec 2006 11:42:56 +0000 (11:42 +0000)
Original commit message from CVS:
* configure.ac:
Make sure libcaca can actually be used instead of just checking for
/usr/bin/caca-config, so we don't wrongly try to build cacasink when
cross-compiling (fixes #384587).

ChangeLog
configure.ac

index fe80c60..a89cbe6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-12-16  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * configure.ac:
+         Make sure libcaca can actually be used instead of just checking for
+         /usr/bin/caca-config, so we don't wrongly try to build cacasink when
+         cross-compiling (fixes #384587).
+
 2006-12-15  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * Makefile.am:
index b515ad7..602e9c4 100644 (file)
@@ -611,9 +611,16 @@ GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
 dnl *** libcaca ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBCACA, true)
 GST_CHECK_FEATURE(LIBCACA, [libcaca coloured ASCII art], cacasink, [
-  GST_CHECK_CONFIGPROG(LIBCACA, caca-config)
-  AC_SUBST(LIBCACA_CFLAGS)
-  AC_SUBST(LIBCACA_LIBS)
+  GST_PKG_CHECK_MODULES(LIBCACA, caca)
+  dnl only newer versions of libcaca ship caca.pc, so try caca-config as well
+  if test "x$HAVE_LIBCACA" != "xyes"; then
+    GST_CHECK_CONFIGPROG(LIBCACA, caca-config)
+    dnl see if it compilation works too, might not if we are cross-compiling
+    if test "x$HAVE_LIBCACA" = "xyes"; then
+      AC_CHECK_LIB([caca], [caca_init], [HAVE_LIBCACA=yes],
+                   [HAVE_LIBCACA=no], [$LIBCACA_LIBS])
+    fi
+  fi
 ])
 
 dnl *** libdv ***