about summary refs log tree commit diff homepage
path: root/scripts/build
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2019-08-04 21:26:56 +0200
committerMartinNowack <martin.nowack@gmail.com>2019-09-09 10:39:36 +0100
commit0fd707b62988ed25c31242eb3d858895d96eb619 (patch)
treed8abebc6a1a9df995225e3df4b0399d089d33303 /scripts/build
parent649c8bce588f04ed9099686f0d9ed9c326567c44 (diff)
downloadklee-0fd707b62988ed25c31242eb3d858895d96eb619.tar.gz
fix minor build script issues and inconsistencies
mostly following shellcheck
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/build.sh6
-rw-r--r--scripts/build/p-klee.inc22
-rw-r--r--scripts/build/p-llvm.inc20
-rw-r--r--scripts/build/p-sqlite.inc4
-rw-r--r--scripts/build/v-solvers.inc2
5 files changed, 27 insertions, 27 deletions
diff --git a/scripts/build/build.sh b/scripts/build/build.sh
index ebbcde1a..65aaa08a 100755
--- a/scripts/build/build.sh
+++ b/scripts/build/build.sh
@@ -1,6 +1,7 @@
 #!/usr/bin/env bash
 set -e
 set -u
+set -o pipefail
 # Build script for different components that are needed
 
 DIR="$(cd "$(dirname "$0")" && pwd)"
