mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
config/functions: add go_configure() helpers
This commit is contained in:
parent
3c186abdfc
commit
4d15490c67
@ -911,6 +911,47 @@ target_has_feature() {
|
|||||||
listcontains "$TARGET_FEATURES" "$1"
|
listcontains "$TARGET_FEATURES" "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# configure variables for go
|
||||||
|
go_configure() {
|
||||||
|
unset GOARCH GOARM
|
||||||
|
case ${TARGET_ARCH} in
|
||||||
|
x86_64)
|
||||||
|
export GOARCH=amd64
|
||||||
|
;;
|
||||||
|
arm)
|
||||||
|
export GOARCH=arm
|
||||||
|
|
||||||
|
case ${TARGET_CPU} in
|
||||||
|
arm1176jzf-s)
|
||||||
|
export GOARM=6
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
export GOARM=7
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
export GOARCH=arm64
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
export GOOS=linux
|
||||||
|
export GOROOT=${TOOLCHAIN}/lib/golang
|
||||||
|
export PATH=${PATH}:${GOROOT}/bin
|
||||||
|
|
||||||
|
go_configure_path
|
||||||
|
|
||||||
|
export CGO_ENABLED=1
|
||||||
|
export CGO_NO_EMULATION=1
|
||||||
|
export CGO_CFLAGS=$CFLAGS
|
||||||
|
}
|
||||||
|
|
||||||
|
go_configure_path() {
|
||||||
|
export GOLANG=${TOOLCHAIN}/lib/golang/bin/go
|
||||||
|
export GOPATH=${PKG_BUILD}/.gopath
|
||||||
|
export GOFLAGS="-modcacherw"
|
||||||
|
}
|
||||||
|
|
||||||
# find path for matching file or directory, searching standard directory hierarchy, using optional default
|
# find path for matching file or directory, searching standard directory hierarchy, using optional default
|
||||||
# if a path is located it will be set in FOUND_PATH and exit code will be 0.
|
# if a path is located it will be set in FOUND_PATH and exit code will be 0.
|
||||||
find_path() {
|
find_path() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user