Remove ntdb from scripts
[bbaumbach/samba-autobuild/.git] / testsuite / headers / wscript_build
1 import os
2 from samba_utils import os_path_relpath
3
4 def build_test_headers(task):
5     '''symlink a header in the build tree'''
6     tgt = task.outputs[0].bldpath(task.env)
7     f = open(tgt, mode='w')
8     f.write('/* generated header test */\n')
9     hlist = task.env.public_headers_list[:]
10     hlist.sort()
11
12     for h in hlist:
13         f.write('#include "%s"\n' % os.path.normpath(h))
14     f.close()
15
16 relpath1 = os_path_relpath(bld.srcnode.abspath(), bld.curdir)
17 public_headers = []
18 for h in bld.env.public_headers_list:
19     public_headers.append(os.path.join(relpath1, bld.env.build_public_headers, h))
20
21 bld.SAMBA_GENERATOR('test_headers.h',
22                     group='main',
23                     rule=build_test_headers,
24                     source=public_headers,
25                     target='test_headers.h')
26
27 cflags=''
28 for lib in ['talloc', 'tevent', 'tdb', 'ldb', 'popt' ]:
29     ename = 'CPPPATH_%s' % lib.upper()
30     for p in bld.env[ename]:
31         cflags += bld.env.CPPPATH_ST % p + ' '
32
33 if not bld.env.USING_SYSTEM_POPT:
34     cflags += bld.env.CPPPATH_ST % '../third_party/popt'
35
36 if bld.env.DEVELOPER_MODE:
37     bld.SAMBA_BINARY('test_headers',
38                      source='test_headers.c',
39                      includes="#include/public",
40                      pyembed=True,
41                      cflags=cflags,
42                      local_include=True,
43                      global_include=False,
44                      use_global_deps=False,
45                      install=False)