Skip to content

Commit

Permalink
add support for config sites
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexicon226 committed Jun 12, 2024
1 parent 3babccd commit 59bab37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ fn generateLibPython(
const configure_run = std.Build.Step.Run.create(b, "cpython-configure");
configure_run.setCwd(source.path("."));

configure_run.setEnvironmentVariable("CONFIG_SITE", try b.build_root.join(
b.allocator,
&.{ "build/", b.fmt("config.site-{s}", .{target_triple}) },
));
configure_run.setEnvironmentVariable("READELF", "llvm-readelf");
configure_run.setEnvironmentVariable("CC", b.fmt("{s} {s}", .{ b.graph.zig_exe, "cc" }));
configure_run.setEnvironmentVariable("CXX", b.fmt("{s} {s}", .{ b.graph.zig_exe, "c++" }));
configure_run.setEnvironmentVariable("CFLAGS", b.fmt("-target {s}", .{target_triple}));
Expand All @@ -130,10 +135,9 @@ fn generateLibPython(
"--disable-shared",
if (optimize == .Debug) "" else "--enable-optimizations",
});

// TODO: we'll probably need this for more in-depth bindings
// configure_run.addArg(b.fmt("--host={s}", .{target_triple}));
// configure_run.addArg(b.fmt("--build={s}", .{try b.host.result.linuxTriple(b.allocator)}));
configure_run.addArg(b.fmt("--host={s}", .{target_triple}));
configure_run.addArg(b.fmt("--build={s}", .{try b.host.result.linuxTriple(b.allocator)}));
configure_run.addArg("--disable-ipv6");

const make_run = std.Build.Step.Run.create(b, "cpython-make");
make_run.setCwd(source.path("."));
Expand Down
6 changes: 6 additions & 0 deletions build/config.site-riscv64-linux-musl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Config for RISCV-64 Linux Musl

# cross-comp is unable to find these
ac_cv_buggy_getaddrinfo=no
ac_cv_file__dev_ptmx=yes
ac_cv_file__dev_ptc=no

0 comments on commit 59bab37

Please sign in to comment.