@@ -642,7 +643,7 @@ install_component() {
   check_list artifact_dependency_"${component}"
   mapfile -t depending_artifact_components <<< "$(get_list artifact_dependency_"${component}")"
 
-  # Make sure an artefact is available for the depending component
+  # Make sure an artifact is available for the depending component
   for v in "${depending_artifact_components[@]}"; do
     [[ -z "${v}" ]] && continue
     install_component "${v}"
@@ -654,7 +655,7 @@ install_component() {
   # Handle dependencies of required artifacts
   gather_dependencies "${component}" "artifact" "setup_variables"
 
-  # Check if the artifact is installed ablready
+  # Check if the artifact is installed already
   execution_action is_installed "${component}" && execution_action setup_artifact_variables "${component}" && validate_required_variables "${component}"  "export_variables" && { echo "Already installed ${component}"; return 0; }
 
   # Install package if available
@@ -700,7 +701,6 @@ install_component() {
 main() {
   local NAME
   NAME=$(basename "${0}")
-  local USAGE="usage: ${NAME} "
   local COMPONENTS=()
   local BUILD_DOCKER=0
   local INSTALL_SYSTEM_DEPS=0
diff --git a/scripts/build/p-klee.inc b/scripts/build/p-klee.inc
index a1520f83..0df3a257 100644
--- a/scripts/build/p-klee.inc
+++ b/scripts/build/p-klee.inc
@@ -16,14 +16,14 @@ build_klee() {
   CMAKE_PREFIX_PATH=("")
 
   local CMAKE_ARGUMENTS=(
-    -DLLVM_DIR="${LLVM_INSTALL}"
-    -DLLVM_CONFIG_BINARY="${LLVM_CONFIG}"
-    -DLLVMCC="${BITCODE_CC}"
-    -DLLVMCXX="${BITCODE_CXX}"
-    -DGTEST_SRC_DIR="${GTEST_INSTALL_PATH}"
-    -DENABLE_UNIT_TESTS="TRUE"
-    -DENABLE_SYSTEM_TESTS="TRUE"
-    -DLIT_ARGS="-v"
+    "-DLLVM_DIR=${LLVM_INSTALL}"
+    "-DLLVM_CONFIG_BINARY=${LLVM_CONFIG}"
+    "-DLLVMCC=${BITCODE_CC}"
+    "-DLLVMCXX=${BITCODE_CXX}"
+    "-DGTEST_SRC_DIR=${GTEST_INSTALL_PATH}"
+    "-DENABLE_UNIT_TESTS=TRUE"
+    "-DENABLE_SYSTEM_TESTS=TRUE"
+    "-DLIT_ARGS=-v"
   )
 
 
@@ -94,9 +94,9 @@ fi
         METASMT_DEFAULT=STP
       fi
       KLEE_METASMT_CONFIGURE_OPTION=(
-        -DENABLE_SOLVER_METASMT=TRUE
-        -DmetaSMT_DIR="${METASMT_BUILD_PATH}"
-        -DMETASMT_DEFAULT_BACKEND="${METASMT_DEFAULT}"
+        "-DENABLE_SOLVER_METASMT=TRUE"
+        "-DmetaSMT_DIR=${METASMT_BUILD_PATH}"
+        "-DMETASMT_DEFAULT_BACKEND=${METASMT_DEFAULT}"
       )
       ;;
     *)
diff --git a/scripts/build/p-llvm.inc b/scripts/build/p-llvm.inc
index 43be3399..d0c362c2 100644
--- a/scripts/build/p-llvm.inc
+++ b/scripts/build/p-llvm.inc
@@ -132,8 +132,8 @@ build_llvm() {
        cd "${SANITIZER_LLVM_LIBCXX}"
        cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
         -DLLVM_USE_SANITIZER=MemoryWithOrigins \
-        "${SANITIZER_CMAKE_C_COMPILER}" \
-        "${SANITIZER_CMAKE_CXX_COMPILER}" \
+        "${SANITIZER_CMAKE_C_COMPILER[@]}" \
+        "${SANITIZER_CMAKE_CXX_COMPILER[@]}" \
         "${LLVM_SRC_BASE}"
        ninja cxx cxxabi
 
@@ -144,8 +144,8 @@ build_llvm() {
        CXX_F="${SANITIZER_CXX_FLAGS[*]}"
        LD_F="${SANITIZER_LD_FLAGS[*]}"
        cmake -GNinja \
-          "${SANITIZER_CMAKE_C_COMPILER[*]}" \
-          "${SANITIZER_CMAKE_CXX_COMPILER[*]}" \
+          "${SANITIZER_CMAKE_C_COMPILER[@]}" \
+          "${SANITIZER_CMAKE_CXX_COMPILER[@]}" \
           -DCMAKE_C_FLAGS="$C_F" \
           -DCMAKE_CXX_FLAGS="${CXX_F}" \
           -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -171,7 +171,7 @@ build_llvm() {
   # Configure LLVM
   CONFIG=(
      "-DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL}"
-     "-LLVM_BUILD_LLVM_DYLIB=TRUE"
+     "-DLLVM_BUILD_LLVM_DYLIB=TRUE"
   )
   # cmake build
   if [[ "${enable_optimized}" == "1" && "${enable_debug}" != "1" ]]; then
@@ -204,11 +204,11 @@ build_llvm() {
 
   # Remove unneeded targets
   CONFIG+=(
-     -DLLVM_INCLUDE_EXAMPLES=OFF
-#     -DLLVM_INCLUDE_TESTS=OFF
-#     -DCLANG_INCLUDE_TESTS=OFF
-     -DLLVM_INCLUDE_BENCHMARKS=OFF
-     -DBUILD_SHARED_LIBS=ON
+     "-DLLVM_INCLUDE_EXAMPLES=OFF"
+#     "-DLLVM_INCLUDE_TESTS=OFF"
+#     "-DCLANG_INCLUDE_TESTS=OFF"
+     "-DLLVM_INCLUDE_BENCHMARKS=OFF"
+     "-DBUILD_SHARED_LIBS=ON"
   )
 
   local variables=("")
diff --git a/scripts/build/p-sqlite.inc b/scripts/build/p-sqlite.inc
index 16c1b220..2ba93ce3 100644
--- a/scripts/build/p-sqlite.inc
+++ b/scripts/build/p-sqlite.inc
@@ -17,14 +17,14 @@ build_sqlite() {
 
   # Check if sanitizers should be used to build sqlite
   if [[ "${SANITIZER_SUFFIX}x" != "x" ]]; then
-    CFLAGS="${SANITIZER_C_FLAGS[*]}"
+    CFLAGS=("${SANITIZER_C_FLAGS[@]}")
     COMP="${SANITIZER_C_COMPILER}"
   else
     COMP="${BITCODE_CC}"
     [[ -z "${COMP}" ]] && COMP="$(which gcc)"
   fi
 
-  ${COMP} ${CFLAGS} -fPIC -o libsqlite3.so -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -shared sqlite3.c
+  "${COMP}" "${CFLAGS[@]}" -fPIC -o libsqlite3.so -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -shared sqlite3.c
 }
 
 install_sqlite() {
diff --git a/scripts/build/v-solvers.inc b/scripts/build/v-solvers.inc
index ad3f43f1..9d6bfdc8 100644
--- a/scripts/build/v-solvers.inc
+++ b/scripts/build/v-solvers.inc
@@ -6,7 +6,7 @@ required_variables_solvers=(
 required_variables_check_solvers() {
   local solvers
   IFS=":" read -r -a solvers <<< "${SOLVERS}"
-  [[ -z "${solvers[@]}" ]] && { echo "SOLVERS can't be empty"; exit 1; }
+  [[ -z "${solvers[*]}" ]] && { echo "SOLVERS can't be empty"; exit 1; }
   
   for solver in "${solvers[@]}"; do
     [[ -z "${solver}" ]] && continue