diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gen_build_files.sh | 4 | ||||
-rwxr-xr-x | scripts/trylink | 14 |
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" "$@"; } | |||
20 | generate() | 20 | generate() |
21 | { | 21 | { |
22 | # NB: data to be inserted at INSERT line is coming on stdin | 22 | # NB: data to be inserted at INSERT line is coming on stdin |
23 | local src="$1" dst="$2" header="$3" | 23 | src="$1" |
24 | dst="$2" | ||
25 | header="$3" | ||
24 | #chk "${dst}" | 26 | #chk "${dst}" |
25 | { | 27 | { |
26 | # Need to use printf: different shells have inconsistent | 28 | # 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() { | |||
46 | } | 46 | } |
47 | 47 | ||
48 | check_cc() { | 48 | check_cc() { |
49 | local tempname="$(mktemp tmp.XXXXXXXXXX)" | 49 | tempname="$(mktemp tmp.XXXXXXXXXX)" |
50 | local r | ||
51 | echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c | 50 | echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c |
52 | # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( | 51 | # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( |
53 | # Was using "-xc /dev/null", but we need a valid C program. | 52 | # Was using "-xc /dev/null", but we need a valid C program. |
@@ -55,14 +54,13 @@ check_cc() { | |||
55 | # '... -D"BB_VER=KBUILD_STR(1.N.M)" ...' | 54 | # '... -D"BB_VER=KBUILD_STR(1.N.M)" ...' |
56 | # and we need shell to process quotes! | 55 | # and we need shell to process quotes! |
57 | $CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1 | 56 | $CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1 |
58 | r=$? | 57 | exitcode=$? |
59 | rm -f "$tempname" "$tempname".c "$tempname".o | 58 | rm -f "$tempname" "$tempname".c "$tempname".o |
60 | return $r | 59 | return $exitcode |
61 | } | 60 | } |
62 | 61 | ||
63 | check_libc_is_glibc() { | 62 | check_libc_is_glibc() { |
64 | local tempname="$(mktemp tmp.XXXXXXXXXX)" | 63 | tempname="$(mktemp tmp.XXXXXXXXXX)" |
65 | local r | ||
66 | echo "\ | 64 | echo "\ |
67 | #include <stdlib.h> | 65 | #include <stdlib.h> |
68 | /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ | 66 | /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ |
@@ -71,9 +69,9 @@ check_libc_is_glibc() { | |||
71 | #endif | 69 | #endif |
72 | " >"$tempname".c | 70 | " >"$tempname".c |
73 | ! $CC $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1 | 71 | ! $CC $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1 |
74 | r=$? | 72 | exitcode=$? |
75 | rm -f "$tempname" "$tempname".c "$tempname".o | 73 | rm -f "$tempname" "$tempname".c "$tempname".o |
76 | return $r | 74 | return $exitcode |
77 | } | 75 | } |
78 | 76 | ||
79 | EXE="$1" | 77 | EXE="$1" |