Mercurial > hg > orthanc-webviewer
diff Resources/holy-build-box-compile.sh @ 224:8f30b077cdb8
compilation using holy-build-box
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 23 Jan 2020 18:59:52 +0100 |
parents | |
children | 07bc649bade7 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/holy-build-box-compile.sh Thu Jan 23 18:59:52 2020 +0100 @@ -0,0 +1,36 @@ +#!/bin/bash + +## +## This script compiles cross-distribution Linux binaries thanks to +## Holy Build Box: https://github.com/phusion/holy-build-box +## +## The ideal solution would be to use Linux Standard Base +## (LSB). Unfortunately, the LSB C++ compiler is a pre-4.8 gcc that +## does not feature full C++11 capabilities, which prevents compiling +## GDCM >= 3.0. +## + +set -ex + +if [ "$1" != "Debug" -a "$1" != "Release" ]; then + echo "Please provide build type: Debug or Release" + exit -1 +fi + +if [ -t 1 ]; then + # TTY is available => use interactive mode + DOCKER_FLAGS='-i' +fi + +ROOT_DIR=`dirname $(readlink -f $0)`/.. + +mkdir -p ${ROOT_DIR}/holy-build-box + +docker run -t ${DOCKER_FLAGS} --rm \ + --user $(id -u):$(id -g) \ + -v ${ROOT_DIR}:/source:ro \ + -v ${ROOT_DIR}/holy-build-box:/target:rw \ + phusion/holy-build-box-64:2.0.1 \ + bash /source/Resources/holy-build-box-internal.sh $1 + +ls -lR ${ROOT_DIR}/holy-build-box/