Allow packages to control handling of compiler flags (#4421)

* Initial work on flag trapping using functions called <flag>_handler and default_flag_handler

* Update packages so they do not obliterate flags

* Added append to EnvironmentModifications class

* changed EnvironmentModifications to have append_flags method

* changed flag_val to be a tuple

* Increased test coverage

* added documentation of flag handling
This commit is contained in:
becker33
2017-07-19 20:12:00 -07:00
committed by GitHub
parent acca75b368
commit f962aba6ce
16 changed files with 203 additions and 12 deletions

View File

@@ -71,8 +71,15 @@ def install(self, spec, prefix):
if which('xiar'):
env['AR'] = 'xiar'
env['CFLAGS'] = optflags
env['FCFLAGS'] = optflags
if 'CFLAGS' in env and env['CFLAGS']:
env['CFLAGS'] += ' ' + optflags
else:
env['CFLAGS'] = optflags
if 'FCFLAGS' in env and env['FCFLAGS']:
env['FCFLAGS'] += ' ' + optflags
else:
env['FCFLAGS'] = optflags
configure('--prefix={0}'.format(prefix),
'--enable-shared')