@@ -45,6 +45,11 @@ flag non-blocking-ffi
45
45
prevents other Haskell threads running. Enabling this flag
46
46
avoids this unfairness, but with greater overall cost.
47
47
48
+ flag pkg-config
49
+ default : False
50
+ manual : True
51
+ description : Use @pkg-config(1)@ to locate foreign @zlib@ library .
52
+
48
53
library
49
54
exposed-modules : Codec.Compression.GZip,
50
55
Codec.Compression.Zlib,
@@ -68,18 +73,23 @@ library
68
73
ghc-options : -Wall -fwarn-tabs
69
74
if flag(non-blocking-ffi)
70
75
cpp-options : -DNON_BLOCKING_FFI
71
- if !os(windows )
72
- -- Normally we use the the standard system zlib:
73
- extra-libraries : z
76
+ if flag(pkg-config )
77
+ -- NB: pkg-config is available on windows as well when using msys2
78
+ pkgconfig-depends : zlib
74
79
else
75
- -- However for the benefit of users of Windows (which does not have zlib
76
- -- by default) we bundle a complete copy of the C sources of zlib-1.2.8
77
- c-sources : cbits/adler32.c cbits/compress.c cbits/crc32.c
80
+ -- don't use pkg-config
81
+ if !os(windows)
82
+ -- Normally we use the the standard system zlib.
83
+ extra-libraries : z
84
+ else
85
+ -- However for the benefit of users of Windows (which does not have zlib
86
+ -- by default) we bundle a complete copy of the C sources of zlib-1.2.8
87
+ c-sources : cbits/adler32.c cbits/compress.c cbits/crc32.c
78
88
cbits/deflate.c cbits/infback.c
79
89
cbits/inffast.c cbits/inflate.c cbits/inftrees.c
80
90
cbits/trees.c cbits/uncompr.c cbits/zutil.c
81
- include-dirs : cbits
82
- install-includes : zlib.h zconf.h
91
+ include-dirs : cbits
92
+ install-includes : zlib.h zconf.h
83
93
84
94
test-suite tests
85
95
type : exitcode-stdio-1.0
0 commit comments