summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2008-05-25 11:27:27 +0000
committerteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2008-05-25 11:27:27 +0000
commitf87f1088d0eae00af511b0eb0e847138a971562c (patch)
tree6c752611a92bdaedea944deefe8ab7479b4feb2f
parent0a1e067fb5f0a751a5620ced510c91411670ee75 (diff)
downloadlibgpod-f87f1088d0eae00af511b0eb0e847138a971562c.tar.gz
libgpod-f87f1088d0eae00af511b0eb0e847138a971562c.tar.xz
libgpod-f87f1088d0eae00af511b0eb0e847138a971562c.zip
* 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 git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1982 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac40
-rw-r--r--src/Makefile.am4
-rw-r--r--src/itdb_plist.c21
-rw-r--r--src/itdb_sysinfo_extended_parser.c3
5 files changed, 67 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 48bffa0..92ed3a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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:
diff --git a/configure.ac b/configure.ac
index e1d7171..418acac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -131,19 +131,29 @@ AM_CONDITIONAL(HAVE_TAGLIB, test x"$have_taglib" = xyes)
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 @@ Configuration for $PACKAGE $VERSION :
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 @@ Configuration for $PACKAGE $VERSION :
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
diff --git a/src/Makefile.am b/src/Makefile.am
index f5b65a0..89851f9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,8 +40,8 @@ noinst_HEADERS = \
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)
diff --git a/src/itdb_plist.c b/src/itdb_plist.c
index bb6d89d..b5ee5b8 100644
--- a/src/itdb_plist.c
+++ b/src/itdb_plist.c
@@ -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 @@ itdb_plist_parse_from_memory (const char *data, gsize len)
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
diff --git a/src/itdb_sysinfo_extended_parser.c b/src/itdb_sysinfo_extended_parser.c
index 84af19d..ce4c0c9 100644
--- a/src/itdb_sysinfo_extended_parser.c
+++ b/src/itdb_sysinfo_extended_parser.c
@@ -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"