Skip to content

Commit 8055765

Browse files
committed
make_zephyr_sdk: Add support for Mac OS
* Skip host tools support/checks on Mac OS * set package names to `linux` or `macos` Signed-off-by: Kumar Gala <[email protected]>
1 parent e5bb92d commit 8055765

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

scripts/make_zephyr_sdk.sh

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,25 @@ fi
2121
root_dir=$(dirname $0)/..
2222
sdk_version=$(cat $root_dir/VERSION)
2323
machine=$1
24+
25+
case "$(uname -s)" in
26+
Darwin)
27+
os=macos
28+
;;
29+
Linux)
30+
os=linux
31+
;;
32+
*)
33+
echo 'Unsupported OS'
34+
exit 1
35+
;;
36+
esac
37+
2438
arch_list="arm arm64 arc arc64 nios2 riscv64 sparc mips x86_64 xtensa_sample_controller \
2539
xtensa_intel_apl_adsp xtensa_intel_s1000 xtensa_intel_bdw_adsp \
2640
xtensa_intel_byt_adsp xtensa_nxp_imx_adsp xtensa_nxp_imx8m_adsp"
2741

28-
echo "Creating ${product_name}-${sdk_version}-${machine}-linux-setup.run"
42+
echo "Creating ${product_name}-${sdk_version}-${machine}-${os}-setup.run"
2943

3044
# Create ./setup.sh
3145

@@ -104,6 +118,10 @@ setup_host()
104118
{
105119
local setup=$1
106120

121+
if [ $os = "macos" ]; then
122+
return
123+
fi
124+
107125
echo "./$file_hosttools -y -d \$target_sdk_dir > /dev/null &" >> $setup
108126
echo "spinner \$! \"Installing additional host tools...\"" >> $setup
109127
echo "[ \$? -ne 0 ] && echo \"Error(s) encountered during installation.\" && exit 1" >>$setup
@@ -143,7 +161,7 @@ create_toolchain()
143161
{
144162
local arch=$1
145163
local setup=toolchains/${arch}/setup.sh
146-
local toolchain_name=zephyr-toolchain-${arch}-${sdk_version}-${machine}-linux-setup.run
164+
local toolchain_name=zephyr-toolchain-${arch}-${sdk_version}-${machine}-${os}-setup.run
147165

148166
var_file_arch=file_gcc_${arch}
149167
file_gcc_arch=${!var_file_arch}
@@ -174,7 +192,7 @@ create_toolchain()
174192
create_sdk()
175193
{
176194
local setup=toolchains/setup.sh
177-
local toolchain_name=${product_name}-${sdk_version}-${machine}-linux-setup.run
195+
local toolchain_name=${product_name}-${sdk_version}-${machine}-${os}-setup.run
178196

179197
setup_hdr $setup $toolchain_name
180198
for arch in $arch_list; do
@@ -208,8 +226,8 @@ parse_toolchain_name file_gcc_xtensa_intel_s1000 xtensa_intel_s1000
208226
parse_toolchain_name file_hosttools hosttools
209227
parse_toolchain_name file_cmake cmake
210228

211-
# Host tools are non-optional
212-
if [ -z "$file_hosttools" ]; then
229+
# Host tools are non-optional on Linux
230+
if [ -z "$file_hosttools" -a $os = "linux" ]; then
213231
echo "Error: Missing host tools!"
214232
exit 1
215233
fi

0 commit comments

Comments
 (0)