s4:lib/messaging: terminate the irpc_servers_byname() result with server_id_set_disco...
[Samba/gebeck_regimport.git] / buildtools / wafadmin / Tools / gas.py
blobc983b0a39591c2e2c35384726729e93aad2494f5
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # Thomas Nagy, 2008 (ita)
5 "as and gas"
7 import os, sys
8 import Task
9 from TaskGen import extension, taskgen, after, before
11 EXT_ASM = ['.s', '.S', '.asm', '.ASM', '.spp', '.SPP']
13 as_str = '${AS} ${ASFLAGS} ${_ASINCFLAGS} ${SRC} -o ${TGT}'
14 Task.simple_task_type('asm', as_str, 'PINK', ext_out='.o', shell=False)
16 @extension(EXT_ASM)
17 def asm_hook(self, node):
18 # create the compilation task: cpp or cc
19 try: obj_ext = self.obj_ext
20 except AttributeError: obj_ext = '_%d.o' % self.idx
22 task = self.create_task('asm', node, node.change_ext(obj_ext))
23 self.compiled_tasks.append(task)
24 self.meths.append('asm_incflags')
26 @after('apply_obj_vars_cc')
27 @after('apply_obj_vars_cxx')
28 @before('apply_link')
29 def asm_incflags(self):
30 self.env.append_value('_ASINCFLAGS', self.env.ASINCFLAGS)
31 var = ('cxx' in self.features) and 'CXX' or 'CC'
32 self.env.append_value('_ASINCFLAGS', self.env['_%sINCFLAGS' % var])
34 def detect(conf):
35 conf.find_program(['gas', 'as'], var='AS')
36 if not conf.env.AS: conf.env.AS = conf.env.CC
37 #conf.env.ASFLAGS = ['-c'] <- may be necesary for .S files