Index: configure.ac
===================================================================
RCS file: /cvs/gstreamer/gstreamer/configure.ac,v
retrieving revision 1.495
diff -u -p -r1.495 configure.ac
--- configure.ac	12 Feb 2007 19:55:23 -0000	1.495
+++ configure.ac	27 Feb 2007 20:17:02 -0000
@@ -208,6 +208,7 @@ if test "x$USE_BINARY_REGISTRY" = xyes; 
     [Define if we should use binary registry instead xml registry])
 fi
 
+
 dnl *** checks for platform ***
 
 dnl * hardware/architecture *
@@ -402,15 +403,37 @@ AC_SUBST(GLIB_PREFIX)
 
 dnl libxml 2, which is/should be optional (FIXME)
 dnl (FIXME) if we use binary registry, the DISABLE_REGISTRY check need to go
-if test "x$GST_DISABLE_LOADSAVE" = "xyes" && \
-   test "x$GST_DISABLE_REGISTRY" = "xyes"
+XML_DEP="yes"
+if (test "x$GST_DISABLE_LOADSAVE" = "xyes" && \
+   (test "x$GST_DISABLE_REGISTRY" = "xyes" || 
+    test "x$USE_BINARY_REGISTRY" = "xyes"))
 then
+  XML_DEP="no"
   AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
 else
   dnl check for libxml2 with minimum req version
   GST_LIBXML2_CHECK(2.4.9)
 fi
 
+dnl have a automake variable when xml is totally disabled
+AM_CONDITIONAL(GST_NO_XML, test "x$XML_DEP" = "xno")
+AM_CONDITIONAL(GST_XML_REGISTRY, test "x$XML_DEP" = "xyes" && test "x$GST_DISABLE_REGISTRY" = "xno")
+AM_CONDITIONAL(GST_BIN_REGISTRY, test "x$XML_DEP" = "xno" && test "x$GST_DISABLE_REGISTRY" = "xno")
+
+dnl FIXME: GST_DISABLE_LOADSAVE_REGISTRY : should be renamed to GST_DISABLE_XML
+if test "x$XML_DEP" = "xno"
+then
+EXT_XML_INCLUDE=
+GST_XML_OPT="#define GST_DISABLE_LOADSAVE_REGISTRY"
+else
+EXT_XML_INCLUDE="#include <libxml/parser.h>"
+GST_XML_OPT=
+fi
+
+AC_SUBST(EXT_XML_INCLUDE)
+AC_SUBST(GST_XML_OPT)
+
+
 dnl check for "check", unit testing library/header
 AM_PATH_CHECK(0.9.2,
     [
@@ -480,7 +503,12 @@ dnl - src and build dirs need to be adde
 dnl   will need the GStreamer source and generated headers
 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
 dnl       from LibXML except for in the core library
+if test "x$XML_DEP" = "xno"; then
+GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir) $GLIB_CFLAGS \$(GST_OPTION_CFLAGS)"
+else
 GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir) $GLIB_CFLAGS $XML_CFLAGS \$(GST_OPTION_CFLAGS)"
+fi
+
 dnl FIXME: check if LTLIBINTL is needed everywhere
 dnl I presume it is given that it contains the symbols that _() stuff maps to
 GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL \$(GCOV_LIBS)"
Index: gst/Makefile.am
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/Makefile.am,v
retrieving revision 1.220
diff -u -p -r1.220 Makefile.am
--- gst/Makefile.am	11 Jan 2007 13:45:51 -0000	1.220
+++ gst/Makefile.am	27 Feb 2007 20:17:03 -0000
@@ -6,10 +6,14 @@ else
 GST_LOADSAVE_SRC = gstxml.c
 endif
 
-if GST_DISABLE_REGISTRY
-GST_REGISTRY_SRC = 
+if GST_XML_REGISTRY
+ GST_REGISTRY_SRC = gstregistryxml.c
 else
-GST_REGISTRY_SRC = gstregistryxml.c gstregistrybinary.c
+ GST_REGISTRY_SRC = gstregistrybinary.c
+endif
+
+if GST_DISABLE_REGISTRY
+GST_REGISTRY_SRC =
 endif
 
 if GST_DISABLE_PARSE
@@ -66,7 +70,7 @@ built_header_make = gstenumtypes.h gstma
 built_source_make = $(GST_ENUMTYPES_SRC) gstmarshal.c
 
 EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
-	gstmarshal.list gstxml.c gstparse.c gsttrace.c gstregistryxml.c
+	gstmarshal.list gstparse.c gsttrace.c $(GST_LOADSAVE_SRC) $(GST_REGISTRY_SRC)
 
 
 # temporarily not used
@@ -139,10 +143,16 @@ libgstreamer_@GST_MAJORMINOR@_la_CFLAGS 
 	$(VALGRIND_CFLAGS)				\
 	$(GST_ALL_CFLAGS)
 
+if GST_NO_XML
+libgstreamer_@GST_MAJORMINOR@_la_LIBADD =              \
+       $(GST_PARSE_LA)                                 \
+       $(GST_ALL_LIBS)
+else
 libgstreamer_@GST_MAJORMINOR@_la_LIBADD =		\
 	$(GST_PARSE_LA)					\
 	$(GST_ALL_LIBS)					\
 	$(XML_LIBS)
+endif
 
 libgstreamer_@GST_MAJORMINOR@_la_LDFLAGS =		\
 	$(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
Index: gst/gstconfig.h.in
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstconfig.h.in,v
retrieving revision 1.23
diff -u -p -r1.23 gstconfig.h.in
--- gst/gstconfig.h.in	5 Jan 2007 13:23:02 -0000	1.23
+++ gst/gstconfig.h.in	27 Feb 2007 20:17:04 -0000
@@ -168,12 +168,9 @@
 @GST_HAVE_GLIB_2_8_DEFINE@
 
 /***** Deal with XML stuff, we have to handle both loadsave and registry *****/
+@GST_XML_OPT@
 
-#if (! (defined(GST_DISABLE_LOADSAVE) && defined(GST_DISABLE_REGISTRY)) )
-# include <libxml/parser.h>
-#else
-# define GST_DISABLE_LOADSAVE_REGISTRY
-#endif
+@EXT_XML_INCLUDE@
 
 /**
  * GST_EXPORT:
