about summary refs log tree commit diff homepage
path: root/scripts/build/p-llvm-linux-ubuntu-18.04.inc
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2019-02-28 11:56:19 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2019-03-10 20:10:32 +0000
commitcf930214e12b49e89be4674043d9f461d667baae (patch)
tree90de5ea1c643d0d7ad2c5cf55e862d309e605d48 /scripts/build/p-llvm-linux-ubuntu-18.04.inc
parentb4d8fe0301b82e8abff0336bf6d1347dff11a853 (diff)
downloadklee-cf930214e12b49e89be4674043d9f461d667baae.tar.gz
Updated dependency build system for KLEE
Provide a single `scripts/build/build.sh` file to build KLEE and its
dependencies.
Diffstat (limited to 'scripts/build/p-llvm-linux-ubuntu-18.04.inc')
-rw-r--r--scripts/build/p-llvm-linux-ubuntu-18.04.inc49
1 files changed, 49 insertions, 0 deletions
diff --git a/scripts/build/p-llvm-linux-ubuntu-18.04.inc b/scripts/build/p-llvm-linux-ubuntu-18.04.inc
new file mode 100644
index 00000000..f83112db
--- /dev/null
+++ b/scripts/build/p-llvm-linux-ubuntu-18.04.inc
@@ -0,0 +1,49 @@
+install_build_dependencies_llvm() { 
+	apt update -y
+
+	dependencies=(
+		build-essential
+
+		autoconf
+		automake
+		groff
+		gcc
+		g++
+		python-dev
+		make
+		subversion # Check out code
+		zlib1g-dev
+	)
+
+	#Install essential dependencies
+	apt -y --no-install-recommends install "${dependencies[@]}"
+}
+
+install_binary_artifact_llvm() {
+  apt update -y
+  
+  dependencies=(
+    "clang-${LLVM_VERSION}"
+  )
+
+  #Install essential dependencies
+  apt -y --no-install-recommends install "${dependencies[@]}"
+}
+
+# Check if the binary artifact is installed
+is_installed_llvm() {
+	local lc=""
+	# Check if llvm-config with the right version exists	
+	lc=$(which "llvm-config-${LLVM_VERSION}")
+	
+	local rtti
+	rtti="$(${lc} --has-rtti)"
+	local assertion
+	assertion="$(${lc} --assertion-mode)"
+	local build_mode
+	build_mode="$(${lc} --build-mode)"
+	
+	# Check requested mode with mode of the found item	
+	[[ $(to_bool "${REQUIRES_RTTI}") -eq $(to_bool "${rtti}") ]] || return 1
+	[[ $(to_bool "${DISABLE_ASSERTIONS}") -ne $(to_bool "${assertion}") ]] || return 1
+}
\ No newline at end of file