7 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
8 import wafsamba, Options
10 # install in /usr/local/samba by default
11 Options.default_prefix = '/usr/local/samba'
15 opt.BUILTIN_DEFAULT('NONE')
16 opt.BUNDLED_EXTENSION_DEFAULT('samba4')
17 opt.recurse('../lib/replace')
18 opt.recurse('dynconfig')
19 opt.recurse('scripting/python')
20 opt.recurse('lib/ldb')
21 opt.recurse('selftest')
22 opt.recurse('lib/tls')
23 opt.recurse('../lib/nss_wrapper')
24 opt.recurse('../lib/socket_wrapper')
25 opt.recurse('../lib/uid_wrapper')
26 opt.recurse('../pidl')
29 conf.DEFINE('PACKAGE_NAME', 'samba', quote=True)
30 conf.DEFINE('PACKAGE_STRING', 'samba 4', quote=True)
31 conf.DEFINE('PACKAGE_TARNAME', 'samba', quote=True)
32 conf.DEFINE('PACKAGE_URL', "http://www.samba.org/", quote=True)
33 conf.DEFINE('PACKAGE_VERSION', "4", quote=True)
34 conf.DEFINE('PACKAGE_BUGREPORT', 'http://bugzilla.samba.org/', quote=True)
36 conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
37 conf.DEFINE('_SAMBA_BUILD_', 4, add_to_cflags=True)
38 conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
40 if Options.options.developer:
41 conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
43 # set a lower limit on recursing in waf preprocessor
44 conf.env.preprocessor_recursion_limit = 10
46 conf.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include')
48 conf.sub_config('../lib/replace')
50 conf.find_program('python', var='PYTHON', mandatory=True)
51 conf.find_program('perl', var='PERL', mandatory=True)
53 # enable tool to build python extensions
54 conf.check_tool('python')
55 conf.check_python_version((2,4,2))
56 conf.check_python_headers()
58 conf.sub_config('dynconfig')
59 conf.sub_config('scripting/python')
60 conf.sub_config('lib/ldb')
61 conf.sub_config('heimdal_build')
62 conf.sub_config('lib/tls')
63 conf.sub_config('ntvfs/sysdep')
64 conf.sub_config('../lib/util')
65 conf.sub_config('../lib/zlib')
66 conf.sub_config('../lib/util/charset')
67 conf.sub_config('auth')
68 conf.sub_config('../lib/nss_wrapper')
69 conf.sub_config('../nsswitch')
70 conf.sub_config('../lib/socket_wrapper')
71 conf.sub_config('../lib/uid_wrapper')
72 conf.sub_config('../lib/popt')
73 conf.sub_config('lib/smbreadline')
74 conf.sub_config('../pidl')
76 # we don't want PYTHONDIR in config.h, as otherwise changing
77 # --prefix causes a complete rebuild
78 del(conf.env.defines['PYTHONDIR'])
79 conf.SAMBA_CONFIG_H('include/config.h')
83 '''build TAGS file using etags'''
85 source_root = os.path.dirname(Utils.g_module.root_path)
86 cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root
87 print "Running: %s" % cmd
91 "build 'tags' file using ctags"
93 source_root = os.path.dirname(Utils.g_module.root_path)
94 cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
95 print "Running: %s" % cmd
98 # putting this here enabled build in the list
99 # of commands in --help
101 '''build all targets'''
106 '''build python apidocs'''
107 cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package bin/python/samba'
108 print "Running: %s" % cmd
112 '''build wafsamba apidocs'''
113 from samba_utils import recursive_dirlist
115 list = recursive_dirlist('../buildtools/wafsamba', '.', pattern='*.py')
117 cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
120 cmd += ' --add-module %s' % f
121 print "Running: %s" % cmd