diff --git a/build.zig b/build.zig index 092930b..da37b35 100644 --- a/build.zig +++ b/build.zig @@ -43,7 +43,7 @@ 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, @@ -51,21 +51,21 @@ pub fn build(b: *std.Build) void { } 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"); @@ -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) @@ -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")); diff --git a/build.zig.zon b/build.zig.zon index 9347724..3c94e54 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -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 = .{