Index: utils/docker/debian8/release/Dockerfile =================================================================== --- utils/docker/debian8/release/Dockerfile +++ utils/docker/debian8/release/Dockerfile @@ -11,6 +11,7 @@ FROM launcher.gcr.io/google/debian8:latest LABEL maintainer "LLVM Developers" +LABEL licences "LLVM licenses are under /usr/local/share/llvm/licences" # Install packages for minimal useful image. RUN apt-get update && \ Index: utils/docker/example/release/Dockerfile =================================================================== --- utils/docker/example/release/Dockerfile +++ utils/docker/example/release/Dockerfile @@ -15,6 +15,7 @@ # FIXME: Change maintainer name. LABEL maintainer "Maintainer " +LABEL licences "LLVM licenses are under /usr/local/share/llvm/licences" # FIXME: Install all packages you want to have in your release container. # A minimal useful installation must include libstdc++ and binutils. Index: utils/docker/nvidia-cuda/release/Dockerfile =================================================================== --- utils/docker/nvidia-cuda/release/Dockerfile +++ utils/docker/nvidia-cuda/release/Dockerfile @@ -16,6 +16,7 @@ # FIXME: Change maintainer name. LABEL maintainer "LLVM Developers" +LABEL licences "LLVM licenses are under /usr/local/share/llvm/licences" # Unpack clang installation into this container. ADD clang.tar.gz /usr/local/ Index: utils/docker/scripts/build_install_llvm.sh =================================================================== --- utils/docker/scripts/build_install_llvm.sh +++ utils/docker/scripts/build_install_llvm.sh @@ -191,6 +191,37 @@ echo "Skipping checksumming checks..." fi +# Copy licences into docker image. +LICENCES_DIR="$CLANG_INSTALL_DIR/share/llvm/licenses" +mkdir -p "$LICENCES_DIR" + +function copy_license_file() { + local SOURCE_RELPATH="$1" + local SOURCE_DIR_RELPATH="$(dirname "$SOURCE_RELPATH")" + + echo "Copying licencese file $SOURCE_RELPATH" + mkdir -p "$LICENCES_DIR/$SOURCE_DIR_RELPATH" + cp "$SOURCE_RELPATH" "$LICENCES_DIR/$SOURCE_RELPATH" +} + +echo "Copying licences for the Docker images." +echo "Please note that the list of licenses may be incomplete or outdated." + +pushd "$CLANG_BUILD_DIR/src" + +for PROJECT in $LLVM_PROJECTS; do + find "$PROJECT" -iname "license*" | while read SOURCE_FILE; do + copy_license_file "$SOURCE_FILE" + done + + if [ "$PROJECT" == "llvm" ]; then + copy_license_file "llvm/lib/Support/MD5.cpp" + copy_license_file "llvm/include/llvm/Support/MD5.h" + fi +done + +popd # "$CLANG_BUILD_DIR/src" + mkdir "$CLANG_BUILD_DIR/build" pushd "$CLANG_BUILD_DIR/build"