summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/gmp/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/gmp/package.py')
-rw-r--r--var/spack/repos/builtin/packages/gmp/package.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/gmp/package.py b/var/spack/repos/builtin/packages/gmp/package.py
index 40a2608ea2..c5f8c2881b 100644
--- a/var/spack/repos/builtin/packages/gmp/package.py
+++ b/var/spack/repos/builtin/packages/gmp/package.py
@@ -28,6 +28,11 @@ class Gmp(AutotoolsPackage, GNUMirrorPackage):
depends_on('libtool', type='build')
depends_on('m4', type='build')
+ variant('static', default=False, description='Build static library')
+ variant('shared', default=True, description='Build shared library')
+
+ conflicts('~shared', when='~static', msg='Please select at least one of +static or +shared')
+
# gmp's configure script seems to be broken; it sometimes misdetects
# shared library support. Regenerating it fixes the issue.
force_autoreconf = True
@@ -43,4 +48,9 @@ class Gmp(AutotoolsPackage, GNUMirrorPackage):
return (flags, None, None)
def configure_args(self):
- return ['--enable-cxx']
+ args = ['--enable-cxx']
+ args.extend(self.enable_or_disable('static'))
+ args.extend(self.enable_or_disable('shared'))
+ if self.spec.satisfies('+static'):
+ args.append('--with-pic')
+ return args