Support for old gcc compilers #2003

This commit is contained in:
Thomas Nagy 2017-07-30 17:22:04 +02:00
parent 88bb8cc6a1
commit 10a2b6bd04
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
3 changed files with 20 additions and 0 deletions

View File

@ -1424,3 +1424,21 @@ def multicheck(self, *k, **kw):
if x.args.get('mandatory', True):
self.fatal(kw.get('fatalmsg') or 'One of the tests has failed, read config.log for more information')
@conf
def check_gcc_o_space(self, mode='c'):
if int(self.env.CC_VERSION[0]) > 4:
# this is for old compilers
return
self.env.stash()
if mode == 'c':
self.env.CCLNK_TGT_F = ['-o', '']
elif mode == 'cxx':
self.env.CXXLNK_TGT_F = ['-o', '']
features = '%s %sshlib' % (mode, mode)
try:
self.check(msg='Checking if the -o link must be split from arguments', fragment=SNIP_EMPTY_PROGRAM, features=features)
except self.errors.ConfigurationError:
self.env.revert()
else:
self.env.commit()

View File

@ -152,4 +152,5 @@ def configure(conf):
conf.cc_load_tools()
conf.cc_add_flags()
conf.link_add_flags()
conf.check_gcc_o_space()

View File

@ -153,4 +153,5 @@ def configure(conf):
conf.cxx_load_tools()
conf.cxx_add_flags()
conf.link_add_flags()
conf.check_gcc_o_space('cxx')