From dc9165346e18665191b39e2ae5309e1e50b7ff40 Mon Sep 17 00:00:00 2001 From: embr Date: Wed, 26 May 2021 11:20:59 +0200 Subject: [PATCH] bozohttpd: resolve warnings, serve >2GB files on 32bit host -D_DEFAULT_SOURCE *and* -D_GNU_SOURCE together resolve all warnings about implicitly defined functions. -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 enable gcc's Large File Extensions to allow a 32-bit host to serve files larger than 2GB. Based on what Makefile.boot does, for platforms without bmake: http://cvsweb.netbsd.org/bsdweb.cgi/src/libexec/httpd/Makefile.boot --- pkgs/servers/http/bozohttpd/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/http/bozohttpd/default.nix b/pkgs/servers/http/bozohttpd/default.nix index e934f86f2c17..6d403756bd28 100644 --- a/pkgs/servers/http/bozohttpd/default.nix +++ b/pkgs/servers/http/bozohttpd/default.nix @@ -46,7 +46,15 @@ stdenv.mkDerivation rec { COPTS = [ - "-DNO_BLOCKLIST_SUPPORT" # unpackaged dependency: https://man.netbsd.org/blocklist.3 + "-D_DEFAULT_SOURCE" + "-D_GNU_SOURCE" + + # Ensure that we can serve >2GB files even on 32-bit systems. + "-D_LARGEFILE_SOURCE" + "-D_FILE_OFFSET_BITS=64" + + # unpackaged dependency: https://man.netbsd.org/blocklist.3 + "-DNO_BLOCKLIST_SUPPORT" ] ++ optional (!userSupport) "-DNO_USER_SUPPORT" ++ optional (!dirIndexSupport) "-DNO_DIRINDEX_SUPPORT"