s4-smbtorture: avoid passing down a full test_spoolss_context to directory
[Samba/ekacnet.git] / source4 / wscript
bloba1ca61f0a12c72b24818ce0867f0987562ce477b
1 #! /usr/bin/env python
3 srcdir = '..'
4 blddir = 'bin'
6 APPNAME='samba'
7 VERSION='4.0.0-alpha13'
9 import sys, os
10 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
11 import wafsamba, Options, samba_dist
13 samba_dist.DIST_DIRS('.')
15 # install in /usr/local/samba by default
16 Options.default_prefix = '/usr/local/samba'
19 def set_options(opt):
20 opt.BUILTIN_DEFAULT('NONE')
21 opt.BUNDLED_EXTENSION_DEFAULT('samba4')
22 opt.RECURSE('../lib/replace')
23 opt.RECURSE('dynconfig')
24 opt.RECURSE('scripting/python')
25 opt.RECURSE('lib/ldb')
26 opt.RECURSE('selftest')
27 opt.RECURSE('lib/tls')
28 opt.RECURSE('../lib/nss_wrapper')
29 opt.RECURSE('../lib/socket_wrapper')
30 opt.RECURSE('../lib/uid_wrapper')
31 opt.RECURSE('../pidl')
33 def configure(conf):
34 conf.DEFINE('PACKAGE_NAME', 'samba', quote=True)
35 conf.DEFINE('PACKAGE_STRING', 'samba 4', quote=True)
36 conf.DEFINE('PACKAGE_TARNAME', 'samba', quote=True)
37 conf.DEFINE('PACKAGE_URL', "http://www.samba.org/", quote=True)
38 conf.DEFINE('PACKAGE_VERSION', "4", quote=True)
39 conf.DEFINE('PACKAGE_BUGREPORT', 'http://bugzilla.samba.org/', quote=True)
41 conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
42 conf.DEFINE('_SAMBA_BUILD_', 4, add_to_cflags=True)
43 conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
45 if Options.options.developer:
46 conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
48 # set a lower limit on recursing in waf preprocessor
49 conf.env.preprocessor_recursion_limit = 10
51 conf.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include')
53 conf.RECURSE('../lib/replace')
55 conf.find_program('python', var='PYTHON', mandatory=True)
56 conf.find_program('perl', var='PERL', mandatory=True)
58 # enable tool to build python extensions
59 conf.check_tool('python')
60 conf.check_python_version((2,4,2))
61 conf.check_python_headers()
63 conf.RECURSE('dynconfig')
64 conf.RECURSE('scripting/python')
65 conf.RECURSE('lib/ldb')
66 conf.RECURSE('heimdal_build')
67 conf.RECURSE('lib/tls')
68 conf.RECURSE('ntvfs/sysdep')
69 conf.RECURSE('../lib/util')
70 conf.RECURSE('../lib/zlib')
71 conf.RECURSE('../lib/util/charset')
72 conf.RECURSE('auth')
73 conf.RECURSE('../lib/nss_wrapper')
74 conf.RECURSE('../nsswitch')
75 conf.RECURSE('../lib/socket_wrapper')
76 conf.RECURSE('../lib/uid_wrapper')
77 conf.RECURSE('../lib/popt')
78 conf.RECURSE('lib/smbreadline')
79 conf.RECURSE('../pidl')
81 # we don't want PYTHONDIR in config.h, as otherwise changing
82 # --prefix causes a complete rebuild
83 del(conf.env.defines['PYTHONDIR'])
84 conf.SAMBA_CONFIG_H('include/config.h')
87 def etags(ctx):
88 '''build TAGS file using etags'''
89 import Utils
90 source_root = os.path.dirname(Utils.g_module.root_path)
91 cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root
92 print "Running: %s" % cmd
93 os.system(cmd)
95 def ctags(ctx):
96 "build 'tags' file using ctags"
97 import Utils
98 source_root = os.path.dirname(Utils.g_module.root_path)
99 cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
100 print "Running: %s" % cmd
101 os.system(cmd)
103 # putting this here enabled build in the list
104 # of commands in --help
105 def build(bld):
106 '''build all targets'''
107 pass
110 def pydoctor(ctx):
111 '''build python apidocs'''
112 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'
113 print "Running: %s" % cmd
114 os.system(cmd)
116 def wafdocs(ctx):
117 '''build wafsamba apidocs'''
118 from samba_utils import recursive_dirlist
119 os.system('pwd')
120 list = recursive_dirlist('../buildtools/wafsamba', '.', pattern='*.py')
122 cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
123 print list
124 for f in list:
125 cmd += ' --add-module %s' % f
126 print "Running: %s" % cmd
127 os.system(cmd)
130 def dist():
131 '''makes a tarball for distribution'''
132 samba_dist.dist()
134 def distcheck():
135 '''test that distribution tarball builds and installs'''
136 import Scripting
137 d = Scripting.distcheck
138 d(subdir='source4')