Revision: 1982
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1982&view=rev
Author:   teuf
Date:     2008-05-25 04:27:27 -0700 (Sun, 25 May 2008)

Log Message:
-----------
* configure.ac: rework libxml detection
* src/Makefile.am: remove LIBXML_CFLAGS/LIBXML_LIBS since they are
no longer used
* src/itdb_plist.c: add stub functions when libxml isn't available
* src/itdb_sysinfo_extended_parser.c: include config.h

Modified Paths:
--------------
    libgpod/trunk/ChangeLog
    libgpod/trunk/configure.ac
    libgpod/trunk/src/Makefile.am
    libgpod/trunk/src/itdb_plist.c
    libgpod/trunk/src/itdb_sysinfo_extended_parser.c

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2008-05-25 10:46:13 UTC (rev 1981)
+++ libgpod/trunk/ChangeLog     2008-05-25 11:27:27 UTC (rev 1982)
@@ -1,5 +1,13 @@
 2008-05-25  Christophe Fergeau <teuf at gnome.org>
 
+       * configure.ac: rework libxml detection
+       * src/Makefile.am: remove LIBXML_CFLAGS/LIBXML_LIBS since they are
+       no longer used
+       * src/itdb_plist.c: add stub functions when libxml isn't available
+       * src/itdb_sysinfo_extended_parser.c: include config.h
+
+2008-05-25  Christophe Fergeau <teuf at gnome.org>
+
        * src/db-artwork-debug.c:
        * src/db-artwork-writer.c:
        * src/db-image-parser.c:

Modified: libgpod/trunk/configure.ac
===================================================================
--- libgpod/trunk/configure.ac  2008-05-25 10:46:13 UTC (rev 1981)
+++ libgpod/trunk/configure.ac  2008-05-25 11:27:27 UTC (rev 1982)
@@ -131,19 +131,29 @@
 dnl **************************************************
 dnl * libxml is used to parse the plist files (aka SysInfoExtended)
 dnl **************************************************
-PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=yes, have_libxml=no)
+AC_ARG_ENABLE(libxml, [AC_HELP_STRING([--disable-libxml],[SysInfoExtended 
won't be parsed])], 
+[case "${enableval}" in
+  no) enable_libxml=no ;;
+  *) enable_libxml=yes;;
+esac])
+AH_TEMPLATE([HAVE_LIBXML], [Whether libxml is installed, it's used to parse 
SysInfoExtended])
+if test x$enable_libxml != xno; then
+   PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=yes, have_libxml=no)
+   if test x"$enable_libxml" = xyes -a x"$have_libxml" = xno; then
+      AC_MSG_ERROR([libxml support explicitly requested but libxml couldn't be 
found])
+   fi
+fi
 if test x"$have_libxml" = xyes; then
-   AH_TEMPLATE([HAVE_LIBXML], [Whether libxml is installed, it's only used in 
a test program])
    AC_DEFINE_UNQUOTED(HAVE_LIBXML, 1)
+   LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS $LIBXML_CFLAGS"
+   LIBGPOD_LIBS="$LIBGPOD_LIBS $LIBXML_LIBS"
+else
+   have_libxml=no
 fi
-AC_SUBST(LIBXML_CFLAGS)
-AC_SUBST(LIBXML_LIBS)
-AM_CONDITIONAL(HAVE_LIBXML, test x"$have_libxml" = xyes)
 
 dnl **************************************************
 dnl * GDKPIXBUF is optional
 dnl **************************************************
-
 AC_ARG_ENABLE(gdk-pixbuf, [AC_HELP_STRING([--disable-gdk-pixbuf],[ArtworkDB 
will be disabled without gdk-pixbuf])], 
 [case "${enableval}" in
   no) enable_gdkpixbuf=no ;;
@@ -295,7 +305,8 @@
  Preprocessor .........: $CC $CPPFLAGS
  Compiler .............: $CC $CFLAGS $LIBGPOD_CFLAGS
  Linker ...............: $CC $LDFLAGS $LIBS $LIBGPOD_LIBS
- ArtworkDB support ....: $have_gdkpixbuf
+ Artwork support ......: $have_gdkpixbuf
+ libxml support .......: $have_libxml
  Python bindings ......: $with_python
  PyGObject support ....: $have_pygobject
 
@@ -303,3 +314,18 @@
  and then 'make install' for installation.
 "
 
+if test x"$have_libxml" = xno; then
+        echo "
+**WARNING** libxml support is disabled, libgpod won't be able to 
+parse SysInfoExtended. This means it can't take advantage of the 
+extensive iPod description (image formats, features, ...) 
+available from that file
+"
+fi
+
+if test x"$have_gdkpixbuf" = xno; then
+        echo "
+**WARNING** gdkpixbuf support is disabled. libgpod won't be able
+to read or write artwork (covers, photos, ...) from/to the iPod
+"
+fi

Modified: libgpod/trunk/src/Makefile.am
===================================================================
--- libgpod/trunk/src/Makefile.am       2008-05-25 10:46:13 UTC (rev 1981)
+++ libgpod/trunk/src/Makefile.am       2008-05-25 11:27:27 UTC (rev 1982)
@@ -40,8 +40,8 @@
        pixmaps.h               \
        sha1.h
 
-INCLUDES=$(LIBGPOD_CFLAGS) $(LIBXML_CFLAGS)
-LIBS=$(LIBGPOD_LIBS) $(LIBXML_LIBS)
+INCLUDES=$(LIBGPOD_CFLAGS)
+LIBS=$(LIBGPOD_LIBS)
 
 uninstall-hook:
        -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libgpodincludedir)

Modified: libgpod/trunk/src/itdb_plist.c
===================================================================
--- libgpod/trunk/src/itdb_plist.c      2008-05-25 10:46:13 UTC (rev 1981)
+++ libgpod/trunk/src/itdb_plist.c      2008-05-25 11:27:27 UTC (rev 1982)
@@ -45,6 +45,12 @@
  *      - <array> => G_TYPE_HASH_TABLE (GHashTable *)
  *      - <dict> => G_TYPE_HASH_TABLE (GHashTable *)
  */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_LIBXML
+
 #include <stdio.h>
 #include <string.h>
 #include <libxml/parser.h>
@@ -324,3 +330,18 @@
 
     return parsed_doc;
 }
+#else 
+#include <glib-object.h>
+#include "itdb_plist.h"
+
+GValue *itdb_plist_parse_from_file (G_GNUC_UNUSED const char *filename)
+{
+    return NULL;
+}
+
+GValue *itdb_plist_parse_from_memory (G_GNUC_UNUSED const char *data, 
+                                      G_GNUC_UNUSED gsize len)
+{
+    return NULL;
+}
+#endif

Modified: libgpod/trunk/src/itdb_sysinfo_extended_parser.c
===================================================================
--- libgpod/trunk/src/itdb_sysinfo_extended_parser.c    2008-05-25 10:46:13 UTC 
(rev 1981)
+++ libgpod/trunk/src/itdb_sysinfo_extended_parser.c    2008-05-25 11:27:27 UTC 
(rev 1982)
@@ -49,6 +49,9 @@
  * normal to get a few unhandled fields, I left out on purpose a few <dict> 
  * because I was too lazy to parse them ;)
  */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <glib-object.h>
 #include "itdb_sysinfo_extended_parser.h"
 #include "itdb_plist.h"


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to