diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-22 23:22:02 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-22 23:22:29 +0900 |
| commit | 8341f6ed26bb8b9e4269e594d2f6b864d534546b (patch) | |
| tree | 44ca1504fd105c3be18c82823c43ee111f41e2f5 | |
| parent | 02c7ca8e849807130e732b9b639593f49dd5abc8 (diff) | |
internal/rosa/make: optionally omit program name flags
This does not work on some configure scripts pretending to be autoconf.
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rw-r--r-- | internal/rosa/make.go | 15 | ||||
| -rw-r--r-- | 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, |
