summary refs log tree commit diff
path: root/pkgs/servers/http
diff options
context:
space:
mode:
authorembr <git@liclac.eu>2021-05-26 11:20:59 +0200
committerembr <git@liclac.eu>2021-05-26 11:21:01 +0200
commitdc9165346e18665191b39e2ae5309e1e50b7ff40 (patch)
treed537c3a5daa04b095fb38be254aee16ab5adaff6 /pkgs/servers/http
parent77acedc33b2a90f9eab71a4582e655ea5c840869 (diff)
downloadnixpkgs-dc9165346e18665191b39e2ae5309e1e50b7ff40.tar
nixpkgs-dc9165346e18665191b39e2ae5309e1e50b7ff40.tar.gz
nixpkgs-dc9165346e18665191b39e2ae5309e1e50b7ff40.tar.bz2
nixpkgs-dc9165346e18665191b39e2ae5309e1e50b7ff40.tar.lz
nixpkgs-dc9165346e18665191b39e2ae5309e1e50b7ff40.tar.xz
nixpkgs-dc9165346e18665191b39e2ae5309e1e50b7ff40.tar.zst
nixpkgs-dc9165346e18665191b39e2ae5309e1e50b7ff40.zip
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
Diffstat (limited to 'pkgs/servers/http')
-rw-r--r--pkgs/servers/http/bozohttpd/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/servers/http/bozohttpd/default.nix b/pkgs/servers/http/bozohttpd/default.nix
index e934f86f2c1..6d403756bd2 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"