netcdf-fortran: add LDFLAGS to fix contents of libnetcdff.la. (#9647)

This commit is contained in:
Sergey Kosukhin 2018-11-14 16:40:16 +01:00 committed by Peter Scheibel
parent 6a08eb88b1
commit 75e86a61fe

View File

@ -28,9 +28,16 @@ def flag_handler(self, name, flags):
if name in ['cflags', 'fflags'] and '+pic' in self.spec:
flags.append(self.compiler.pic_flag)
elif name == 'cppflags':
flags.append('-I' + self.spec['netcdf'].prefix.include)
flags.append(self.spec['netcdf'].headers.cpp_flags)
elif name == 'ldflags':
# We need to specify LDFLAGS to get correct dependency_libs
# in libnetcdff.la, so packages that use libtool for linking
# could correctly link to all the dependencies even when the
# building takes place outside of Spack environment, i.e.
# without Spack's compiler wrappers.
flags.append(self.spec['netcdf'].libs.search_flags)
return (None, None, flags)
return None, None, flags
@property
def libs(self):