11 # find the buildtools directory
13 while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
14 srcdir = '../' + srcdir
15 sys.path.insert(0, srcdir + '/buildtools/wafsamba')
18 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
19 import wafsamba, samba_dist, Options
21 # setup what directories to put in a tarball
22 samba_dist.DIST_DIRS('lib/talloc:. lib/replace:lib/replace buildtools:buildtools')
26 opt.BUILTIN_DEFAULT('replace')
27 opt.PRIVATE_EXTENSION_DEFAULT('talloc', noextension='talloc')
28 opt.RECURSE('lib/replace')
29 opt.add_option('--enable-talloc-compat1',
30 help=("Build talloc 1.x.x compat library [False]"),
31 action="store_true", dest='TALLOC_COMPAT1', default=False)
34 conf.RECURSE('lib/replace')
36 conf.env.standalone_talloc = conf.IN_LAUNCH_DIR()
38 if not conf.env.standalone_talloc:
39 if conf.CHECK_BUNDLED_SYSTEM('talloc', minversion=VERSION,
40 implied_deps='replace'):
41 conf.define('USING_SYSTEM_TALLOC', 1)
43 conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
45 if conf.env.standalone_talloc:
46 conf.find_program('xsltproc', var='XSLTPROC')
53 bld.RECURSE('lib/replace')
55 if bld.env.standalone_talloc:
56 bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
57 bld.env.TALLOC_VERSION = VERSION
58 bld.PKG_CONFIG_FILES('talloc.pc', vnum=VERSION)
59 bld.INSTALL_FILES('${INCLUDEDIR}', 'talloc.h')
60 private_library = False
63 # should we also install the symlink to libtalloc1.so here?
64 bld.SAMBA_LIBRARY('talloc-compat1',
65 'compat/talloc_compat1.c',
67 enabled = bld.env.TALLOC_COMPAT1,
70 private_library = True
73 if not bld.CONFIG_SET('USING_SYSTEM_TALLOC'):
75 bld.SAMBA_LIBRARY('talloc',
78 abi_file='ABI/talloc-%s.sigs' % VERSION,
79 abi_match='talloc* _talloc*',
82 private_library=private_library,
85 if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL'):
87 bld.SAMBA_SUBSYSTEM('PYTALLOC',
89 public_deps='EXT_LIB_PYTHON talloc',
93 if not getattr(bld.env, '_SAMBA_BUILD_', 0) == 4:
94 # s4 already has the talloc testsuite builtin to smbtorture
95 bld.SAMBA_BINARY('talloc_testsuite',
96 'testsuite_main.c testsuite.c',
102 '''run talloc testsuite'''
103 import Utils, samba_utils
104 cmd = os.path.join(Utils.g_module.blddir, 'talloc_testsuite')
105 ret = samba_utils.RUN_COMMAND(cmd)
106 print("testsuite returned %d" % ret)
110 '''makes a tarball for distribution'''