[totem-pl-parser] build: Fixes for libquvi support



commit 51b059c1d336cab622c02176a962c56c09477096
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Dec 14 14:47:29 2010 +0000

    build: Fixes for libquvi support
    
    Make it compile when libquvi isn't available. Also make sure that
    we list libquvi in the private dependencies in pkg-config files.

 configure.in                          |    3 +++
 plparse/totem-pl-parser-videosite.c   |   10 +++++++---
 plparse/totem-pl-parser.c             |    5 +----
 totem-plparser-mini-uninstalled.pc.in |    2 +-
 totem-plparser-mini.pc.in             |    2 +-
 totem-plparser-uninstalled.pc.in      |    2 +-
 totem-plparser.pc.in                  |    2 +-
 7 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/configure.in b/configure.in
index af47014..cef0d1c 100644
--- a/configure.in
+++ b/configure.in
@@ -101,6 +101,7 @@ else
 fi
 
 enable_quvi=auto
+QUVI=""
 AC_ARG_ENABLE(enable-quvi,
 	      AS_HELP_STRING([--enable-quvi],
 			     [Enable libquvi support (default is auto).]),
@@ -115,9 +116,11 @@ if test "x$enable_quvi" != "xno" ; then
 	fi
 	if test "x$have_quvi" = "xyes" ; then
 		pkg_modules="$pkg_modules libquvi"
+		QUVI="libquvi"
 		AC_DEFINE(HAVE_QUVI, 1, [libquvi available in the system])
 	fi
 fi
+AC_SUBST(QUVI, $QUVI)
 
 dnl Check for packages for building libtotem-plparser.la
 PKG_CHECK_MODULES(TOTEM_PLPARSER, [$pkg_modules])
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c
index 0a09966..29cb8b3 100644
--- a/plparse/totem-pl-parser-videosite.c
+++ b/plparse/totem-pl-parser-videosite.c
@@ -28,9 +28,9 @@
 #include "totem-disc.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
-#if HAVE_QUVI
+#ifdef HAVE_QUVI
 #include <quvi/quvi.h>
-#endif
+#endif /* HAVE_QUVI */
 
 #include "totem-pl-parser-mini.h"
 #include "totem-pl-parser-videosite.h"
@@ -39,6 +39,7 @@
 gboolean
 totem_pl_parser_is_videosite (const char *uri, gboolean debug)
 {
+#ifdef HAVE_QUVI
 	quvi_t handle;
 	QUVIcode rc;
 
@@ -53,6 +54,9 @@ totem_pl_parser_is_videosite (const char *uri, gboolean debug)
 			 uri, rc, (rc == QUVI_OK) ? "true" : "false");
 
 	return (rc == QUVI_OK);
+#else
+	return FALSE;
+#endif /* HAVE_QUVI */
 }
 
 #ifndef TOTEM_PL_PARSER_MINI
@@ -68,7 +72,7 @@ totem_pl_parser_add_videosite (TotemPlParser *parser,
 			       TotemPlParseData *parse_data,
 			       gpointer data)
 {
-#if HAVE_QUVI
+#ifdef HAVE_QUVI
 	QUVIcode rc;
 	quvi_t handle;
 	quvi_video_t v;
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index 67c4db4..106e819 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -153,10 +153,7 @@
 #include "totem-pl-parser-lines.h"
 #include "totem-pl-parser-misc.h"
 #include "totem-pl-parser-private.h"
-
-#ifdef HAVE_QUVI
 #include "totem-pl-parser-videosite.h"
-#endif
 
 #define READ_CHUNK_SIZE 8192
 #define RECURSE_LEVEL_MAX 4
@@ -1792,7 +1789,7 @@ totem_pl_parser_parse_internal (TotemPlParser *parser,
 	if (!parse_data->recurse && parse_data->recurse_level > 0)
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
 
-#if HAVE_QUVI
+#ifdef HAVE_QUVI
 	/* Should we try to parse it with quvi? */
 	if (g_file_has_uri_scheme (file, "http")) {
 		char *url;
diff --git a/totem-plparser-mini-uninstalled.pc.in b/totem-plparser-mini-uninstalled.pc.in
index 22a35f4..ae65f5d 100644
--- a/totem-plparser-mini-uninstalled.pc.in
+++ b/totem-plparser-mini-uninstalled.pc.in
@@ -9,6 +9,6 @@ Name: totem-plparser
 Description: Totem Playlist Parser library
 Version: @VERSION@
 Requires: glib-2.0 gobject-2.0 gio-2.0
-Requires.private: gthread-2.0
+Requires.private: gthread-2.0 @QUVI@
 Libs: ${pc_top_builddir}/${pcfiledir}/plparse/libtotem-plparser-mini.la
 Cflags: -I${pc_top_builddir}/${pcfiledir}/plparse
diff --git a/totem-plparser-mini.pc.in b/totem-plparser-mini.pc.in
index d0167db..23a1603 100644
--- a/totem-plparser-mini.pc.in
+++ b/totem-plparser-mini.pc.in
@@ -9,6 +9,6 @@ Name: totem-plparser-mini
 Description: Totem Playlist Parser library, mini version
 Version: @VERSION@
 Requires: glib-2.0 gobject-2.0 gio-2.0
-Requires.private: gthread-2.0
+Requires.private: gthread-2.0 @QUVI@
 Libs: -L${libdir} -ltotem-plparser-mini
 Cflags: -I${includedir}/totem-pl-parser/1/plparser
diff --git a/totem-plparser-uninstalled.pc.in b/totem-plparser-uninstalled.pc.in
index 984c1be..ebb0618 100644
--- a/totem-plparser-uninstalled.pc.in
+++ b/totem-plparser-uninstalled.pc.in
@@ -9,6 +9,6 @@ Name: totem-plparser
 Description: Totem Playlist Parser library
 Version: @VERSION@
 Requires: glib-2.0 gobject-2.0 gio-2.0
-Requires.private: gthread-2.0 libxml-2.0 @GMIME@
+Requires.private: gthread-2.0 libxml-2.0 @GMIME@ @QUVI@
 Libs: ${pc_top_builddir}/${pcfiledir}/plparse/libtotem-plparser.la
 Cflags: -I${pc_top_builddir}/${pcfiledir}/plparse
diff --git a/totem-plparser.pc.in b/totem-plparser.pc.in
index 8152b4c..bfec510 100644
--- a/totem-plparser.pc.in
+++ b/totem-plparser.pc.in
@@ -9,7 +9,7 @@ Name: totem-plparser
 Description: Totem Playlist Parser library
 Version: @VERSION@
 Requires: glib-2.0 gobject-2.0 gio-2.0
-Requires.private: gthread-2.0 libxml-2.0 @GMIME@
+Requires.private: gthread-2.0 libxml-2.0 @GMIME@ @QUVI@
 Libs: -L${libdir} -ltotem-plparser
 Cflags: -I${includedir}/totem-pl-parser/1/plparser
 uselibcamel= USEGMIME@



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