build: added ADD_CFLAGS() and started of Samba4 build
[samba.git] / source4 / lib / ldb / wscript
1 VERSION = '0.9.10'
2
3 srcdir = '../../..'
4 blddir = 'bin'
5
6 LIBTDB_DIR= srcdir + '/lib/tdb'
7 LIBTEVENT_DIR= srcdir + '/lib/tevent'
8
9 def set_options(opt):
10     opt.recurse(LIBTDB_DIR)
11     opt.recurse(LIBTEVENT_DIR)
12
13 def configure(conf):
14     conf.sub_config(LIBTDB_DIR)
15     conf.sub_config(LIBTEVENT_DIR)
16     conf.CONFIG_PATH('LDB_MODULESDIR', conf.env['LIBDIR'] + '/ldb')
17     conf.SAMBA_CONFIG_H()
18
19 def build(bld):
20     bld.add_subdirs(LIBTDB_DIR)
21     bld.add_subdirs(LIBTEVENT_DIR)
22
23     LDB_TDB_SRC = bld.SUBDIR('ldb_tdb',
24                              '''ldb_tdb.c ldb_pack.c ldb_search.c ldb_index.c
25                              ldb_cache.c ldb_tdb_wrap.c''')
26
27     LDB_MAP_SRC = bld.SUBDIR('ldb_map',
28                              'ldb_map.c ldb_map_inbound.c ldb_map_outbound.c')
29
30     COMMON_SRC = bld.SUBDIR('common',
31                             '''ldb.c ldb_ldif.c ldb_parse.c ldb_msg.c ldb_utf8.c
32                             ldb_debug.c ldb_modules.c ldb_dn.c ldb_match.c
33                             ldb_attributes.c attrib_handlers.c ldb_controls.c qsort.c''')
34
35     MODULES_SRC = bld.SUBDIR('modules',
36                              'rdn_name.c asq.c paged_results.c sort.c')
37
38     bld.SAMBA_LIBRARY('ldb',
39                       LDB_TDB_SRC + ' ' + COMMON_SRC + ' ' + MODULES_SRC,
40                       deps='tdb tevent',
41                       include_list='include',
42                       vnum=VERSION)
43
44     LDB_TOOLS='ldbadd ldbsearch ldbdel ldbmodify ldbedit ldbrename ldbtest'
45     for t in LDB_TOOLS.split():
46         bld.SAMBA_BINARY(t,
47                          'tools/%s.c tools/ldbutil.c tools/cmdline.c' % t,
48                          deps='ldb',
49                          syslibs='dl popt')