From ca788c00128b2d4b17477e5efb88907eef2ab234 Mon Sep 17 00:00:00 2001 From: Xiao Date: Sun, 28 Apr 2024 22:06:25 +1000 Subject: [PATCH] Update build.sh --- build.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index a5fbb1931..17eaba50a 100755 --- a/build.sh +++ b/build.sh @@ -20,8 +20,6 @@ LLVMVer=${MajorLLVMVer}.0.0 UbuntuArmLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-aarch64-linux-gnu.tar.xz" UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-x86_64-linux-gnu-ubuntu-18.04.tar.xz" SourceLLVM="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${LLVMVer}.zip" -MacZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-osx-10.14.6.zip" -MacArmZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.9.1/z3-4.9.1-arm64-osx-11.0.zip" UbuntuZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip" SourceZ3="https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.8.8.zip" @@ -151,10 +149,8 @@ OSDisplayName="" if [[ $sysOS == "Darwin" ]]; then check_and_install_brew if [[ "$arch" == "arm64" ]]; then - urlZ3="$MacArmZ3" OSDisplayName="macOS arm64" else - urlZ3="$MacZ3" OSDisplayName="macOS x86" fi elif [[ $sysOS == "Linux" ]]; then @@ -211,18 +207,25 @@ if [[ ! -d "$Z3_DIR" ]]; then if [[ "$sysOS" = "Linux" && "$arch" = "aarch64" ]]; then # only linux arm build from source build_z3_from_source + elif [[ "$sysOS" = "Darwin" ]]; then + echo "Downloading Z3 binary for $OSDisplayName" + brew install z3 + if [ $? -eq 0 ]; then + echo "z3 binary installation completed." + else + echo "z3 binary installation failed." + exit 1 + fi + mkdir -p $SVFHOME/$Z3Home + ln -s $(brew --prefix z3)/* $SVFHOME/$Z3Home else - # everything else downloads pre-built lib includ osx "arm64" + # everything else downloads pre-built lib echo "Downloading Z3 binary for $OSDisplayName" generic_download_file "$urlZ3" z3.zip check_unzip echo "Unzipping z3 package..." unzip -q "z3.zip" && mv ./z3-* ./$Z3Home rm z3.zip - if [[ "$sysOS" == "Darwin" ]]; then - # Fix missing rpath information in libz3 - install_name_tool -id @rpath/libz3.dylib "$Z3Home/bin/libz3.dylib" - fi fi fi