mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-27 01:34:23 +00:00
functions.sh: dont die if gcc is missing
abuild-sign does not use gcc. fixes #9974
This commit is contained in:
parent
21dcfb1f21
commit
95cd15c025
@ -117,7 +117,7 @@ readconfig() {
|
||||
USE_COLORS=${_USE_COLORS-$USE_COLORS}
|
||||
USE_CCACHE=${_USE_CCACHE-$USE_CCACHE}
|
||||
|
||||
[ -z "$CBUILD" ] && CBUILD="$(gcc -dumpmachine)"
|
||||
[ -z "$CBUILD" ] && CBUILD="$(${CC:-gcc} -dumpmachine 2>/dev/null || true)"
|
||||
[ -z "$CHOST" ] && CHOST="$CBUILD"
|
||||
[ -z "$CTARGET" ] && CTARGET="$CHOST"
|
||||
[ "$(arch_to_hostspec $CBUILD)" != "unknown" ] && CBUILD="$(arch_to_hostspec $CBUILD)"
|
||||
|
11
tests/functions.bats
Normal file
11
tests/functions.bats
Normal file
@ -0,0 +1,11 @@
|
||||
setup() {
|
||||
export FUNCS=../functions.sh
|
||||
}
|
||||
|
||||
@test "check if CBUILD is set" {
|
||||
. $FUNCS && test -n "$CBUILD"
|
||||
}
|
||||
|
||||
@test "check that missing gcc does not kill us" {
|
||||
sh -e -c "CC=false; . $FUNCS && test -z \"$CBUILD\""
|
||||
}
|
Loading…
Reference in New Issue
Block a user