diff options
author | Mark W. Krentel <krentel@rice.edu> | 2020-08-16 17:02:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-16 17:02:43 -0500 |
commit | 6e1f9b65e45fecf669830e1cbcbab2e7e4c6e76e (patch) | |
tree | 405607dffd7f20181feb327ff9f8208d552122be | |
parent | 93221f8bf9409fc8a038832301abba817529a6bb (diff) | |
download | spack-6e1f9b65e45fecf669830e1cbcbab2e7e4c6e76e.tar.gz spack-6e1f9b65e45fecf669830e1cbcbab2e7e4c6e76e.tar.bz2 spack-6e1f9b65e45fecf669830e1cbcbab2e7e4c6e76e.tar.xz spack-6e1f9b65e45fecf669830e1cbcbab2e7e4c6e76e.zip |
xz: add +pic variant (#18092)
xz-utils already builds a shared library. The +pic variant adds the
compiler pic flag to the static archive so that it can be linked into
another shared library.
-rw-r--r-- | var/spack/repos/builtin/packages/xz/package.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index 3839469231..5cb1548a2a 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -22,6 +22,14 @@ class Xz(AutotoolsPackage, SourceforgePackage): version('5.2.2', sha256='6ff5f57a4b9167155e35e6da8b529de69270efb2b4cf3fbabf41a4ee793840b5') version('5.2.0', sha256='f7357d7455a1670229b3cca021da71dd5d13b789db62743c20624bdffc9cc4a5') + variant('pic', default=False, + description='Compile with position independent code.') + + def flag_handler(self, name, flags): + if name == 'cflags' and '+pic' in self.spec: + flags.append(self.compiler.cc_pic_flag) + return (flags, None, None) + @property def libs(self): return find_libraries(['liblzma'], root=self.prefix, recursive=True) |