diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-03-01 10:41:57 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-03-01 10:42:20 +0900 |
| commit | e92971e0c24010e76741f630d2f6913c2ee4cca8 (patch) | |
| tree | 189decc878424643ece02e4eda1389e57318783b | |
| parent | 6159c74e961853b293ec1a40eed3a4476e418054 (diff) | |
internal/rosa/make: alternative configure script
This enables using the configure helper with non-autotools configure scripts.
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rw-r--r-- | internal/rosa/make.go | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/internal/rosa/make.go b/internal/rosa/make.go index 304c3714..4d45f32c 100644 --- a/internal/rosa/make.go +++ b/internal/rosa/make.go @@ -53,6 +53,8 @@ type MakeAttr struct { // Whether to skip running the configure script. SkipConfigure bool + // Alternative name for the configure script. + ConfigureName string // Flags passed to the configure script. Configure [][2]string // Extra make targets. @@ -102,9 +104,12 @@ func (t Toolchain) NewViaMake( var configure string if !attr.SkipConfigure { - configure += ` + configure = attr.ConfigureName + if configure == "" { + configure += ` /usr/src/` + name + `/configure \ --prefix=/system` + } if attr.Host != `""` { configure += ` \ @@ -121,10 +126,15 @@ func (t Toolchain) NewViaMake( slices.Collect(func(yield func(string) bool) { for _, v := range attr.Configure { s := v[0] - if v[1] == "" || (v[0] != "" && + if v[0] != "" && v[0][0] >= 'a' && - v[0][0] <= 'z') { + v[0][0] <= 'z' { s = "--" + s + } else if len(v[0]) > 1 && + v[0][0] == 'D' && + v[0][1] >= 'a' && + v[0][1] <= 'z' { + s = "-" + s } if v[1] != "" { s += "=" + v[1] @@ -152,10 +162,11 @@ func (t Toolchain) NewViaMake( makeTargets = nil } - finalExtra := []pkg.Artifact{ - t.Load(Make), + var finalExtra []pkg.Artifact + if !t.isStage0() { + finalExtra = append(finalExtra, t.Load(Make)) } - if attr.OmitDefaults || attr.Flag&TEarly == 0 { + if !attr.OmitDefaults && attr.Flag&TEarly == 0 { finalExtra = append(finalExtra, t.Load(Gawk), t.Load(Coreutils), |
