diff --git a/var/spack/repos/builtin/packages/gdal/package.py b/var/spack/repos/builtin/packages/gdal/package.py index b6b78f80200..af3165db1f7 100644 --- a/var/spack/repos/builtin/packages/gdal/package.py +++ b/var/spack/repos/builtin/packages/gdal/package.py @@ -172,6 +172,7 @@ def setup_build_environment(self, env): # https://trac.osgeo.org/gdal/wiki/BuildHints def configure_args(self): spec = self.spec + libs = [] # Required dependencies args = [ @@ -294,6 +295,9 @@ def configure_args(self): # https://trac.osgeo.org/gdal/wiki/HDF if '+hdf4' in spec: args.append('--with-hdf4={0}'.format(spec['hdf'].prefix)) + hdf4 = self.spec['hdf'] + if '+libtirpc' in hdf4: + libs.append('-ltirpc') else: args.append('--with-hdf4=no') @@ -480,6 +484,9 @@ def configure_args(self): '--with-pdfium=no', ]) + if libs: + args.append('LIBS=' + ' '.join(libs)) + return args @run_after('install')