From b3e29926cef104c9ef99ff05ed1490cf821bb7b0 Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Tue, 21 Apr 2015 18:14:59 -0400 Subject: [PATCH] make.sh: Define a new build tag libdm_no_deferred_remove libdm started offering deferred remove functionality from version 1.02.89. As docker still builds against older libdm, define a tag libdm_no_deferred_remove to determine whether we are compiling against new libdm or older one and enable/disable deferred remove functionality accordingly. Signed-off-by: Vincent Batts Signed-off-by: Vivek Goyal --- hack/make.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hack/make.sh b/hack/make.sh index 3bcb265b3c..aa98ef128d 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -107,6 +107,15 @@ if \ DOCKER_BUILDTAGS+=' btrfs_noversion' fi +# test whether "libdevmapper.h" is new enough to support deferred remove +# functionality. +if \ + command -v gcc &> /dev/null \ + && ! ( echo -e '#include \nint main() { dm_task_deferred_remove(NULL); }'| gcc -ldevmapper -xc - &> /dev/null ) \ +; then + DOCKER_BUILDTAGS+=' libdm_no_deferred_remove' +fi + # Use these flags when compiling the tests and final binary IAMSTATIC='true'