diff options
author | Andrey Prokopenko <aprokop@users.noreply.github.com> | 2016-12-03 19:43:44 -0500 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-12-03 16:43:44 -0800 |
commit | f17c22dfb57c457728eea0eaf0bc92144f4ad491 (patch) | |
tree | 1c541646e5587241dea320eb0e47e9bc8ab5a25e | |
parent | 6ddc518417976821e8c00cc33cbaf4f1f4ca4982 (diff) | |
download | spack-f17c22dfb57c457728eea0eaf0bc92144f4ad491.tar.gz spack-f17c22dfb57c457728eea0eaf0bc92144f4ad491.tar.bz2 spack-f17c22dfb57c457728eea0eaf0bc92144f4ad491.tar.xz spack-f17c22dfb57c457728eea0eaf0bc92144f4ad491.zip |
zlib: added 'pic' variant (#2470)
It looks more complicated because zlib has custom configure which does
not support CFLAGS option. So instead, we take it from environment.
-rw-r--r-- | var/spack/repos/builtin/packages/zlib/package.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/zlib/package.py b/var/spack/repos/builtin/packages/zlib/package.py index dfe7b4fdc1..5382146b5d 100644 --- a/var/spack/repos/builtin/packages/zlib/package.py +++ b/var/spack/repos/builtin/packages/zlib/package.py @@ -23,6 +23,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +from os import environ class Zlib(AutotoolsPackage): @@ -33,3 +34,14 @@ class Zlib(AutotoolsPackage): url = "http://zlib.net/zlib-1.2.8.tar.gz" version('1.2.8', '44d667c142d7cda120332623eab69f40') + + variant('pic', default=True, + description='Produce position-independent code (for shared libs)') + + def configure(self, spec, prefix): + + if '+pic' in spec: + environ['CFLAGS'] = self.compiler.pic_flag + + config_args = ['--prefix', prefix] + configure(*config_args) |