pdt: add PIC support as variant (#15851)

* Add fPIC support as variant

* Fix variant to use compiler agnostic fPIC option
This commit is contained in:
Carson Woods 2020-04-06 17:20:21 -04:00 committed by GitHub
parent 9d906658b3
commit 379319ee2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,8 @@ class Pdt(AutotoolsPackage):
version('3.19', sha256='d57234077e2e999f2acf9860ea84369a4694b50cc17fa6728e5255dc5f4a2160')
version('3.18.1', sha256='d06c2d1793fadebf169752511e5046d7e02cf3fead6135a35c34b1fee6d6d3b2')
variant('pic', default=False, description="Builds with pic")
def patch(self):
if self.spec.satisfies('%clang'):
filter_file(r'PDT_GXX=g\+\+ ',
@ -50,6 +52,9 @@ def configure(self, spec, prefix):
else:
raise InstallError('Unknown/unsupported compiler family')
if '+pic' in spec:
options.append('-useropt=' + self.compiler.pic_flag)
configure(*options)
@run_after('install')