From 8341f6ed26bb8b9e4269e594d2f6b864d534546b Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 22 Oct 2026 23:22:02 +0900 Subject: internal/rosa/make: optionally omit program name flags This does not work on some configure scripts pretending to be autoconf. Signed-off-by: Ophestra --- internal/rosa/make.go | 15 ++++++++++----- internal/rosa/state.go | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/internal/rosa/make.go b/internal/rosa/make.go index 2fdc2dec..0747d850 100644 --- a/internal/rosa/make.go +++ b/internal/rosa/make.go @@ -39,6 +39,8 @@ type MakeHelper struct { Host string // Target triple, zero value is equivalent to the Rosa OS triple. Build string + // Do not clear program prefix/suffix. + DefaultName bool // Use the dependency-free [GenericHelper] make. Early bool @@ -111,14 +113,14 @@ func (attr *MakeHelper) script(t Toolchain, name string) string { if attr == nil { attr = new(MakeHelper) } - cross := t.cross() + cross, arch := t.cross(), t.Arch() var configure string target := t.triple() if cross { configure += ` -export CC='clang --target=` + target + ` -isysroot=/system/` + t.arch + `' -export CXX='clang++ --target=` + target + ` -isysroot=/system/` + t.arch + `' +export CC='clang --target=` + target + ` -isysroot=/system/` + arch + `' +export CXX='clang++ --target=` + target + ` -isysroot=/system/` + arch + `' ` } @@ -141,9 +143,12 @@ export CXX='clang++ --target=` + target + ` -isysroot=/system/` + t.arch + `' host = attr.Host } if attr.Host != `""` { - configure += ` \ + if !attr.DefaultName { + configure += ` \ --program-prefix='' \ - --program-suffix='' \ + --program-suffix=''` + } + configure += ` \ --host=` + host + ` \ --target=` + host } diff --git a/internal/rosa/state.go b/internal/rosa/state.go index e6d6e4a5..53e38c49 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -886,6 +886,7 @@ func (s *S) getFrame() azalea.Frame { k("chdir"): &chdir, k("configureName"): &attr.ConfigureName, k("forceAutoconf"): &attr.ForceAutoconf, + k("defaultName"): &attr.DefaultName, k("configure"): &attr.Configure, k("host"): &attr.Host, k("build"): &attr.Build, -- cgit v1.3.1