Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@ pub fn build(b: *std.Build) void {
config_header.addValues(.{
.HAVE_DECL_SYS_SIGLIST = 1,
});
exe.defineCMacro("SYS_SIGLIST_DECLARED", "1");
exe.root_module.addCMacro("SYS_SIGLIST_DECLARED", "1");
} else {
config_header.addValues(.{
.HAVE_DECL_SYS_SIGLIST = 0,
});
}

if (target.result.os.tag == .windows) {
exe.defineCMacro("_POSIX_", "1");
exe.defineCMacro("putenv", "_putenv");
exe.defineCMacro("getpid", "_getpid");
exe.defineCMacro("fdopen", "_fdopen");
exe.defineCMacro("environ", "(*__p__environ())");
exe.root_module.addCMacro("_POSIX_", "1");
exe.root_module.addCMacro("putenv", "_putenv");
exe.root_module.addCMacro("getpid", "_getpid");
exe.root_module.addCMacro("fdopen", "_fdopen");
exe.root_module.addCMacro("environ", "(*__p__environ())");
} else {
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
exe.defineCMacro("LOCALEDIR", "\".\"");
exe.root_module.addCMacro("LOCALEDIR", "\".\"");
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
exe.defineCMacro("LIBDIR", "\"lib\"");
exe.root_module.addCMacro("LIBDIR", "\"lib\"");
}
if (target.result.isGnuLibC()) {
// TODO: only do this if we are compiling against gnu
//exe.defineCMacro("__USE_GNU", "1");
exe.defineCMacro("_GNU_SOURCE", "1");
//exe.root_module.addCMacro("__USE_GNU", "1");
exe.root_module.addCMacro("_GNU_SOURCE", "1");
}
const write_files = b.addWriteFiles();
_ = write_files.addCopyFile(b.path("mkcustom.h"), "src/mkcustom.h");
Expand Down Expand Up @@ -123,9 +123,9 @@ pub fn build(b: *std.Build) void {
}

fn target_has_sys_siglist(t: std.Build.ResolvedTarget) bool {
if (t.result.isDarwin()) return true;
if (t.result.os.tag.isDarwin()) return true;
if (t.result.isGnuLibC()) {
const vr = t.result.os.getVersionRange();
const vr = t.result.os.versionRange();
// newer glibc does not allow linking with sys_siglist
// https://lists.gnu.org/archive/html/info-gnu/2020-08/msg00002.html
if (vr == .linux and vr.linux.glibc.major >= 2 and vr.linux.glibc.minor >= 32)
Expand Down Expand Up @@ -170,7 +170,7 @@ fn linkGlob(

const write_files = b.addWriteFiles();
_ = write_files.addCopyFile(make_dep.path("src/config.h.W32"), "src/config.h");
lib.defineCMacro("HAVE_CONFIG_H", "1");
lib.root_module.addCMacro("HAVE_CONFIG_H", "1");
lib.addIncludePath(make_dep.path("src"));
lib.addIncludePath(make_dep.path("lib"));
lib.addIncludePath(write_files.getDirectory().path(b, "src"));
Expand Down
9 changes: 5 additions & 4 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.{
.name = "gnumake",
.version = "0.0.0",
.minimum_zig_version = "0.12.0",
.name = .gnumake,
.version = "4.4.1",
.minimum_zig_version = "0.14.0",
.fingerprint = 0xeb3905f275fdb840,
.dependencies = .{
.make = .{
.url = "https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz",
.hash = "12205f66cba6fc33b91195339f50617f28b1de62806ad556247e34bb3e8a7fa4c382",
.hash = "N-V-__8AAO76hQBfZsum_DO5EZUzn1Bhfyix3mKAatVWJH40",
},
},
.paths = .{
Expand Down