gosamcontrib: add libs variants (#26030)

This commit is contained in:
iarspider 2021-09-24 10:00:02 +02:00 committed by GitHub
parent 2bcdb33666
commit 1299c714c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,6 +17,26 @@ class GosamContrib(AutotoolsPackage):
version('2.0', sha256='c05beceea74324eb51c1049773095e2cb0c09c8c909093ee913d8b0da659048d')
version('1.0', sha256='a29d4232d9190710246abc2ed97fdcd8790ce83580f56a360f3456b0377c40ec')
variant('libs', default='shared,static', values=('shared', 'static'),
multi=True, description='Build shared libs, static libs or both')
variant('pic', default=False, description='Build position-independent code')
def flag_handler(self, name, flags):
if name in ['cflags', 'cxxflags', 'cppflags']:
if '+pic' in self.spec:
flags.append(self.compiler.cc_pic_flag)
if name == 'fflags':
if 'gfortran' in self.compiler.fc:
flags.append('-std=legacy')
if '+pic' in self.spec:
flags.append(self.compiler.fc_pic_flag)
return (None, flags, None)
def configure_args(self):
args = ["FFLAGS=-std=legacy"]
args = []
args += self.enable_or_disable('libs')
return args