]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
open-vm-tools: add --enable-valgrind configure option
authorOliver Kurth <okurth@vmware.com>
Tue, 17 Mar 2020 21:36:54 +0000 (14:36 -0700)
committerOliver Kurth <okurth@vmware.com>
Tue, 17 Mar 2020 21:36:54 +0000 (14:36 -0700)
Add the option "--enable-valgrind" to the ./configure command, and test
if the necessary headers are installed.

open-vm-tools/configure.ac

index 94babc7a27baad72d3dc66c2e39bbcc4718e0ed5..58f46a1e1789c5189e43fd48460da9f52b0eafc3 100644 (file)
@@ -1,5 +1,5 @@
 ################################################################################
-### Copyright (C) 2007-2019 VMware, Inc.  All rights reserved.
+### Copyright (C) 2007-2020 VMware, Inc.  All rights reserved.
 ###
 ### Configure script for building the VMware OSS Tools.
 ###
@@ -200,6 +200,26 @@ fi
 # and sets no_x.
 AC_PATH_XTRA
 
+AC_CHECK_HEADER([valgrind/valgrind.h],
+                [],
+                [have_valgrind=no],
+                [])
+
+AC_ARG_ENABLE(
+   valgrind,
+   AS_HELP_STRING(
+      [--enable-valgrind],
+      [enables building with valgrind]),
+   [enable_valgrind="$enableval"],
+   [enable_valgrind="no"])
+
+if test "$enable_valgrind" = "yes" ; then
+   if test "$have_valgrind" = "no" ; then
+      AC_MSG_ERROR([valgrind/valgrind.h not found. Make sure you have the valgrind headers installed.]),
+   fi
+   CPPFLAGS="$CPPFLAGS -DUSE_VALGRIND=1"
+fi
+
 # Arguments for disabling individual open-vm-tools features or libraries.
 AC_ARG_ENABLE(
    multimon,