aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootstrap.sh')
-rw-r--r--scripts/bootstrap.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 66efb1d62..e999fa55e 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -30,7 +30,14 @@ vcpkgCheckEqualFileHash()
{
url=$1; filePath=$2; expectedHash=$3
- actualHash=$(shasum -a 512 "$filePath") # sha512sum not available on osx
+ if command -v "sha512sum" >/dev/null 2>&1 ; then
+ actualHash=$(sha512sum "$filePath")
+ else
+ # sha512sum is not available by default on osx
+ # shasum is not available by default on Fedora
+ actualHash=$(shasum -a 512 "$filePath")
+ fi
+
actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word
if ! [ "$expectedHash" = "$actualHash" ]; then
@@ -90,7 +97,7 @@ fetchTool()
return 1
fi
- xmlFileAsString=`cat $vcpkgRootDir/scripts/vcpkgTools.xml`
+ xmlFileAsString=`cat "$vcpkgRootDir/scripts/vcpkgTools.xml"`
toolRegexStart="<tool name=\"$tool\" os=\"$os\">"
toolData="$(extractStringBetweenDelimiters "$xmlFileAsString" "$toolRegexStart" "</tool>")"
if [ "$toolData" = "" ]; then
@@ -150,7 +157,9 @@ selectCXX()
if [ "x$CXX" = "x" ]; then
CXX=g++
- if which g++-7 >/dev/null 2>&1; then
+ if which g++-8 >/dev/null 2>&1; then
+ CXX=g++-8
+ elif which g++-7 >/dev/null 2>&1; then
CXX=g++-7
elif which g++-6 >/dev/null 2>&1; then
CXX=g++-6
@@ -159,7 +168,7 @@ selectCXX()
gccversion="$("$CXX" -v 2>&1)"
gccversion="$(extractStringBetweenDelimiters "$gccversion" "gcc version " ".")"
- if [ "$gccversion" = "5" ]; then
+ if [ "$gccversion" -lt "6" ]; then
echo "CXX ($CXX) is too old; please install a newer compiler such as g++-7."
echo "sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y"
echo "sudo apt-get update -y"
@@ -185,4 +194,4 @@ mkdir -p "$buildDir"
(cd "$buildDir" && "$cmakeExe" --build .)
rm -rf "$vcpkgRootDir/vcpkg"
-cp "$buildDir/vcpkg" "$vcpkgRootDir/" \ No newline at end of file
+cp "$buildDir/vcpkg" "$vcpkgRootDir/"