Debian Codegraph @

crt/s2n/codebuild/bin/install_cppcheck.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License").
5 # You may not use this file except in compliance with the License.
6 # A copy of the License is located at
7 #
8 # http://aws.amazon.com/apache2.0
9 #
10 # or in the "license" file accompanying this file. This file is distributed
11 # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 # express or implied. See the License for the specific language governing
13 # permissions and limitations under the License.
14 #
15
16 set -e
17
18 usagescip-shell shell shell-project 0.0.0 usage().() {
19 echoscip-shell system . . echo. "install_cppcheck.sh install_dir"
20 exit 1
21 }
22
23 if [scip-shell system . . `[`. "$#" -ne "1" ]; then
24 usagescip-shell shell shell-project 0.0.0 usage().
25 fi
26
27 INSTALL_DIR=$1
28 source codebuild/bin/jobs.shscip-shell source . . `codebuild/bin/jobs.sh`.
29
30 mkdirscip-shell system . . mkdir. -p $INSTALL_DIR||truescip-shell system . . true.
31 cd "$INSTALL_DIR"
32 gitscip-shell system . . git. clone --branch 2.3 --depth 1 https://github.com/danmar/cppcheck.git cppcheck-src
33 cd cppcheck-src
34
35 # The cppcheck 2.3 build fails without this import. This should be removed after cppcheck is
36 # updated: https://github.com/aws/s2n-tls/issues/5239
37 sedscip-shell system . . sed. -i '1s/^/#include <limits>\n/' ./lib/programmemory.cpp
38
39 # -DNO_UNIX_SIGNAL_HANDLING is added to support the cppcheck 2.3 build, and should also be removed
40 # after cppcheck is updated: https://github.com/aws/s2n-tls/issues/5239
41 # These build instructions are based on https://github.com/danmar/cppcheck#gnu-make.
42 makescip-shell system . . make. -j $JOBS MATCHCOMPILER=yes CXXFLAGS="-O2 -DNDEBUG -DNO_UNIX_SIGNAL_HANDLING"
43
44 mvscip-shell system . . mv. cppcheck ..
45 mvscip-shell system . . mv. cfg ..
46 cd ..
47 rmscip-shell system . . rm. -rf cppcheck-src