9 sys
.path
.insert(0, srcdir
+"/buildtools/wafsamba")
10 import wafsamba
, Options
, samba_dist
, Scripting
12 version
= wafsamba
.samba_version_file("./VERSION")
14 VERSION
=version
.STRING
16 samba_dist
.DIST_DIRS('.')
18 #This is a list of files that we don't want in the package, for
19 #whatever reason. Directories should be listed with a trailing / to
20 #avoid over-exclusion.
22 #This list includes files that would confuse the recipient of a
23 #samba-4.0.0 branded tarball (until the merge is complete) and the
24 #core elements of the autotools build system (which is known to
25 #produce buggy binaries).
26 samba_dist
.DIST_BLACKLIST('README Manifest Read-Manifest-Now Roadmap source3/ ' +
27 'packaging/ docs-xml/ examples/ swat/ WHATSNEW.txt MAINTAINERS ' +
28 'source4/autogen-autotools.sh source4/Makefile.in source4/configure.ac')
29 # install in /usr/local/samba by default
30 Options
.default_prefix
= '/usr/local/samba'
34 opt
.BUILTIN_DEFAULT('replace')
35 opt
.BUNDLED_EXTENSION_DEFAULT('samba4')
36 opt
.RECURSE('../lib/replace')
37 opt
.RECURSE('dynconfig')
38 opt
.RECURSE('scripting/python')
39 opt
.RECURSE('lib/ldb')
40 opt
.RECURSE('selftest')
41 opt
.RECURSE('lib/tls')
42 opt
.RECURSE('../lib/nss_wrapper')
43 opt
.RECURSE('../lib/socket_wrapper')
44 opt
.RECURSE('../lib/uid_wrapper')
45 opt
.RECURSE('../pidl')
47 gr
= opt
.option_group('developer options')
48 gr
.add_option('--enable-build-farm',
49 help='enable special build farm options',
50 action
='store_true', dest
='BUILD_FARM')
54 conf
.DEFINE('PACKAGE_NAME', 'samba', quote
=True)
55 conf
.DEFINE('PACKAGE_STRING', 'Samba ' + version
.STRING
, quote
=True)
56 conf
.DEFINE('PACKAGE_TARNAME', 'samba', quote
=True)
57 conf
.DEFINE('PACKAGE_URL', "http://www.samba.org/", quote
=True)
58 conf
.DEFINE('PACKAGE_VERSION', version
.STRING
, quote
=True)
59 conf
.DEFINE('PACKAGE_BUGREPORT', 'http://bugzilla.samba.org/', quote
=True)
61 conf
.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
62 conf
.DEFINE('_SAMBA_BUILD_', version
.MAJOR
, add_to_cflags
=True)
63 conf
.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags
=True)
65 if Options
.options
.developer
:
66 conf
.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
68 # this enables smbtorture.static for s3 in the build farm
69 conf
.env
.BUILD_FARM
= Options
.options
.BUILD_FARM
or os
.environ
.get('RUN_FROM_BUILD_FARM')
71 # set a lower limit on recursing in waf preprocessor
72 conf
.env
.preprocessor_recursion_limit
= 10
74 conf
.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include')
76 conf
.RECURSE('../lib/replace')
78 conf
.find_program('python', var
='PYTHON', mandatory
=True)
79 conf
.find_program('perl', var
='PERL', mandatory
=True)
80 conf
.find_program('xsltproc', var
='XSLTPROC')
82 # enable tool to build python extensions
83 conf
.check_tool('python')
84 conf
.check_python_version((2,4,2))
85 conf
.check_python_headers(mandatory
=True)
87 conf
.RECURSE('dynconfig')
88 conf
.RECURSE('scripting/python')
89 conf
.RECURSE('lib/ldb')
90 conf
.RECURSE('heimdal_build')
91 conf
.RECURSE('lib/tls')
92 conf
.RECURSE('ntvfs/sysdep')
93 conf
.RECURSE('../lib/util')
94 conf
.RECURSE('../lib/zlib')
95 conf
.RECURSE('../lib/util/charset')
97 conf
.RECURSE('../lib/nss_wrapper')
98 conf
.RECURSE('../nsswitch')
99 conf
.RECURSE('../lib/socket_wrapper')
100 conf
.RECURSE('../lib/uid_wrapper')
101 conf
.RECURSE('../lib/popt')
102 conf
.RECURSE('lib/smbreadline')
103 conf
.RECURSE('../pidl')
104 conf
.RECURSE('selftest')
106 # we don't want PYTHONDIR in config.h, as otherwise changing
107 # --prefix causes a complete rebuild
108 del(conf
.env
.defines
['PYTHONDIR'])
109 conf
.SAMBA_CONFIG_H('include/config.h')
113 '''build TAGS file using etags'''
115 source_root
= os
.path
.dirname(Utils
.g_module
.root_path
)
116 cmd
= 'etags $(find %s/.. -name "*.[ch]")' % source_root
117 print("Running: %s" % cmd
)
121 "build 'tags' file using ctags"
123 source_root
= os
.path
.dirname(Utils
.g_module
.root_path
)
124 cmd
= 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
125 print("Running: %s" % cmd
)
128 # putting this here enabled build in the list
129 # of commands in --help
131 '''build all targets'''
136 '''build python apidocs'''
137 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'
138 print("Running: %s" % cmd
)
142 '''build wafsamba apidocs'''
143 from samba_utils
import recursive_dirlist
145 list = recursive_dirlist('../buildtools/wafsamba', '.', pattern
='*.py')
147 cmd
='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
150 cmd
+= ' --add-module %s' % f
151 print("Running: %s" % cmd
)
156 '''makes a tarball for distribution'''
160 '''test that distribution tarball builds and installs'''
162 d
= Scripting
.distcheck
165 def wildcard_cmd(cmd
):
166 '''called on a unknown command'''
167 from samba_wildcard
import run_named_build_task
168 run_named_build_task(cmd
)
171 from samba_wildcard
import wildcard_main
172 wildcard_main(wildcard_cmd
)
173 Scripting
.main
= main
175 def reconfigure(ctx
):
176 '''reconfigure if config scripts have changed'''
178 samba_utils
.reconfigure(ctx
)