@@ -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,49 @@ 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
70− cpp-options: -DisWindows
71− cc-options: -DisWindows
72− extra-libraries: advapi32
73− else
74− if !os(halvm)
75− Build-Depends: unix
63+ if impl(ghcjs) {
64+ build-depends: ghcjs-dom
65+ , jsaddle
66+ }
67+ else {
68+ if(os(halvm))
69+ cpp-options: -DXEN -DHAVE_RDRAND
70+ cc-options: -DXEN -DHAVE_RDRAND
71+ if arch(x86_64)
72+ cpp-options: -Darch_x86_64
73+ cc-options: -Darch_x86_64 -O2
74+ -- gcc 4.8.2 on i386 fails to compile rdrand.c when using -fPIC!
75+ c-sources: cbits/rdrand.c
76+ include-dirs: cbits
77+ if arch(i386)
78+ cpp-options: -Darch_i386
79+ cc-options: -Darch_i386 -O2
80+ if os(windows)
81+ build-depends: Win32
82+ cpp-options: -DisWindows
83+ cc-options: -DisWindows
84+ extra-libraries: advapi32
85+ else
86+ if !os(halvm)
87+ Build-Depends: unix
88+ }
7689
7790source-repository head
7891 type: git