@@ -20,6 +20,10 @@ Description:
2020Flag network-bytestring
2121 Default: False
2222
23+Flag allow-sendfilefd
24+ Description: Allow use of sendfileFd (not available on GNU/kFreeBSD)
25+ Default: True
26+
2327Library
2428 Build-Depends: base >= 3 && < 5
2529 , blaze-builder >= 0.2.1.4 && < 0.4
@@ -53,7 +57,7 @@ Library
5357 Network.Wai.Handler.Warp.Types
5458 Paths_warp
5559 Ghc-Options: -Wall
56− if os(linux) || os(freebsd) || os(darwin)
60+ if (os(linux) || os(freebsd) || os(darwin)) && flag(allow-sendfilefd)
5761 Cpp-Options: -DSENDFILEFD
5862 Build-Depends: hashable
5963 Other-modules: Network.Wai.Handler.Warp.FdCache
@@ -92,7 +96,7 @@ Test-Suite spec
9296 -- Yes, this means that the test suite will no longer work on Windows.
9397 -- Unfortunately there is a bug in older versions of cabal, and this conditional
9498 -- will therefore break older systems.
95− --if os(linux) || os(freebsd) || os(darwin)
99+ --if (os(linux) || os(freebsd) || os(darwin)) && flag(allow-sendfilefd)
96100 Cpp-Options: -DSENDFILEFD
97101 Build-Depends: unix
98102 , hashable