Added configure option to disable building rrd_graph: --disable-rrd_graph. With suppo...
[rrdtool.git] / src / rrd_tool.c
index cc2aede..bb1bc3e 100644 (file)
@@ -695,6 +695,7 @@ int HandleInputLine(
             free(data);
         }
     } else if (strcmp("xport", argv[1]) == 0) {
             free(data);
         }
     } else if (strcmp("xport", argv[1]) == 0) {
+#ifdef HAVE_RRD_GRAPH
         int       xxsize;
         unsigned long int j = 0;
         time_t    start, end, ti;
         int       xxsize;
         unsigned long int j = 0;
         time_t    start, end, ti;
@@ -771,7 +772,11 @@ int HandleInputLine(
             setlocale(LC_NUMERIC, old_locale);
         }
         free(vtag);
             setlocale(LC_NUMERIC, old_locale);
         }
         free(vtag);
+#else
+        rrd_set_error("the instance of rrdtool has been compiled without graphics");
+#endif
     } else if (strcmp("graph", argv[1]) == 0) {
     } else if (strcmp("graph", argv[1]) == 0) {
+#ifdef HAVE_RRD_GRAPH
         char    **calcpr;
 
 #ifdef notused /*XXX*/
         char    **calcpr;
 
 #ifdef notused /*XXX*/
@@ -805,7 +810,11 @@ int HandleInputLine(
             }
         }
 
             }
         }
 
+#else
+       rrd_set_error("the instance of rrdtool has been compiled without graphics");
+#endif
     } else if (strcmp("graphv", argv[1]) == 0) {
     } else if (strcmp("graphv", argv[1]) == 0) {
+#ifdef HAVE_RRD_GRAPH
         rrd_info_t *grinfo = NULL;  /* 1 to distinguish it from the NULL that rrd_graph sends in */
 
         grinfo = rrd_graph_v(argc - 1, &argv[1]);
         rrd_info_t *grinfo = NULL;  /* 1 to distinguish it from the NULL that rrd_graph sends in */
 
         grinfo = rrd_graph_v(argc - 1, &argv[1]);
@@ -813,7 +822,9 @@ int HandleInputLine(
             rrd_info_print(grinfo);
             rrd_info_free(grinfo);
         }
             rrd_info_print(grinfo);
             rrd_info_free(grinfo);
         }
-
+#else
+       rrd_set_error("the instance of rrdtool has been compiled without graphics");
+#endif
     } else if (strcmp("tune", argv[1]) == 0)
         rrd_tune(argc - 1, &argv[1]);
 #ifndef WIN32
     } else if (strcmp("tune", argv[1]) == 0)
         rrd_tune(argc - 1, &argv[1]);
 #ifndef WIN32