7 VERSION
='4.0.0-alpha13'
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'
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 gr
= opt
.option_group('developer options')
34 gr
.add_option('--enable-build-farm',
35 help='enable special build farm options',
36 action
='store_true', dest
='BUILD_FARM')
40 conf
.DEFINE('PACKAGE_NAME', 'samba', quote
=True)
41 conf
.DEFINE('PACKAGE_STRING', 'samba 4', quote
=True)
42 conf
.DEFINE('PACKAGE_TARNAME', 'samba', quote
=True)
43 conf
.DEFINE('PACKAGE_URL', "http://www.samba.org/", quote
=True)
44 conf
.DEFINE('PACKAGE_VERSION', "4", quote
=True)
45 conf
.DEFINE('PACKAGE_BUGREPORT', 'http://bugzilla.samba.org/', quote
=True)
47 conf
.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
48 conf
.DEFINE('_SAMBA_BUILD_', 4, add_to_cflags
=True)
49 conf
.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags
=True)
51 if Options
.options
.developer
:
52 conf
.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
54 # this enables smbtorture.static for s3 in the build farm
55 conf
.env
.BUILD_FARM
= Options
.options
.BUILD_FARM
or os
.environ
.get('RUN_FROM_BUILD_FARM')
57 # set a lower limit on recursing in waf preprocessor
58 conf
.env
.preprocessor_recursion_limit
= 10
60 conf
.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include')
62 conf
.RECURSE('../lib/replace')
64 conf
.find_program('python', var
='PYTHON', mandatory
=True)
65 conf
.find_program('perl', var
='PERL', mandatory
=True)
67 # enable tool to build python extensions
68 conf
.check_tool('python')
69 conf
.check_python_version((2,4,2))
70 conf
.check_python_headers(mandatory
=True)
72 conf
.RECURSE('dynconfig')
73 conf
.RECURSE('scripting/python')
74 conf
.RECURSE('lib/ldb')
75 conf
.RECURSE('heimdal_build')
76 conf
.RECURSE('lib/tls')
77 conf
.RECURSE('ntvfs/sysdep')
78 conf
.RECURSE('../lib/util')
79 conf
.RECURSE('../lib/zlib')
80 conf
.RECURSE('../lib/util/charset')
82 conf
.RECURSE('../lib/nss_wrapper')
83 conf
.RECURSE('../nsswitch')
84 conf
.RECURSE('../lib/socket_wrapper')
85 conf
.RECURSE('../lib/uid_wrapper')
86 conf
.RECURSE('../lib/popt')
87 conf
.RECURSE('lib/smbreadline')
88 conf
.RECURSE('../pidl')
89 conf
.RECURSE('selftest')
91 # we don't want PYTHONDIR in config.h, as otherwise changing
92 # --prefix causes a complete rebuild
93 del(conf
.env
.defines
['PYTHONDIR'])
94 conf
.SAMBA_CONFIG_H('include/config.h')
98 '''build TAGS file using etags'''
100 source_root
= os
.path
.dirname(Utils
.g_module
.root_path
)
101 cmd
= 'etags $(find %s/.. -name "*.[ch]")' % source_root
102 print("Running: %s" % cmd
)
106 "build 'tags' file using ctags"
108 source_root
= os
.path
.dirname(Utils
.g_module
.root_path
)
109 cmd
= 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
110 print("Running: %s" % cmd
)
113 # putting this here enabled build in the list
114 # of commands in --help
116 '''build all targets'''
121 '''build python apidocs'''
122 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'
123 print("Running: %s" % cmd
)
127 '''build wafsamba apidocs'''
128 from samba_utils
import recursive_dirlist
130 list = recursive_dirlist('../buildtools/wafsamba', '.', pattern
='*.py')
132 cmd
='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
135 cmd
+= ' --add-module %s' % f
136 print("Running: %s" % cmd
)
141 '''makes a tarball for distribution'''
145 '''test that distribution tarball builds and installs'''
147 d
= Scripting
.distcheck