hdf5: avoid compilation with -I/usr/include (#22808)

This commit is contained in:
Sergey Kosukhin 2021-04-07 18:49:16 +02:00 committed by GitHub
parent ccc90e3a79
commit 253c0d0ebb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,8 @@
import shutil
import sys
from spack.util.environment import is_system_path
class Hdf5(AutotoolsPackage):
"""HDF5 is a data model, library, and file format for storing and managing
@ -249,8 +251,14 @@ def configure_args(self):
# combinations of other arguments. Enabling it just skips a
# sanity check in configure, so this doesn't merit a variant.
extra_args = ['--enable-unsupported',
'--enable-symbols=yes',
'--with-zlib=%s' % self.spec['zlib'].prefix]
'--enable-symbols=yes']
# Do not specify the prefix of zlib if it is in a system directory
# (see https://github.com/spack/spack/pull/21900).
zlib_prefix = self.spec['zlib'].prefix
extra_args.append('--with-zlib={0}'.format(
'yes' if is_system_path(zlib_prefix) else zlib_prefix))
extra_args += self.enable_or_disable('threadsafe')
extra_args += self.enable_or_disable('cxx')
extra_args += self.enable_or_disable('hl')