You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
waf/playground/ldscript/wscript

38 lines
800 B
Python

#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2009 (ita)
VERSION='0.0.1'
APPNAME='cc_test'
top = '.'
out = 'build'
def configure(conf):
conf.load('gcc')
def build(bld):
bld.program(
source = 'main.c',
target = 'test',
ldscript = 'myscript.ld',
linkflags = ['-nostdlib'],
)
from waflib import Errors
from waflib.TaskGen import after_method, feature
@after_method('propagate_uselib_vars')
@feature('cprogram', 'cshlib')
def process_ldscript(self):
if not getattr(self, 'ldscript', None) or self.env.CC_NAME != 'gcc':
return
node = self.path.find_resource(self.ldscript)
if not node:
raise Errors.WafError('could not find %r' % self.ldscript)
self.link_task.env.append_value('LINKFLAGS', '-Wl,-T,%s' % node.abspath())
self.link_task.dep_nodes.append(node)