diff --git a/INSTALL.md b/INSTALL.md index ba86e70793..4fa62ffe3c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -5,11 +5,16 @@ We use [`zig`][zig] to build Vere, which is packaged as a single binary, ## Supported Targets +Main (`-Dall`) targets: - `aarch64-linux-musl` - `x86_64-linux-musl` - `aarch64-macos` - `x86_64-macos` +Additional targets: +- `aarch64-linux-gnu` +- `x86_64-linux-gnu` + ## Prerequisites Install version 0.13.0 of `zig` with the package manager of your choosing, e.g., `brew install zig`, or download the binary from [here][zig-download]. diff --git a/build.zig b/build.zig index 238abb52c0..77afb66922 100644 --- a/build.zig +++ b/build.zig @@ -2,13 +2,20 @@ const std = @import("std"); const VERSION = "3.2"; -const targets: []const std.Target.Query = &.{ +const main_targets = .{ .{ .cpu_arch = .aarch64, .os_tag = .macos, .abi = null }, .{ .cpu_arch = .x86_64, .os_tag = .macos, .abi = null }, .{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .musl }, .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .musl }, }; +const supported_targets: []const std.Target.Query = &(main_targets ++ .{ + .{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .gnu }, + .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .gnu }, +}); + +const targets: []const std.Target.Query = &main_targets; + const BuildCfg = struct { version: []const u8, pace: []const u8, @@ -22,7 +29,7 @@ const BuildCfg = struct { }; pub fn build(b: *std.Build) !void { - const target = b.standardTargetOptions(.{ .whitelist = targets }); + const target = b.standardTargetOptions(.{ .whitelist = supported_targets }); var optimize = b.standardOptimizeOption(.{}); // diff --git a/ext/avahi/build.zig b/ext/avahi/build.zig index ea8171fbe7..44fe568090 100644 --- a/ext/avahi/build.zig +++ b/ext/avahi/build.zig @@ -538,7 +538,8 @@ pub fn build(b: *std.Build) void { avahi.root_module.addCMacro("HAVE_DBUS_CONNECTION_CLOSE", "0"); avahi.root_module.addCMacro("HAVE_EXPAT_H", "1"); avahi.root_module.addCMacro("HAVE_CONFIG_H", "1"); - avahi.root_module.addCMacro("HAVE_STRLCPY", "1"); + if (!t.isGnu()) + avahi.root_module.addCMacro("HAVE_STRLCPY", "1"); const avahi_config_h = b.addConfigHeader(.{ .style = .blank, diff --git a/ext/h2o/build.zig b/ext/h2o/build.zig index 51d395fdbf..c2bfc15b41 100644 --- a/ext/h2o/build.zig +++ b/ext/h2o/build.zig @@ -55,6 +55,10 @@ pub fn build(b: *std.Build) !void { .files = &.{"cloexec.c"}, .flags = &.{ "-fno-sanitize=all", + if (t.isGnu()) + "-D_GNU_SOURCE" + else + "", }, });