aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/make.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-11-11 21:59:18 +0900
committerOphestra <cat@gensokyo.uk>2026-11-12 12:44:39 +0900
commitac4cec1625da50d6abd9fca40446e7f75aa5bd37 (patch)
tree22b3789634008a43277952abea766be4f278e4f7 /internal/rosa/make.go
parente28bac0fe480c065e653b847d1b54f3e3d712156 (diff)
internal/rosa: set common cross-compile environment
This change avoids duplicating this piece of code all over the place. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/make.go')
-rw-r--r--internal/rosa/make.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/internal/rosa/make.go b/internal/rosa/make.go
index 6f3d7526..8672dac8 100644
--- a/internal/rosa/make.go
+++ b/internal/rosa/make.go
@@ -120,19 +120,7 @@ func (attr *MakeHelper) script(t Toolchain, name string) string {
attr = new(MakeHelper)
}
cross, arch := t.cross(), t.Arch()
- sysroot := Prefix + "/" + arch
-
- var configure string
- target := t.triple()
- if cross {
- configure += `
-export CC='clang --target=` + target + ` --sysroot=` + sysroot + `'
-export CXX='clang++ --target=` + target + ` --sysroot=` + sysroot + `'
-export PKG_CONFIG_SYSROOT_DIR='` + sysroot + `'
-export PKG_CONFIG_LIBDIR='` + sysroot + Prefix + `/lib/pkgconfig:` + sysroot + Prefix + `/share/pkgconfig'
-`
- }
- configure += attr.ScriptConfigureEarly
+ configure := attr.ScriptConfigureEarly
if !attr.SkipConfigure {
if attr.ConfigureName == "" {
@@ -143,7 +131,7 @@ export PKG_CONFIG_LIBDIR='` + sysroot + Prefix + `/lib/pkgconfig:` + sysroot + P
if attr.ForceAutoconf || attr.ConfigureName == "" {
configure += ` \
--prefix=` + Prefix
- host := target
+ host := t.triple()
build := host
if cross {
build = triple(t.native().Arch())