2 from Configure import conf
6 samba = os.path.abspath('../samba')
9 def win32_program(self, *k, **kw):
10 kw['features'] = 'c cprogram'
11 kw['env'] = self.env.copy()
12 kw['env'].update({"CC": kw['cc'], "LINK_CC": kw['cc']})
16 ctx.load('compiler_c')
19 platform = ['mingw32', 'mingw32msvc']
20 ctx.find_program([ a + '-' + p + '-gcc' for a in ['i386', 'i586'] for p in platform], var='CC_WIN32')
21 ctx.find_program([ a + '-' + p + '-gcc' for a in ['x86_64', 'amd64'] for p in platform], var='CC_WIN64')
22 ctx.load('compiler_c')
23 os.system('cd ' + samba + ' && grep -q "bld.RECURSE(\'../source\')" wscript_build || sed -i "s#bld.RECURSE(\'source3\')#bld.RECURSE(\'source3\')\\nbld.RECURSE(\'../source\')#" wscript_build')
24 os.system('cd ' + samba + ' && ./buildtools/bin/waf configure')
27 if bld.env._SAMBA_BUILD_ == 4:
30 source='winexe.c svcinstall.c async.c build/winexesvc32_exe.c build/winexesvc64_exe.c',
31 deps='POPT_SAMBA POPT_CREDENTIALS dcerpc')
34 bld.win32_program(target='winexesvc32.exe', source='winexesvc_launch.c winexesvc_loop.c', cc=bld.env.CC_WIN32)
35 bld.win32_program(target='winexesvc64.exe', source='winexesvc_launch.c winexesvc_loop.c', cc=bld.env.CC_WIN64)
36 bld.program(target='bin2c', source='bin2c.c', cflags='')
38 bld(rule='${SRC[0].abspath()} winexesvc32_exe ${SRC[1]} > ${TGT}', target='winexesvc32_exe.c', source='bin2c winexesvc32.exe')
39 bld(rule='${SRC[0].abspath()} winexesvc64_exe ${SRC[1]} > ${TGT}', target='winexesvc64_exe.c', source='bin2c winexesvc64.exe')
41 bld(rule='cd ' + samba + ' && ./buildtools/bin/waf build --targets=winexe && cp bin/winexe ${TGT[0].abspath()}',
43 source='winexe.c svcinstall.c async.c winexesvc32_exe.c winexesvc64_exe.c')