diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/netcdf-fortran/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/netcdf-fortran/package.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/netcdf-fortran/package.py b/var/spack/repos/builtin/packages/netcdf-fortran/package.py index 51ff028276..1b55df1507 100644 --- a/var/spack/repos/builtin/packages/netcdf-fortran/package.py +++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py @@ -64,12 +64,16 @@ class NetcdfFortran(AutotoolsPackage): def flag_handler(self, name, flags): config_flags = None - if name in ['cflags', 'fflags'] and '+pic' in self.spec: + if '+pic' in self.spec: # Unlike NetCDF-C, we add PIC flag only when +pic. Adding the # flags also when ~shared would make it impossible to build a # static-only version of the library with NAG. - config_flags = [self.compiler.pic_flag] - elif name == 'cppflags': + if name == 'cflags': + config_flags = [self.compiler.cc_pic_flag] + elif name == 'fflags': + config_flags = [self.compiler.f77_pic_flag] + + if name == 'cppflags': config_flags = [self.spec['netcdf-c'].headers.cpp_flags] elif name == 'ldflags': # We need to specify LDFLAGS to get correct dependency_libs |