]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Add configure option to disable rrd_restore support
authorFloris Bos <bos@je-eigen-domein.nl>
Fri, 19 Sep 2014 15:49:58 +0000 (17:49 +0200)
committerFloris Bos <bos@je-eigen-domein.nl>
Fri, 19 Sep 2014 15:49:58 +0000 (17:49 +0200)
For systems that do not have libxml2 installed

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
configure.ac
src/Makefile.am
src/rrd_tool.c

index 53e03ce3681b8b99734f593b4fb65208d687fc82..b1def9ada9f16171067388d7c2de6bbca96891ea 100644 (file)
@@ -105,6 +105,9 @@ AC_ARG_ENABLE(rrdcgi,AS_HELP_STRING([--disable-rrdcgi],[disable building of rrdc
 AC_ARG_ENABLE(rrd_graph,AS_HELP_STRING([--disable-rrd_graph],[disable all rrd_graph functions]),
 [enable_rrdcgi=no],[enable_rrd_graph=yes])
 
+AC_ARG_ENABLE(rrd_restore,AS_HELP_STRING([--disable-rrd_restore],[disable rrd_restore XML import functions]),
+[],[enable_rrd_restore=yes])
+
 AM_CONDITIONAL(BUILD_RRDCGI,[test $enable_rrdcgi != no])
 
 
@@ -112,6 +115,10 @@ if test $enable_rrd_graph != no; then
  AC_DEFINE([HAVE_RRD_GRAPH], [], [is rrd_graph supported by this install])
 fi
 
+if test $enable_rrd_restore != no; then
+ AC_DEFINE([HAVE_RRD_RESTORE], [], [is rrd_restore supported by this install])
+fi
+
 dnl Check if we run on a system that has fonts
 AC_ARG_WITH(rrd-default-font,
 [  --with-rrd-default-font=[OPTIONS]  set the full path to your default font.],
@@ -533,6 +540,8 @@ AM_CONDITIONAL(BUILD_LIBWRAP,[test $have_libwrap != no])
 
 AM_CONDITIONAL(BUILD_RRDGRAPH,[test $enable_rrd_graph != no])
 
+AM_CONDITIONAL(BUILD_RRDRESTORE,[test $enable_rrd_restore != no])
+
 EX_CHECK_ALL(glib-2.0,   glib_check_version,            glib.h,                 glib-2.0,    2.28.7, ftp://ftp.gtk.org/pub/glib/2.28/, "")
 
 CORE_LIBS="$LIBS"
@@ -549,7 +558,10 @@ dnl EX_CHECK_ALL(cairo,      cairo_ps_surface_create,       cairo-ps.h,
 EX_CHECK_ALL(pangocairo-1.0,  pango_font_map_create_context,  pango/pango.h,  pangocairo,  1.28.4,    http://ftp.gnome.org/pub/GNOME/sources/pango/1.28, "")
 
 fi
+
+if test $enable_rrd_restore != no; then
 EX_CHECK_ALL(xml2,       xmlParseFile,                  libxml/parser.h,        libxml-2.0,        2.7.8,  http://xmlsoft.org/downloads.html, "")
+fi
 
 if test "$EX_CHECK_ALL_ERR" = "YES"; then
   AC_MSG_ERROR([Please fix the library issues listed above and try again.])
@@ -977,6 +989,7 @@ echo "          With MMAP IO: $enable_mmap"
 echo "          With Locking: $enable_flock"
 echo "      Build rrd_getopt: $build_getopt"
 echo "       Build rrd_graph: $enable_rrd_graph"
+echo "     Build rrd_restore: $enable_rrd_restore"
 echo "       Static programs: $staticprogs"
 echo "          Perl Modules: $COMP_PERL"
 echo "           Perl Binary: $PERL"
index 5bf3f327859a03055bb528eec76b286a3cc79ea6..408cb22119a0d8f2f682672e8a9b5b6457cac294 100644 (file)
@@ -44,7 +44,6 @@ RRD_C_FILES =         \
        rrd_last.c      \
        rrd_lastupdate.c        \
        rrd_first.c     \
-       rrd_restore.c   \
        rrd_dump.c      \
        rrd_flushcached.c \
        rrd_fetch.c     \
@@ -60,6 +59,10 @@ RRD_C_FILES += rrd_graph.c   \
        pngsize.c
 endif
 
+if BUILD_RRDRESTORE
+RRD_C_FILES += rrd_restore.c
+endif
+
 noinst_HEADERS = \
        unused.h \
         gettext.h \
index 018e4c547d4d156db5d8a19597d5cd0c5dd51ef3..d917fbdd406fb672c521ca000919ccc2ff8c76b4 100644 (file)
@@ -668,7 +668,11 @@ int HandleInputLine(
                "  Copyright by Tobi Oetiker, 1997-2008 (%f)\n",
                rrd_version());
     else if (strcmp("restore", argv[1]) == 0)
+#ifdef HAVE_RRD_RESTORE
         rrd_restore(argc - 1, &argv[1]);
+#else
+       rrd_set_error("the instance of rrdtool has been compiled without XML import functions");
+#endif
     else if (strcmp("resize", argv[1]) == 0)
         rrd_resize(argc - 1, &argv[1]);
     else if (strcmp("last", argv[1]) == 0)