Skip to content

Commit ef8afe6

Browse files
committed
external_deps: fix script incompatible with Mac's bash
1 parent 875b37b commit ef8afe6

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

external_deps/build.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ LDFLAGS=''
8585

8686
log() {
8787
level="${1}"; shift
88-
printf '%s: %s\n' "${level^^}" "${@}" >&2
89-
[ "${level}" != 'error' ]
88+
printf '%s: %s\n' "${level}" "${@}" >&2
89+
[ "${level}" != 'ERROR' ]
9090
}
9191

9292
# Extract an archive into the given subdirectory of the build dir and cd to it
@@ -120,7 +120,7 @@ extract() {
120120
rmdir "${2}-dmg"
121121
;;
122122
*)
123-
log error "Unknown archive type for ${1}"
123+
log ERROR "Unknown archive type for ${1}"
124124
;;
125125
esac
126126
cd "${2}"
@@ -132,13 +132,13 @@ download() {
132132
while [ ! -f "${tarball_file}" ]; do
133133
if [ -z "${1:-}" ]
134134
then
135-
log error "No more mirror to download ${tarball_file} from"
135+
log ERROR "No more mirror to download ${tarball_file} from"
136136
fi
137137
local download_url="${1}"; shift
138138
log status "Downloading ${download_url}"
139139
if ! "${CURL}" -R -L --fail -o "${tarball_file}" "${download_url}"
140140
then
141-
log warning "Failed to download ${download_url}"
141+
log WARNING "Failed to download ${download_url}"
142142
rm -f "${tarball_file}"
143143
fi
144144
done
@@ -198,7 +198,7 @@ build_nasm() {
198198
cp "${dir_name}/nasm" "${PREFIX}/bin"
199199
;;
200200
*)
201-
log error 'Unsupported platform for NASM'
201+
log ERROR 'Unsupported platform for NASM'
202202
;;
203203
esac
204204
}
@@ -357,7 +357,7 @@ build_sdl2() {
357357
local sdl2_lib_dir='lib/x64'
358358
;;
359359
*)
360-
log error 'Unsupported platform for SDL2'
360+
log ERROR 'Unsupported platform for SDL2'
361361
;;
362362
esac
363363

@@ -421,7 +421,7 @@ build_glew() {
421421
env CFLAGS.EXTRA="${CFLAGS}" LDFLAGS.EXTRA="${LDFLAGS}" make install GLEW_DEST="${PREFIX}" CC="${CC}" LD="${CC}" LIBDIR="${PREFIX}/lib"
422422
;;
423423
*)
424-
log error 'Unsupported platform for GLEW'
424+
log ERROR 'Unsupported platform for GLEW'
425425
;;
426426
esac
427427
}
@@ -467,7 +467,7 @@ build_jpeg() {
467467
# Other platforms can build but we need need to explicitly
468468
# set CMAKE_SYSTEM_NAME for CMAKE_CROSSCOMPILING to be set
469469
# and CMAKE_SYSTEM_PROCESSOR to not be ignored by cmake.
470-
log error 'Unsupported platform for JPEG'
470+
log ERROR 'Unsupported platform for JPEG'
471471
;;
472472
esac
473473

@@ -489,7 +489,7 @@ build_jpeg() {
489489
local SYSTEM_PROCESSOR='arm'
490490
;;
491491
*)
492-
log error 'Unsupported platform for JPEG'
492+
log ERROR 'Unsupported platform for JPEG'
493493
;;
494494
esac
495495

@@ -546,7 +546,7 @@ build_openal() {
546546
-DCMAKE_BUILD_TYPE=Release -DALSOFT_EXAMPLES=OFF)
547547
;;
548548
*)
549-
log error 'Unsupported platform for OpenAL'
549+
log ERROR 'Unsupported platform for OpenAL'
550550
;;
551551
esac
552552

@@ -702,7 +702,7 @@ build_wasisdk() {
702702
*-amd64-*)
703703
;;
704704
*)
705-
log error "wasi doesn't have release for ${PLATFORM}"
705+
log ERROR "wasi doesn't have release for ${PLATFORM}"
706706
;;
707707
esac
708708

@@ -742,7 +742,7 @@ build_wasmtime() {
742742
local WASMTIME_ARCH=aarch64
743743
;;
744744
*)
745-
log error "wasmtime doesn't have release for ${PLATFORM}"
745+
log ERROR "wasmtime doesn't have release for ${PLATFORM}"
746746
;;
747747
esac
748748

@@ -870,7 +870,7 @@ build_naclruntime() {
870870
local NACL_ARCH=x86-64
871871
;;
872872
*)
873-
log error 'Unsupported platform for naclruntime'
873+
log ERROR 'Unsupported platform for naclruntime'
874874
;;
875875
esac
876876

@@ -910,7 +910,7 @@ build_genlib() {
910910
local MACHINE='i386:x86-64'
911911
;;
912912
*)
913-
log error 'Unsupported platform for genlib'
913+
log ERROR 'Unsupported platform for genlib'
914914
;;
915915
esac
916916

@@ -924,7 +924,7 @@ build_genlib() {
924924
done
925925
;;
926926
*)
927-
log error 'Unsupported platform for genlib'
927+
log ERROR 'Unsupported platform for genlib'
928928
;;
929929
esac
930930
}
@@ -1045,7 +1045,7 @@ common_setup_arch() {
10451045
CXXFLAGS+=' -march=armv7-a -mfpu=neon'
10461046
;;
10471047
*)
1048-
log error 'Unsupported platform'
1048+
log ERROR 'Unsupported platform'
10491049
;;
10501050
esac
10511051
}

0 commit comments

Comments
 (0)