comparison 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
comparison
equal deleted inserted replaced
223:c49107ed5af8 224:8f30b077cdb8
1 #!/bin/bash
2
3 ##
4 ## This script compiles cross-distribution Linux binaries thanks to
5 ## Holy Build Box: https://github.com/phusion/holy-build-box
6 ##
7 ## The ideal solution would be to use Linux Standard Base
8 ## (LSB). Unfortunately, the LSB C++ compiler is a pre-4.8 gcc that
9 ## does not feature full C++11 capabilities, which prevents compiling
10 ## GDCM >= 3.0.
11 ##
12
13 set -ex
14
15 if [ "$1" != "Debug" -a "$1" != "Release" ]; then
16 echo "Please provide build type: Debug or Release"
17 exit -1
18 fi
19
20 if [ -t 1 ]; then
21 # TTY is available => use interactive mode
22 DOCKER_FLAGS='-i'
23 fi
24
25 ROOT_DIR=`dirname $(readlink -f $0)`/..
26
27 mkdir -p ${ROOT_DIR}/holy-build-box
28
29 docker run -t ${DOCKER_FLAGS} --rm \
30 --user $(id -u):$(id -g) \
31 -v ${ROOT_DIR}:/source:ro \
32 -v ${ROOT_DIR}/holy-build-box:/target:rw \
33 phusion/holy-build-box-64:2.0.1 \
34 bash /source/Resources/holy-build-box-internal.sh $1
35
36 ls -lR ${ROOT_DIR}/holy-build-box/