From 3761955e8c1e7534026c469186c3f66c18e77cbc Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 3 Apr 2015 01:30:12 -0600 Subject: [PATCH] Change the btrfs_noversion check to be automatic Signed-off-by: Andrew "Tianon" Page --- Dockerfile | 2 +- hack/make.sh | 8 ++++++++ project/PACKAGERS.md | 9 +-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c6e0b5bf0..b54fda5614 100644 --- a/Dockerfile +++ b/Dockerfile @@ -138,7 +138,7 @@ RUN useradd --create-home --gid docker unprivilegeduser VOLUME /var/lib/docker WORKDIR /go/src/github.com/docker/docker -ENV DOCKER_BUILDTAGS apparmor selinux btrfs_noversion +ENV DOCKER_BUILDTAGS apparmor selinux # Let us use a .bashrc file RUN ln -sfv $PWD/.bashrc ~/.bashrc diff --git a/hack/make.sh b/hack/make.sh index 118d4327f5..4117469d66 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -98,6 +98,14 @@ if [ "$DOCKER_EXECDRIVER" = 'lxc' ]; then DOCKER_BUILDTAGS+=' test_no_exec' fi +# test whether "btrfs/version.h" exists and apply btrfs_noversion appropriately +if \ + command -v gcc &> /dev/null \ + && ! gcc -E - &> /dev/null <<<'#include ' \ +; then + DOCKER_BUILDTAGS+=' btrfs_noversion' +fi + # Use these flags when compiling the tests and final binary IAMSTATIC='true' diff --git a/project/PACKAGERS.md b/project/PACKAGERS.md index 701e552d59..5704b0a2b2 100644 --- a/project/PACKAGERS.md +++ b/project/PACKAGERS.md @@ -58,8 +58,7 @@ To build the Docker daemon, you will additionally need: * libdevmapper version 1.02.68-cvs (2012-01-26) or later from lvm2 version 2.02.89 or later * btrfs-progs version 3.16.1 or later (unless using an older version is - absolutely necessary, in which case 3.8 is the minimum and the note below - regarding `btrfs_noversion` applies) + absolutely necessary, in which case 3.8 is the minimum) Be sure to also check out Docker's Dockerfile for the most up-to-date list of these build-time dependencies. @@ -163,12 +162,6 @@ SELinux, you will need to use the `selinux` build tag: export DOCKER_BUILDTAGS='selinux' ``` -If your version of btrfs-progs (also called btrfs-tools) is < 3.16.1, then you -will need the following tag to not check for btrfs version headers: -```bash -export DOCKER_BUILDTAGS='btrfs_noversion' -``` - There are build tags for disabling graphdrivers as well. By default, support for all graphdrivers are built in.