summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-01-17 20:22:28 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-01-17 20:24:56 +0100
commit9ca75aa716c2441ae5359417f83ff10cd295abc1 (patch)
tree9d250ef4052eb0f3080a4a7931ea13584c4de7c2
parent7717134caf490d306b69a80d9be89c655f2dfc91 (diff)
downloadmupdf-9ca75aa716c2441ae5359417f83ff10cd295abc1.tar.xz
Automatically turn on PACIFY_VALGRIND for debug builds.
Add 'build=valgrind' configuration.
-rw-r--r--Makerules3
-rw-r--r--include/mupdf/fitz/system.h7
2 files changed, 10 insertions, 0 deletions
diff --git a/Makerules b/Makerules
index fa98685a..d75a6115 100644
--- a/Makerules
+++ b/Makerules
@@ -30,6 +30,9 @@ LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
else ifeq "$(build)" "small"
CFLAGS += -pipe -Os -DNDEBUG -fomit-frame-pointer
LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
+else ifeq "$(build)" "valgrind"
+CFLAGS += -pipe -O2 -DNDEBUG -DPACIFY_VALGRIND -fno-omit-frame-pointer
+LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
else ifeq "$(build)" "sanitize"
CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h
index 54e9c877..5d0341b4 100644
--- a/include/mupdf/fitz/system.h
+++ b/include/mupdf/fitz/system.h
@@ -14,6 +14,13 @@
#endif
#endif
+/* Turn on valgrind pacification in debug builds. */
+#ifndef NDEBUG
+#ifndef PACIFY_VALGRIND
+#define PACIFY_VALGRIND
+#endif
+#endif
+
/*
Include the standard libc headers.
*/