summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2019-12-14 12:15:36 +0000
committerdormando <dormando@rydia.net>2022-08-25 20:31:23 -0700
commit2d5dd8d9e12daccaa303601725d742612ec3a8eb (patch)
tree53f0c2398d8e7bb2d9dc01989eb244d653d9b530
parentfd6b5bee6140ec7bdb830d330f56283acedd9a20 (diff)
downloadmemcached-2d5dd8d9e12daccaa303601725d742612ec3a8eb.tar.gz
DTrace build fix on Mac
The header generated comes with $ IDs thus breaking the build. The probes are set with const address arguments already which just add the qualifier again.
-rw-r--r--Makefile.am10
-rw-r--r--configure.ac14
2 files changed, 22 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index f34cad5..049ba5f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -112,11 +112,17 @@ endif
memcached_debug_CFLAGS += -DMEMCACHED_DEBUG
+# build fails on Darwin with const signature replacements.
+if DARWIN
memcached_dtrace.h: memcached_dtrace.d
${DTRACE} -h -s memcached_dtrace.d
- sed -e 's,void \*,const void \*,g' memcached_dtrace.h | \
- sed -e 's,char \*,const char \*,g' | tr '\t' ' ' > mmc_dtrace.tmp
+else
+memcached_dtrace.h: memcached_dtrace.d
+ ${DTRACE} -h -s memcached_dtrace.d
+ sed -e 's,void \*,const void \*,' memcached_dtrace.h | \
+ sed -e 's,char \*,const char \*,g' | tr '\t' ' ' > mmc_dtrace.tmp
mv mmc_dtrace.tmp memcached_dtrace.h
+endif
memcached_dtrace.o: $(memcached_OBJECTS)
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_dtrace.o -s ${srcdir}/memcached_dtrace.d $(memcached_OBJECTS)
diff --git a/configure.ac b/configure.ac
index 2959a86..34a457b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,6 +9,16 @@ AM_CONFIG_HEADER([config.h])
AC_PROG_CC
+is_darwin=no
+
+case "${host_os}" in
+ darwin*)
+ is_darwin=yes
+ ;;
+esac
+
+AM_CONDITIONAL([DARWIN], [test "$is_darwin" = "yes"])
+
dnl **********************************************************************
dnl DETECT_ICC ([ACTION-IF-YES], [ACTION-IF-NO])
dnl
@@ -193,6 +203,10 @@ if test "x$enable_dtrace" = "xyes"; then
then
dtrace_instrument_obj=yes
rm conftest.h
+ # on Mac probe id are generated with $
+ if test "$is_darwin" = "yes"; then
+ CFLAGS="$CFLAGS -Wno-dollar-in-identifier-extension"
+ fi
fi
if test "`which tr`" = "/usr/ucb/tr"; then