1From cceee20e91af751469872b71155b23f0dec290a7 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 20 Jun 2019 14:11:16 +0800
4Subject: [PATCH] Add config option without-valgrind
5
6Upstream-Status: Pending
7
8Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
9
10Update patch to version 4.10.5
11Signed-off-by: Changqing Li <changqing.li@windriver.com>
12
13Rebase to 4.19.3
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15---
16 lib/replace/wscript | 5 +++--
17 wscript             | 7 +++++++
18 2 files changed, 10 insertions(+), 2 deletions(-)
19
20diff --git a/lib/replace/wscript b/lib/replace/wscript
21index 37d7759..9dd9b48 100644
22--- a/lib/replace/wscript
23+++ b/lib/replace/wscript
24@@ -113,8 +113,9 @@ def configure(conf):
25     conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
26     conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
27
28-    conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
29-    conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h valgrind/callgrind.h')
30+    if Options.options.enable_valgrind:
31+        conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
32+        conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h valgrind/callgrind.h')
33     conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
34     conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
35     conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
36diff --git a/wscript b/wscript
37index 95ddd9e..6d9577a 100644
38--- a/wscript
39+++ b/wscript
40@@ -123,6 +123,13 @@ def options(opt):
41                   help=('Disable kernely keyring support for credential storage'),
42                   action='store_false', dest='enable_keyring')
43
44+    opt.add_option('--with-valgrind',
45+                   help=("Enable use of valgrind"),
46+                   action="store_true", dest='enable_valgrind')
47+    opt.add_option('--without-valgrind',
48+                   help=("Disable use of valgrind"),
49+                   action="store_false", dest='enable_valgrind', default=False)
50+
51     gr = opt.option_group('developer options')
52
53     opt.load('python') # options for disabling pyc or pyo compilation
54--
552.25.1
56
57