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.
This commit is contained in:
parent
6ddc518417
commit
f17c22dfb5
@ -23,6 +23,7 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from spack import *
|
from spack import *
|
||||||
|
from os import environ
|
||||||
|
|
||||||
|
|
||||||
class Zlib(AutotoolsPackage):
|
class Zlib(AutotoolsPackage):
|
||||||
@ -33,3 +34,14 @@ class Zlib(AutotoolsPackage):
|
|||||||
url = "http://zlib.net/zlib-1.2.8.tar.gz"
|
url = "http://zlib.net/zlib-1.2.8.tar.gz"
|
||||||
|
|
||||||
version('1.2.8', '44d667c142d7cda120332623eab69f40')
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user