diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2018-08-11 17:12:36 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2024-05-08 09:02:27 +0200 |
commit | b785d10e6eca8b74210680c7aa774a8579651efb (patch) | |
tree | 6c94249aa1a7915644ed0e6f8a4c2ac61d8e0a2a | |
parent | c04fdc0518bf37070c8dacc2370b21fb82d5a128 (diff) |
sdkevn.sh: added env vars for golang xcompile
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rwxr-xr-x | sdkenv.sh | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -30,6 +30,19 @@ export LDFLAGS="-L${TARGET_DIR}/usr/lib -L${TARGET_DIR_ROOT}/usr/lib" export PKG_CONFIG_PATH="${TARGET_DIR}/usr/lib/pkgconfig" export PKG_CONFIG_LIBDIR="${TARGET_DIR}/usr/lib/pkgconfig" +# set some optional CGO vars for xcompile +export CGO_ENABLED=1 +export GO_EXTLINK_ENABLED=1 +export GOARCH="${ARCH}" +if cat "${OWRT}/.config" | grep -qoE 'CONFIG_arm_v7'; then + echo "* GOARM=7" + export GOARM=7 +fi +if cat "${OWRT}/.config" | grep -qoE 'CONFIG_arm_v6'; then + echo "* GOARM=6" + export GOARM=6 +fi + check_dirs[0]="${TOOLCHAIN_DIR}" check_dirs[1]="${TARGET_DIR}" check_dirs[2]="${TARGET_DIR_ROOT}" |