From 85c4c25bc2a0a71e9075933f92221781f40fc93a Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:16:17 -0700 Subject: Use WebKit LTO builds where appropriate --- src/bun.js/WebKit | 2 +- src/cli/install.sh | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/bun.js/WebKit b/src/bun.js/WebKit index ae3c6f3fd..4d6ee4103 160000 --- a/src/bun.js/WebKit +++ b/src/bun.js/WebKit @@ -1 +1 @@ -Subproject commit ae3c6f3fd24fc10da1ea124dbba0d188dcf46c93 +Subproject commit 4d6ee41032866e63aa43ba007616c632ed1c90a4 diff --git a/src/cli/install.sh b/src/cli/install.sh index 096ff7917..9218c51ad 100644 --- a/src/cli/install.sh +++ b/src/cli/install.sh @@ -29,7 +29,7 @@ if [[ -t 1 ]]; then # Bold Bold_Green='\033[1;32m' # Bold Green - Bold_White='\033[1m' # Bold White + Bold_White='\033[1m' # Bold White fi error() { @@ -79,9 +79,21 @@ if [[ $target = darwin-x64 ]]; then fi fi - github_repo="https://github.com/oven-sh/bun" +if [[ $target = darwin-x64 ]]; then + # If AVX2 isn't supported, use the -baseline build + if [[ $(sysctl -n machdep.cpu.features) != *avx2* ]]; then + target=darwin-x64-baseline + fi +fi + +if [[ $target = linux-x64 ]]; then + # If AVX2 isn't supported, use the -baseline build + if [[ $(cat /proc/cpuinfo | grep avx2) = '' ]]; then + target=linux-x64-baseline + fi +fi if [[ $# = 0 ]]; then bun_uri=$github_repo/releases/latest/download/bun-$target.zip -- cgit v1.2.3