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 <vbatts@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
... | ... |
@@ -107,6 +107,15 @@ if \ |
107 | 107 |
DOCKER_BUILDTAGS+=' btrfs_noversion' |
108 | 108 |
fi |
109 | 109 |
|
110 |
+# test whether "libdevmapper.h" is new enough to support deferred remove |
|
111 |
+# functionality. |
|
112 |
+if \ |
|
113 |
+ command -v gcc &> /dev/null \ |
|
114 |
+ && ! ( echo -e '#include <libdevmapper.h>\nint main() { dm_task_deferred_remove(NULL); }'| gcc -ldevmapper -xc - &> /dev/null ) \ |
|
115 |
+; then |
|
116 |
+ DOCKER_BUILDTAGS+=' libdm_no_deferred_remove' |
|
117 |
+fi |
|
118 |
+ |
|
110 | 119 |
# Use these flags when compiling the tests and final binary |
111 | 120 |
|
112 | 121 |
IAMSTATIC='true' |