mirror of https://gitlab.com/ita1024/waf.git
Merge branch 'gccdeps' into 'master'
gccdeps: Add support for gas See merge request ita1024/waf!2278
This commit is contained in:
commit
9fd0366fe7
|
@ -4,7 +4,7 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
conf.load('gcc gas')
|
conf.load('gcc gas gccdeps')
|
||||||
try:
|
try:
|
||||||
size = sys.maxint
|
size = sys.maxint
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
|
@ -27,7 +27,7 @@ if not c_preproc.go_absolute:
|
||||||
gccdeps_flags = ['-MMD']
|
gccdeps_flags = ['-MMD']
|
||||||
|
|
||||||
# Third-party tools are allowed to add extra names in here with append()
|
# Third-party tools are allowed to add extra names in here with append()
|
||||||
supported_compilers = ['gcc', 'icc', 'clang']
|
supported_compilers = ['gas', 'gcc', 'icc', 'clang']
|
||||||
|
|
||||||
def scan(self):
|
def scan(self):
|
||||||
if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS:
|
if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS:
|
||||||
|
@ -175,14 +175,14 @@ def wrap_compiled_task(classname):
|
||||||
derived_class.scan = scan
|
derived_class.scan = scan
|
||||||
derived_class.sig_implicit_deps = sig_implicit_deps
|
derived_class.sig_implicit_deps = sig_implicit_deps
|
||||||
|
|
||||||
for k in ('c', 'cxx'):
|
for k in ('asm', 'c', 'cxx'):
|
||||||
if k in Task.classes:
|
if k in Task.classes:
|
||||||
wrap_compiled_task(k)
|
wrap_compiled_task(k)
|
||||||
|
|
||||||
@before_method('process_source')
|
@before_method('process_source')
|
||||||
@feature('force_gccdeps')
|
@feature('force_gccdeps')
|
||||||
def force_gccdeps(self):
|
def force_gccdeps(self):
|
||||||
self.env.ENABLE_GCCDEPS = ['c', 'cxx']
|
self.env.ENABLE_GCCDEPS = ['asm', 'c', 'cxx']
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
# in case someone provides a --enable-gccdeps command-line option
|
# in case someone provides a --enable-gccdeps command-line option
|
||||||
|
@ -191,6 +191,15 @@ def configure(conf):
|
||||||
|
|
||||||
global gccdeps_flags
|
global gccdeps_flags
|
||||||
flags = conf.env.GCCDEPS_FLAGS or gccdeps_flags
|
flags = conf.env.GCCDEPS_FLAGS or gccdeps_flags
|
||||||
|
if conf.env.ASM_NAME in supported_compilers:
|
||||||
|
try:
|
||||||
|
conf.check(fragment='', features='asm force_gccdeps', asflags=flags, compile_filename='test.S', msg='Checking for asm flags %r' % ''.join(flags))
|
||||||
|
except Errors.ConfigurationError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
conf.env.append_value('ASFLAGS', flags)
|
||||||
|
conf.env.append_unique('ENABLE_GCCDEPS', 'asm')
|
||||||
|
|
||||||
if conf.env.CC_NAME in supported_compilers:
|
if conf.env.CC_NAME in supported_compilers:
|
||||||
try:
|
try:
|
||||||
conf.check(fragment='int main() { return 0; }', features='c force_gccdeps', cflags=flags, msg='Checking for c flags %r' % ''.join(flags))
|
conf.check(fragment='int main() { return 0; }', features='c force_gccdeps', cflags=flags, msg='Checking for c flags %r' % ''.join(flags))
|
||||||
|
|
Loading…
Reference in New Issue