s3-torture/denytest.c: replace cli_read_old() with cli_read()
[Samba/gebeck_regimport.git] / testsuite / headers / wscript_build
blobf83538ef090cf9f5daa0eaeb8cf9516a6f7105ef
1 import os
2 from samba_utils import os_path_relpath
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     for h in hlist:
12         f.write('#include "%s"\n' % os.path.normpath(h))
13     f.close()
15 relpath1 = os_path_relpath(bld.srcnode.abspath(), bld.curdir)
16 public_headers = []
17 for h in bld.env.public_headers_list:
18     public_headers.append(os.path.join(relpath1, bld.env.build_public_headers, h))
20 bld.SAMBA_GENERATOR('test_headers.h',
21                     group='main',
22                     rule=build_test_headers,
23                     source=public_headers,
24                     target='test_headers.h')
26 cflags=''
27 for lib in ['talloc', 'tevent', 'tdb', 'ldb', 'popt' ]:
28     ename = 'CPPPATH_%s' % lib.upper()
29     for p in bld.env[ename]:
30         cflags += bld.env.CPPPATH_ST % p + ' '
32 if not bld.env.USING_SYSTEM_POPT:
33     cflags += bld.env.CPPPATH_ST % '../lib/popt'
35 if bld.env.DEVELOPER_MODE:
36     bld.SAMBA_BINARY('test_headers',
37                      source='test_headers.c',
38                      includes="#include/public",
39                      pyembed=True,
40                      cflags=cflags,
41                      local_include=True,
42                      global_include=False,
43                      use_global_deps=False,
44                      install=False)