annotate Aws/holy-build-box-internal.sh @ 140:40efe821932a

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