[sheepdog] [PATCH 2/2] configure: use HAVE_TRACE macro

Liu Yuan namei.unix at gmail.com
Tue Jul 2 09:22:27 CEST 2013


Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 collie/collie.h     |    5 +++--
 configure.ac        |    2 +-
 sheep/trace/trace.h |    5 +++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/collie/collie.h b/collie/collie.h
index 18b9c08..ea60a61 100644
--- a/collie/collie.h
+++ b/collie/collie.h
@@ -23,6 +23,7 @@
 #include "option.h"
 #include "work.h"
 #include "event.h"
+#include "config.h"
 
 #define SUBCMD_FLAG_NEED_NODELIST (1 << 0)
 #define SUBCMD_FLAG_NEED_ARG (1 << 1)
@@ -87,10 +88,10 @@ extern struct command vdi_command;
 extern struct command node_command;
 extern struct command cluster_command;
 
-#ifdef ENABLE_TRACE
+#ifdef HAVE_TRACE
   extern struct command debug_command;
 #else
   #define debug_command {}
-#endif /* ENABLE_TRACE */
+#endif /* HAVE_TRACE */
 
 #endif
diff --git a/configure.ac b/configure.ac
index 1ec81e1..9af3af2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -360,7 +360,7 @@ if test "x${enable_trace}" = xyes && \
 		cc_supports_flag -pg && \
 		cc_supports_flag -gstabs ; then
 	AC_MSG_NOTICE([Enabling trace (-pg -gstabs)])
-	TRACE_CFLAGS="-pg -gstabs -DENABLE_TRACE"
+	TRACE_CFLAGS="-pg -gstabs"
 	TRACE_LDFLAGS="-T$(pwd)/sheep/trace/trace.ld"
 	PACKAGE_FEATURES="$PACKAGE_FEATURES trace"
 else
diff --git a/sheep/trace/trace.h b/sheep/trace/trace.h
index 2a920a5..8437140 100644
--- a/sheep/trace/trace.h
+++ b/sheep/trace/trace.h
@@ -10,6 +10,7 @@
 #include "sheep.h"
 #include "list.h"
 #include "util.h"
+#include "config.h"
 
 struct ipinfo {
 	const char *file;           /* Source code filename for EIP */
@@ -48,7 +49,7 @@ void trace_return_caller(void);
 unsigned long trace_return_call(void);
 
 /* trace.c */
-#ifdef ENABLE_TRACE
+#ifdef HAVE_TRACE
   int trace_init_signal(void);
   int trace_init(void);
   int register_trace_function(trace_func_t func);
@@ -71,7 +72,7 @@ unsigned long trace_return_call(void);
   static inline void trace_register_thread(pthread_t id) { return; }
   static inline void trace_unregister_thread(pthread_t id) { return; }
 
-#endif /* ENABLE_TRACE */
+#endif /* HAVE_TRACE */
 
 #define register_tracer(new)			\
 static void __attribute__((constructor))	\
-- 
1.7.9.5




More information about the sheepdog mailing list