comparison Aws/holy-build-box-internal.sh @ 58:37185ec1cf49

holy build box for S3
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Jun 2021 17:43:53 +0200
parents
children 5d2e9399bdd8
comparison
equal deleted inserted replaced
57:ba1be668e475 58:37185ec1cf49
1 #!/bin/bash
2
3 # Cloud storage plugins for Orthanc
4 # Copyright (C) 2020-2021 Osimis S.A., Belgium
5 #
6 # This program is free software: you can redistribute it and/or
7 # modify it under the terms of the GNU Affero General Public License
8 # as published by the Free Software Foundation, either version 3 of
9 # the License, or (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Affero General Public License for more details.
15 #
16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19
20 set -e
21
22 # Activate Holy Build Box environment.
23 source /hbb_exe/activate
24
25 set -ex
26
27 mkdir /tmp/build
28 cd /tmp/build
29
30 # Holy Build Box defines LDFLAGS as "-L/hbb_exe/lib
31 # -static-libstdc++". The "-L/hbb_exe/lib" option results in linking
32 # errors "undefined reference" to `std::__once_callable',
33 # 'std::__once_call' and '__once_proxy'.
34 export LDFLAGS=-static-libstdc++
35 unset LDPATHFLAGS
36 unset SHLIB_LDFLAGS
37 unset LD_LIBRARY_PATH
38 unset LIBRARY_PATH
39
40 mkdir -p /tmp/source-writeable/Aws
41
42 cp -r /source/Common /tmp/source-writeable/
43 cp -r /source/UnitTestsSources /tmp/source-writeable/
44 cp /source/Aws/* /tmp/source-writeable/Aws/ || true # Ignore error about omitting directories
45
46 cmake /tmp/source-writeable/Aws/ \
47 -DORTHANC_FRAMEWORK_SOURCE=web \
48 -DCMAKE_BUILD_TYPE=$1 -DSTATIC_BUILD=ON
49
50 # Use only 2 processes (not `nproc`), as this is a very heavy compilation
51 make -j2
52
53 ./UnitTests
54
55 if [ "$1" == "Release" ]; then
56 strip ./libOrthancAwsS3Storage.so
57 fi
58
59 cp ./libOrthancAwsS3Storage.so /target/
60 cp ./UnitTests /target/