aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/make.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/rosa/make.go')
-rw-r--r--internal/rosa/make.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/internal/rosa/make.go b/internal/rosa/make.go
index a41db646..f46780f5 100644
--- a/internal/rosa/make.go
+++ b/internal/rosa/make.go
@@ -101,19 +101,31 @@ func (attr *MakeHelper) script(t Toolchain, name string) string {
if attr == nil {
attr = new(MakeHelper)
}
+ cross := t.cross()
var configure string
target := t.triple()
+ if cross {
+ configure += `
+export CC='clang --target=` + target + ` --sysroot=/system/` + t.arch + `'
+export CXX='clang++ --target=` + target + ` --sysroot=/system/` + t.arch + `'
+`
+ }
+
if !attr.SkipConfigure {
- configure += attr.ConfigureName
- if configure == "" {
+ if attr.ConfigureName == "" {
configure += `/usr/src/` + name + `/configure`
+ } else {
+ configure += attr.ConfigureName
}
if attr.ForceAutoconf || attr.ConfigureName == "" {
configure += ` \
--prefix=/system`
host := target
build := host
+ if cross {
+ build = triple(t.native().Arch())
+ }
if attr.Host != "" {
host = attr.Host