|
21 | 21 | root_dir=$(dirname $0)/..
|
22 | 22 | sdk_version=$(cat $root_dir/VERSION)
|
23 | 23 | 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 | + |
24 | 38 | arch_list="arm arm64 arc arc64 nios2 riscv64 sparc mips x86_64 xtensa_sample_controller \
|
25 | 39 | xtensa_intel_apl_adsp xtensa_intel_s1000 xtensa_intel_bdw_adsp \
|
26 | 40 | xtensa_intel_byt_adsp xtensa_nxp_imx_adsp xtensa_nxp_imx8m_adsp"
|
27 | 41 |
|
28 |
| -echo "Creating ${product_name}-${sdk_version}-${machine}-linux-setup.run" |
| 42 | +echo "Creating ${product_name}-${sdk_version}-${machine}-${os}-setup.run" |
29 | 43 |
|
30 | 44 | # Create ./setup.sh
|
31 | 45 |
|
@@ -104,6 +118,10 @@ setup_host()
|
104 | 118 | {
|
105 | 119 | local setup=$1
|
106 | 120 |
|
| 121 | + if [ $os = "macos" ]; then |
| 122 | + return |
| 123 | + fi |
| 124 | + |
107 | 125 | echo "./$file_hosttools -y -d \$target_sdk_dir > /dev/null &" >> $setup
|
108 | 126 | echo "spinner \$! \"Installing additional host tools...\"" >> $setup
|
109 | 127 | echo "[ \$? -ne 0 ] && echo \"Error(s) encountered during installation.\" && exit 1" >>$setup
|
@@ -143,7 +161,7 @@ create_toolchain()
|
143 | 161 | {
|
144 | 162 | local arch=$1
|
145 | 163 | 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 |
147 | 165 |
|
148 | 166 | var_file_arch=file_gcc_${arch}
|
149 | 167 | file_gcc_arch=${!var_file_arch}
|
@@ -174,7 +192,7 @@ create_toolchain()
|
174 | 192 | create_sdk()
|
175 | 193 | {
|
176 | 194 | 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 |
178 | 196 |
|
179 | 197 | setup_hdr $setup $toolchain_name
|
180 | 198 | for arch in $arch_list; do
|
@@ -208,8 +226,8 @@ parse_toolchain_name file_gcc_xtensa_intel_s1000 xtensa_intel_s1000
|
208 | 226 | parse_toolchain_name file_hosttools hosttools
|
209 | 227 | parse_toolchain_name file_cmake cmake
|
210 | 228 |
|
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 |
213 | 231 | echo "Error: Missing host tools!"
|
214 | 232 | exit 1
|
215 | 233 | fi
|
|
0 commit comments