summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJoseph Ciurej <ciurej1@llnl.gov>2020-04-23 00:38:10 -0700
committerGitHub <noreply@github.com>2020-04-23 09:38:10 +0200
commit044985af80f1310b16898a5c693c0bb4b49cdc27 (patch)
treeebade222a93101a3075528ce521738ec506b49b0 /var
parent7c0aee41271b5a59fca2ce4849de21f25c402d1a (diff)
downloadspack-044985af80f1310b16898a5c693c0bb4b49cdc27.tar.gz
spack-044985af80f1310b16898a5c693c0bb4b49cdc27.tar.bz2
spack-044985af80f1310b16898a5c693c0bb4b49cdc27.tar.xz
spack-044985af80f1310b16898a5c693c0bb4b49cdc27.zip
cryptopp : added 'shared' variant and sse detection (#16213)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cryptopp/package.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cryptopp/package.py b/var/spack/repos/builtin/packages/cryptopp/package.py
index a96e358d2a..fa586eca4b 100644
--- a/var/spack/repos/builtin/packages/cryptopp/package.py
+++ b/var/spack/repos/builtin/packages/cryptopp/package.py
@@ -25,11 +25,30 @@ class Cryptopp(MakefilePackage):
version('5.6.2', sha256='5cbfd2fcb4a6b3aab35902e2e0f3b59d9171fee12b3fc2b363e1801dfec53574')
version('5.6.1', sha256='98e74d8cb17a38033354519ac8ba9c5d98a6dc00bf5d1ec3c533c2e8ec86f268')
+ variant('shared', default=True, description="Build shared object versions of libraries.")
+
depends_on('gmake', type='build')
def url_for_version(self, version):
url = '{0}/{1}{2}.zip'
return url.format(self.homepage, self.name, version.joined)
+ def build(self, spec, prefix):
+ cxx_flags = []
+
+ if '+shared' in spec:
+ cxx_flags.append(self.compiler.cxx_pic_flag)
+
+ target = self.spec.target
+ if 'sse4.1' not in target:
+ cxx_flags.append('-DCRYPTOPP_DISABLE_SSE4')
+ if 'ssse3' not in target:
+ cxx_flags.append('-DCRYPTOPP_DISABLE_SSSE3')
+ if 'sse2' not in target:
+ cxx_flags.append('-DCRYPTOPP_DISABLE_SSE2')
+
+ make_target = 'dynamic' if '+shared' in spec else 'static'
+ make(make_target, 'CXXFLAGS={0}'.format(' '.join(cxx_flags)))
+
def install(self, spec, prefix):
make('install', 'PREFIX={0}'.format(prefix))