source: trunk/server/lib/tdb/wscript@ 880

Last change on this file since 880 was 745, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated trunk to 3.6.0

File size: 4.6 KB
Line 
1#!/usr/bin/env python
2
3APPNAME = 'tdb'
4VERSION = '1.2.9'
5
6blddir = 'bin'
7
8import sys, os
9
10# find the buildtools directory
11srcdir = '.'
12while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
13 srcdir = '../' + srcdir
14sys.path.insert(0, srcdir + '/buildtools/wafsamba')
15
16import wafsamba, samba_dist, Options, Logs
17
18samba_dist.DIST_DIRS('lib/tdb:. lib/replace:lib/replace buildtools:buildtools')
19
20def set_options(opt):
21 opt.BUILTIN_DEFAULT('replace')
22 opt.PRIVATE_EXTENSION_DEFAULT('tdb', noextension='tdb')
23 opt.RECURSE('lib/replace')
24 if opt.IN_LAUNCH_DIR():
25 opt.add_option('--disable-python',
26 help=("disable the pytdb module"),
27 action="store_true", dest='disable_python', default=False)
28
29
30def configure(conf):
31 conf.RECURSE('lib/replace')
32
33 conf.env.standalone_tdb = conf.IN_LAUNCH_DIR()
34
35 if not conf.env.standalone_tdb:
36 if conf.CHECK_BUNDLED_SYSTEM('tdb', minversion=VERSION,
37 implied_deps='replace'):
38 conf.define('USING_SYSTEM_TDB', 1)
39 if conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytdb', 'tdb', minversion=VERSION):
40 conf.define('USING_SYSTEM_PYTDB', 1)
41
42 conf.env.disable_python = getattr(Options.options, 'disable_python', False)
43
44 conf.CHECK_XSLTPROC_MANPAGES()
45
46 if not conf.env.disable_python:
47 # also disable if we don't have the python libs installed
48 conf.check_tool('python')
49 conf.check_python_version((2,4,2))
50 conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False)
51 if not conf.env.HAVE_PYTHON_H:
52 Logs.warn('Disabling pytdb as python devel libs not found')
53 conf.env.disable_python = True
54
55 conf.SAMBA_CONFIG_H()
56
57def build(bld):
58 bld.RECURSE('lib/replace')
59
60 COMMON_SRC = bld.SUBDIR('common',
61 '''check.c error.c tdb.c traverse.c
62 freelistcheck.c lock.c dump.c freelist.c
63 io.c open.c transaction.c hash.c summary.c''')
64
65 if bld.env.standalone_tdb:
66 bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
67 bld.PKG_CONFIG_FILES('tdb.pc', vnum=VERSION)
68 private_library = False
69 else:
70 private_library = True
71
72 if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
73 bld.SAMBA_LIBRARY('tdb',
74 COMMON_SRC,
75 deps='replace',
76 includes='include',
77 abi_directory='ABI',
78 abi_match='tdb_*',
79 hide_symbols=True,
80 vnum=VERSION,
81 public_headers='include/tdb.h',
82 public_headers_install=not private_library,
83 private_library=private_library)
84
85 bld.SAMBA_BINARY('tdbtorture',
86 'tools/tdbtorture.c',
87 'tdb',
88 install=False)
89
90 bld.SAMBA_BINARY('tdbrestore',
91 'tools/tdbrestore.c',
92 'tdb', manpages='manpages/tdbrestore.8')
93
94 bld.SAMBA_BINARY('tdbdump',
95 'tools/tdbdump.c',
96 'tdb', manpages='manpages/tdbdump.8')
97
98 bld.SAMBA_BINARY('tdbbackup',
99 'tools/tdbbackup.c',
100 'tdb',
101 manpages='manpages/tdbbackup.8')
102
103 bld.SAMBA_BINARY('tdbtool',
104 'tools/tdbtool.c',
105 'tdb', manpages='manpages/tdbtool.8')
106
107 if not bld.CONFIG_SET('USING_SYSTEM_PYTDB'):
108 bld.SAMBA_PYTHON('pytdb',
109 'pytdb.c',
110 deps='tdb',
111 enabled=not bld.env.disable_python,
112 realname='tdb.so',
113 cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
114
115
116
117def test(ctx):
118 '''run tdb testsuite'''
119 import Utils, samba_utils, shutil
120 test_prefix = "%s/st" % (Utils.g_module.blddir)
121 shutil.rmtree(test_prefix, ignore_errors=True)
122 os.makedirs(test_prefix)
123 os.environ['TEST_DATA_PREFIX'] = test_prefix
124 cmd = os.path.join(Utils.g_module.blddir, 'tdbtorture')
125 ret = samba_utils.RUN_COMMAND(cmd)
126 print("testsuite returned %d" % ret)
127 sys.exit(ret)
128
129def dist():
130 '''makes a tarball for distribution'''
131 samba_dist.dist()
132
133def reconfigure(ctx):
134 '''reconfigure if config scripts have changed'''
135 import samba_utils
136 samba_utils.reconfigure(ctx)
Note: See TracBrowser for help on using the repository browser.