Add gcc4 cross-compiler support (!1754)

[skip ci]: CI already went through successfully, just rebasing.
This commit is contained in:
Daniele Debernardi 2019-02-12 20:57:05 +00:00 committed by Oliver Smith
parent 8896209afc
commit b015b288b8
2 changed files with 7 additions and 2 deletions

View File

@ -28,11 +28,14 @@ def generate(args, pkgname):
if prefix == "gcc":
upstream = pmb.aportgen.core.get_upstream_aport(args, "main/gcc")
based_on = "main/gcc (from Alpine)"
elif prefix == "gcc4":
upstream = args.aports + "/main/gcc4"
based_on = "main/gcc4 (from postmarketOS)"
elif prefix == "gcc6":
upstream = args.aports + "/main/gcc6"
based_on = "main/gcc6 (from postmarketOS)"
else:
raise ValueError("Invalid prefix '" + prefix + "', expected gcc or"
raise ValueError("Invalid prefix '" + prefix + "', expected gcc, gcc4 or"
" gcc6.")
pmb.helpers.run.user(args, ["cp", "-r", upstream, args.work + "/aportgen"])

View File

@ -200,7 +200,9 @@ def init_buildenv(args, apkbuild, arch, strict=False, force=False, cross=None,
# Cross-compiler init
if cross:
cross_pkgs = ["ccache-cross-symlinks"]
if "gcc6" in depends:
if "gcc4" in depends:
cross_pkgs += ["gcc4-" + arch]
elif "gcc6" in depends:
cross_pkgs += ["gcc6-" + arch]
else:
cross_pkgs += ["gcc-" + arch, "g++-" + arch]