only link build and use rrd_getopt if there is no getopt_long provided by
[rrdtool.git] / src / rrd_tool.h
index 8f0e3c3..131dcbb 100644 (file)
@@ -50,8 +50,12 @@ extern    "C" {
 #endif
 
 /* local include files -- need to be after the system ones */
 #endif
 
 /* local include files -- need to be after the system ones */
+#ifdef HAVE_GETOPT_LONG
+#define _GNU_SOURCE
+#include <getopt.h>
+#else
 #include "rrd_getopt.h"
 #include "rrd_getopt.h"
-#include "rrd_format.h"
+#endif
 
 #ifndef max
 #define max(a,b) ((a) > (b) ? (a) : (b))
 
 #ifndef max
 #define max(a,b) ((a) > (b) ? (a) : (b))