@@ -14,9 +14,11 @@ category: Data, Cryptography
1414homepage: https://github.com/TomMD/entropy
1515bug-reports: https://github.com/TomMD/entropy/issues
1616stability: stable
17+
1718-- build-type: Simple
1819-- ^^ Used for HaLVM
1920build-type: Custom
21+
2022-- ^^ Test for RDRAND support using 'ghc'
2123cabal-version: >=1.10
2224tested-with: GHC == 8.2.2
@@ -41,38 +43,51 @@ custom-setup
4143library
4244 ghc-options: -O2
4345 exposed-modules: System.Entropy
44− if os(windows)
45− other-modules: System.EntropyWindows
46+ if impl(ghcjs)
47+ other-modules: System.EntropyGhcjs
4648 else {
47− if os(halvm)
48− other-modules: System.EntropyXen
49− else
50− other-modules: System.EntropyNix
49+ if os(windows)
50+ other-modules: System.EntropyWindows
51+ else {
52+ if os(halvm)
53+ other-modules: System.EntropyXen
54+ else
55+ other-modules: System.EntropyNix
56+ }
5157 }
5258 other-extensions: CPP, ForeignFunctionInterface, BangPatterns,
5359 ScopedTypeVariables
5460 build-depends: base >= 4.8 && < 5, bytestring
61+
5562 default-language: Haskell2010
56− if(os(halvm))
57− cpp-options: -DXEN -DHAVE_RDRAND
58− cc-options: -DXEN -DHAVE_RDRAND
59− if arch(x86_64)
60− cpp-options: -Darch_x86_64
61− cc-options: -Darch_x86_64 -O2
62− -- gcc 4.8.2 on i386 fails to compile rdrand.c when using -fPIC!
63− c-sources: cbits/rdrand.c
64− include-dirs: cbits
65− if arch(i386)
66− cpp-options: -Darch_i386
67− cc-options: -Darch_i386 -O2
68− if os(windows)
69− build-depends: Win32 >= 2.5
70− cpp-options: -DisWindows
71− cc-options: -DisWindows
72− extra-libraries: advapi32
73− else
74− if !os(halvm)
75− Build-Depends: unix
63+
64+ if impl(ghcjs) {
65+ build-depends: ghcjs-dom
66+ , jsaddle
67+ }
68+ else {
69+ if(os(halvm))
70+ cpp-options: -DXEN -DHAVE_RDRAND
71+ cc-options: -DXEN -DHAVE_RDRAND
72+ if arch(x86_64)
73+ cpp-options: -Darch_x86_64
74+ cc-options: -Darch_x86_64 -O2
75+ -- gcc 4.8.2 on i386 fails to compile rdrand.c when using -fPIC!
76+ c-sources: cbits/rdrand.c
77+ include-dirs: cbits
78+ if arch(i386)
79+ cpp-options: -Darch_i386
80+ cc-options: -Darch_i386 -O2
81+ if os(windows)
82+ build-depends: Win32 >= 2.5
83+ cpp-options: -DisWindows
84+ cc-options: -DisWindows
85+ extra-libraries: advapi32
86+ else
87+ if !os(halvm)
88+ Build-Depends: unix
89+ }
90+
7691
7792source-repository head
7893 type: git