pvm: add fpic variant (#24954)

This commit is contained in:
Bryan Herman 2021-07-20 03:54:32 -04:00 committed by GitHub
parent 19677c5ad1
commit 4d5f7b361e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,9 @@ class Pvm(MakefilePackage):
depends_on('m4', type='build')
depends_on('libtirpc', type='link')
variant('fpic', default=False,
description='Enables -fPIC compilation flag on static libraries.')
parallel = False
@property
@ -34,6 +37,17 @@ def edit(self, spec, prefix):
# variable "PVM_ROOT" to the path where PVM resides
env['PVM_ROOT'] = self.stage.source_path
def patch(self):
pvm_arch = self.pvm_arch
if '+fpic' in self.spec:
filter_file(
'^SHAREDCFLAGS =',
'SHAREDCFLAGS = -fPIC',
join_path('conf', pvm_arch + '.def')
)
def setup_build_environment(self, env):
tirpc = self.spec['libtirpc'].prefix
env.prepend_path(