summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Norbye <Trond.Norbye@sun.com>2009-03-04 16:36:08 +0100
committerDustin Sallings <dustin@spy.net>2009-03-04 13:49:43 -0800
commit7c23e79f975e52a348937cf7ad7e238cc72aa1da (patch)
tree69d5b6d9b3c76b8b1402a8bc57332367f94a2215
parentbdd7b8b2acbc07092d957e20ec7292a0335e0312 (diff)
downloadmemcached-7c23e79f975e52a348937cf7ad7e238cc72aa1da.tar.gz
Modified the dtrace build support
-rw-r--r--Makefile.am26
-rw-r--r--configure.ac14
2 files changed, 27 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am
index cb90569..79e960d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
bin_PROGRAMS = memcached memcached-debug
pkginclude_HEADERS = protocol_binary.h
-BUILT_SOURCES= @DTRACE_HEADER@
+BUILT_SOURCES=
memcached_SOURCES = memcached.c memcached.h \
hash.c hash.h \
@@ -18,12 +18,27 @@ endif
memcached_debug_SOURCES = $(memcached_SOURCES)
memcached_CPPFLAGS = -DNDEBUG
-memcached_LDADD = @DTRACE_OBJ@
-memcached_debug_LDADD = @DTRACE_DEBUG_OBJ@ @PROFILER_LDFLAGS@
-memcached_DEPENDENCIES = @DTRACE_OBJ@
-memcached_debug_DEPENDENCIES = @DTRACE_DEBUG_OBJ@
+memcached_debug_LDADD = @PROFILER_LDFLAGS@
memcached_debug_CFLAGS = @PROFILER_FLAGS@
+memcached_LDADD =
+memcached_DEPENDENCIES =
+memcached_debug_DEPENDENCIES =
+CLEANFILES=
+
+if BUILD_DTRACE
+BUILT_SOURCES += memcached_dtrace.h
+CLEANFILES += memcached_dtrace.h
+endif
+
+if DTRACE_INSTRUMENT_OBJ
+memcached_LDADD += memcached_dtrace.o
+memcached_DEPENDENCIES += memcached_dtrace.o
+memcached_debug_LDADD += memcached_debug_dtrace.o
+memcached_debug_DEPENDENCIES += memcached_debug_dtrace.o
+CLEANFILES += memcached_dtrace.o memcached_debug_dtrace.o
+endif
+
memcached_dtrace.h: memcached_dtrace.d
${DTRACE} -h -s memcached_dtrace.d
sed -e 's,void \*,const void \*,g' memcached_dtrace.h | \
@@ -36,6 +51,7 @@ memcached_dtrace.o: $(memcached_OBJECTS)
memcached_debug_dtrace.o: $(memcached_debug_OBJECTS)
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_debug_dtrace.o -s ${srcdir}/memcached_dtrace.d $(memcached_debug_OBJECTS)
+
SUBDIRS = doc
DIST_DIRS = scripts
EXTRA_DIST = doc scripts TODO t memcached.spec memcached_dtrace.d
diff --git a/configure.ac b/configure.ac
index 1e1c495..9c9991a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,25 +44,23 @@ if test "x$enable_dtrace" == "xyes"; then
AC_PATH_PROG([DTRACE], [dtrace], "no", [/usr/sbin:$PATH])
if test "x$DTRACE" != "xno"; then
AC_DEFINE([ENABLE_DTRACE],1,[Set to nonzero if you want to include DTRACE])
- DTRACE_HEADER=memcached_dtrace.h
-
+ build_dtrace=yes
# DTrace on MacOSX does not use -G option
$DTRACE -G -o conftest.$$ -s memcached_dtrace.d 2>/dev/zero
if test $? -eq 0
then
- DTRACE_OBJ=memcached_dtrace.o
- DTRACE_DEBUG_OBJ=memcached_debug_dtrace.o
+ dtrace_instrument_obj=yes
rm conftest.$$
- fi
+ fi
else
AC_MSG_ERROR([Need dtrace binary and OS support.])
fi
fi
+AM_CONDITIONAL([BUILD_DTRACE],[test "$build_dtrace" = "yes"])
+AM_CONDITIONAL([DTRACE_INSTRUMENT_OBJ],[test "$dtrace_instrument_obj" = "yes"])
+
AC_SUBST(DTRACE)
-AC_SUBST(DTRACE_HEADER)
-AC_SUBST(DTRACE_OBJ)
-AC_SUBST(DTRACE_DEBUG_OBJ)
AC_SUBST(DTRACEFLAGS)
AC_SUBST(PROFILER_LDFLAGS)