48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
version = "16.1.0"
|
|
revision = 1
|
|
metadata = meta(
|
|
description = "GNU GCC cross-compiler (bootstrap stage, C/C++ only)",
|
|
license = "GPL-3.0-or-later",
|
|
)
|
|
source = tarball_source(
|
|
url = f"https://ftp.gnu.org/gnu/gcc/gcc-{version}/gcc-{version}.tar.xz",
|
|
sha256 = "50efb4d94c3397aff3b0d61a5abd748b4dd31d9d3f2ab7be05b171d36a510f79",
|
|
strip_components = 1,
|
|
)
|
|
host_deps = ["binutils"]
|
|
|
|
def configure(ctx):
|
|
ctx.run([
|
|
ctx.source_dir / "configure",
|
|
"--target=" + options.target_triple,
|
|
"--prefix=" + ctx.prefix,
|
|
"--with-sysroot=" + ctx.sysroot,
|
|
"--without-headers",
|
|
"--with-newlib",
|
|
"--enable-languages=c,c++",
|
|
"--enable-default-pie",
|
|
"--enable-default-ssp",
|
|
"--disable-nls",
|
|
"--disable-shared",
|
|
"--disable-threads",
|
|
"--disable-libssp",
|
|
"--disable-libgomp",
|
|
"--disable-libquadmath",
|
|
"--disable-libatomic",
|
|
"--disable-libvtv",
|
|
"--disable-multilib",
|
|
], env = {
|
|
"CFLAGS": options.host_cflags,
|
|
"CXXFLAGS": options.host_cxxflags,
|
|
"LDFLAGS": options.host_ldflags,
|
|
})
|
|
|
|
def build(ctx):
|
|
jobs = "-j" + str(ctx.jobs)
|
|
ctx.run(["make", jobs, "all-gcc"])
|
|
ctx.run(["make", jobs, "all-target-libgcc"])
|
|
|
|
def install(ctx, pkg):
|
|
ctx.run(["make", "install-gcc"], env = {"DESTDIR": pkg.dest_dir})
|
|
ctx.run(["make", "install-target-libgcc"], env = {"DESTDIR": pkg.dest_dir})
|