Add shared/static variants to gmp and mpfr (#29836)
* Add shared/static variants to gmp and mpfr * Update package.py * Update package.py
This commit is contained in:
parent
b7eb4af98f
commit
d64de54ebe
@ -28,6 +28,11 @@ class Gmp(AutotoolsPackage, GNUMirrorPackage):
|
|||||||
depends_on('libtool', type='build')
|
depends_on('libtool', type='build')
|
||||||
depends_on('m4', 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
|
# gmp's configure script seems to be broken; it sometimes misdetects
|
||||||
# shared library support. Regenerating it fixes the issue.
|
# shared library support. Regenerating it fixes the issue.
|
||||||
force_autoreconf = True
|
force_autoreconf = True
|
||||||
@ -43,4 +48,9 @@ def flag_handler(self, name, flags):
|
|||||||
return (flags, None, None)
|
return (flags, None, None)
|
||||||
|
|
||||||
def configure_args(self):
|
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
|
||||||
|
@ -34,6 +34,11 @@ class Mpfr(AutotoolsPackage, GNUMirrorPackage):
|
|||||||
depends_on('autoconf-archive', when='@4.0.2:', type='build')
|
depends_on('autoconf-archive', when='@4.0.2:', type='build')
|
||||||
depends_on('texinfo', when='@4.1.0', type='build')
|
depends_on('texinfo', when='@4.1.0', type='build')
|
||||||
|
|
||||||
|
variant('static', default=False, description='Build static library')
|
||||||
|
variant('shared', default=True, description='Build shared library')
|
||||||
|
|
||||||
|
conflicts('~static', when='~shared', msg='Please select at least one of +static or +shared')
|
||||||
|
|
||||||
force_autoreconf = True
|
force_autoreconf = True
|
||||||
|
|
||||||
# Check the Bugs section of old release pages for patches.
|
# Check the Bugs section of old release pages for patches.
|
||||||
@ -63,4 +68,8 @@ def configure_args(self):
|
|||||||
args = [
|
args = [
|
||||||
'--with-gmp=' + self.spec['gmp'].prefix,
|
'--with-gmp=' + self.spec['gmp'].prefix,
|
||||||
]
|
]
|
||||||
|
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
|
return args
|
||||||
|
Loading…
Reference in New Issue
Block a user