added detect_arch function and ARCH global variable
This commit is contained in:
parent
fa15e15758
commit
4d06f57758
@ -19,6 +19,7 @@ function load_config {
|
||||
fi
|
||||
|
||||
OS=$(detect_os)
|
||||
ARCH=$(detect_arch)
|
||||
myprint_quiet $quiet "${GREEN}detected OS: $OS"
|
||||
|
||||
# getting version of cbuild installation
|
||||
|
||||
29
detect_os.sh
29
detect_os.sh
@ -3,9 +3,9 @@
|
||||
include "cbuild/myprint.sh"
|
||||
|
||||
function detect_os {
|
||||
local uname_rezult="$(uname -o)"
|
||||
# myprint "uname rezult: '$uname_rezult'"
|
||||
case "$uname_rezult" in
|
||||
local uname_result="$(uname -o)"
|
||||
# myprint "uname result: '$uname_result'"
|
||||
case "$uname_result" in
|
||||
Msys | Cygwin | MS/Windows)
|
||||
safeprint WINDOWS
|
||||
;;
|
||||
@ -19,7 +19,28 @@ function detect_os {
|
||||
safeprint MACOS
|
||||
;;
|
||||
*)
|
||||
error "unknown operating system: $uname_rezult"
|
||||
error "unknown operating system: $uname_result"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function detect_arch {
|
||||
local uname_result="$(uname -m)"
|
||||
case "$uname_result" in
|
||||
arm | arm32 | armhf | aarch32)
|
||||
safeprint arm32
|
||||
;;
|
||||
arm64 | aarch64 | aarch64_be | armv8b | armv8l)
|
||||
safeprint arm64
|
||||
;;
|
||||
x86 | i386 | i486 | i686)
|
||||
safeprint x86
|
||||
;;
|
||||
x64 | x86_64 | amd64)
|
||||
safeprint x64
|
||||
;;
|
||||
*)
|
||||
error "unknown CPU architecture: $uname_result"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user