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
This commit is contained in:
embr 2021-05-26 11:20:59 +02:00
parent 77acedc33b
commit dc9165346e

View file

@ -46,7 +46,15 @@ stdenv.mkDerivation rec {
COPTS = 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 (!userSupport) "-DNO_USER_SUPPORT"
++ optional (!dirIndexSupport) "-DNO_DIRINDEX_SUPPORT" ++ optional (!dirIndexSupport) "-DNO_DIRINDEX_SUPPORT"