diff options
| author | eao197 <eao197@gmail.com> | 2018-05-30 19:25:16 +0300 |
|---|---|---|
| committer | eao197 <eao197@gmail.com> | 2018-05-30 19:25:16 +0300 |
| commit | 99eb78cf2dd8b000ac195dd9ebba4fb344dc5baa (patch) | |
| tree | 18072db815a8f417c4d63a00ae95286642f0dff3 /scripts/bootstrap.sh | |
| parent | 34257a50ceda0bfa05e59b532f71223b70f39d52 (diff) | |
| parent | 842252373992a9c7b74f041607b47754d61cc0c8 (diff) | |
| download | vcpkg-99eb78cf2dd8b000ac195dd9ebba4fb344dc5baa.tar.gz vcpkg-99eb78cf2dd8b000ac195dd9ebba4fb344dc5baa.zip | |
Merge https://github.com/Microsoft/vcpkg
Diffstat (limited to 'scripts/bootstrap.sh')
| -rw-r--r-- | scripts/bootstrap.sh | 19 |
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/" |
