aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-01-24 20:52:42 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-01-24 20:52:42 +0100
commitbca4ea8b68403e6f751341b82c65937f14590679 (patch)
tree21c637e653ceaa259599cecf8fb57a9de8ad6172 /scripts
parent89193f985bf50af702e0f98a3c86573277c03287 (diff)
downloadbusybox-bca4ea8b68403e6f751341b82c65937f14590679.tar.gz
remove "local" bashism from a few scripts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_build_files.sh4
-rwxr-xr-xscripts/trylink14
2 files changed, 9 insertions, 9 deletions
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
index ebee17c64..f79fa2f83 100755
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -20,7 +20,9 @@ chk() { status "CHK" "$@"; }
generate()
{
# NB: data to be inserted at INSERT line is coming on stdin
- local src="$1" dst="$2" header="$3"
+ src="$1"
+ dst="$2"
+ header="$3"
#chk "${dst}"
{
# Need to use printf: different shells have inconsistent
diff --git a/scripts/trylink b/scripts/trylink
index c2a431626..9f288c141 100755
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -46,8 +46,7 @@ try() {
}
check_cc() {
- local tempname="$(mktemp tmp.XXXXXXXXXX)"
- local r
+ tempname="$(mktemp tmp.XXXXXXXXXX)"
echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c
# Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
# Was using "-xc /dev/null", but we need a valid C program.
@@ -55,14 +54,13 @@ check_cc() {
# '... -D"BB_VER=KBUILD_STR(1.N.M)" ...'
# and we need shell to process quotes!
$CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1
- r=$?
+ exitcode=$?
rm -f "$tempname" "$tempname".c "$tempname".o
- return $r
+ return $exitcode
}
check_libc_is_glibc() {
- local tempname="$(mktemp tmp.XXXXXXXXXX)"
- local r
+ tempname="$(mktemp tmp.XXXXXXXXXX)"
echo "\
#include <stdlib.h>
/* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */
@@ -71,9 +69,9 @@ check_libc_is_glibc() {
#endif
" >"$tempname".c
! $CC $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1
- r=$?
+ exitcode=$?
rm -f "$tempname" "$tempname".c "$tempname".o
- return $r
+ return $exitcode
}
EXE="$1"