Drop libxml2 dependency when building with
authorStefan Kost <ensonic@users.sourceforge.net>
Tue, 17 Apr 2007 10:46:46 +0000 (10:46 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Tue, 17 Apr 2007 10:46:46 +0000 (10:46 +0000)
Original commit message from CVS:
* configure.ac:
* gst/Makefile.am:
* gst/gstconfig.h.in:
Drop libxml2 dependency when building with
--enable-binary-registry --disable-loadsave

ChangeLog
configure.ac
gst/Makefile.am
gst/gstconfig.h.in

index faf31d6..ea3df7d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-04-17  Stefan Kost  <ensonic@users.sf.net>
+
+       * configure.ac:
+       * gst/Makefile.am:
+       * gst/gstconfig.h.in:
+         Drop libxml2 dependency when building with 
+         --enable-binary-registry --disable-loadsave
+
 2007-04-16  Tim-Philipp Müller  <tim at centricular dot net>
 
        * gst/gstregistrybinary.c: (gst_registry_binary_write_cache),
index f4cc5da..2803123 100644 (file)
@@ -136,7 +136,7 @@ AC_ARG_WITH(cachedir,
       no)  AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
       *)   GST_CACHE_DIR="${withval}" ;;
     esac
-  ], 
+  ],
   [:]) dnl Default value
 
 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
@@ -152,7 +152,7 @@ AC_ARG_ENABLE(tests,
       no)  BUILD_TESTS=no ;;
       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
     esac
-  ], 
+  ],
 [BUILD_TESTS=yes]) dnl Default value
 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
 
@@ -166,7 +166,7 @@ AC_ARG_ENABLE(failing-tests,
       no)  BUILD_FAILING_TESTS=no ;;
       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
     esac
-  ], 
+  ],
   [BUILD_FAILING_TESTS=no]) dnl Default value
 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
 if test x$BUILD_FAILING_TESTS = xyes; then
@@ -185,7 +185,7 @@ AC_ARG_ENABLE(poisoning,
       no)  USE_POISONING=no ;;
       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-poisoning) ;;
     esac
-  ], 
+  ],
   [USE_POISONING=no]) dnl Default value
 if test "x$USE_POISONING" = xyes; then
   AC_DEFINE(USE_POISONING, 1,
@@ -202,12 +202,13 @@ AC_ARG_ENABLE(binary-registry,
       no)  USE_BINARY_REGISTRY=no ;;
       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-binary-registry) ;;
     esac
-  ], 
+  ],
   [USE_BINARY_REGISTRY=no]) dnl Default value
 if test "x$USE_BINARY_REGISTRY" = xyes; then
   AC_DEFINE(USE_BINARY_REGISTRY, 1,
     [Define if we should use binary registry instead xml registry])
 fi
+AM_CONDITIONAL(USE_BINARY_REGISTRY, test "x$USE_BINARY_REGISTRY" = "xyes")
 
 dnl *** checks for platform ***
 
@@ -404,7 +405,8 @@ 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"
+   ( test "x$GST_DISABLE_REGISTRY" = "xyes" || \
+   test "x$USE_BINARY_REGISTRY" = "xyes" )
 then
   AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
 else
index aabd965..d5ba55d 100644 (file)
@@ -9,7 +9,11 @@ endif
 if GST_DISABLE_REGISTRY
 GST_REGISTRY_SRC = 
 else
-GST_REGISTRY_SRC = gstregistryxml.c gstregistrybinary.c
+if USE_BINARY_REGISTRY
+GST_REGISTRY_SRC = gstregistrybinary.c
+else
+GST_REGISTRY_SRC = gstregistryxml.c
+endif
 endif
 
 if GST_DISABLE_PARSE
index a465d42..ee1c952 100644 (file)
@@ -50,6 +50,8 @@
 #ifndef __GST_CONFIG_H__
 #define __GST_CONFIG_H__
 
+#include "config.h"
+
 /* trick gtk-doc into believing these symbols are defined (yes, it's ugly) */
 
 #if 0
 
 /***** Deal with XML stuff, we have to handle both loadsave and registry *****/
 
-#if (! (defined(GST_DISABLE_LOADSAVE) && defined(GST_DISABLE_REGISTRY)) )
+/*#if (! (defined(GST_DISABLE_LOADSAVE) && defined(GST_DISABLE_REGISTRY)) ) */
+/* this works better, but requires the above config.h include, its a bit strange
+ * that we include stuff here anyway */
+#ifdef HAVE_LIBXML2
 # include <libxml/parser.h>
 #else
 # define GST_DISABLE_LOADSAVE_REGISTRY