s3-waf: Detect which version of krb5_enctype_to_string is used
[Samba/gebeck_regimport.git] / source4 / wscript
blobf018094f1c7d196fc498a5eb4ba87fb96a5dbe39
1 #! /usr/bin/env python
3 srcdir = '..'
4 blddir = 'bin'
6 APPNAME='samba'
8 import sys, os
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 # install in /usr/local/samba by default
19 Options.default_prefix = '/usr/local/samba'
22 def set_options(opt):
23 opt.BUILTIN_DEFAULT('NONE')
24 opt.BUNDLED_EXTENSION_DEFAULT('samba4')
25 opt.RECURSE('../lib/replace')
26 opt.RECURSE('dynconfig')
27 opt.RECURSE('scripting/python')
28 opt.RECURSE('lib/ldb')
29 opt.RECURSE('selftest')
30 opt.RECURSE('lib/tls')
31 opt.RECURSE('../lib/nss_wrapper')
32 opt.RECURSE('../lib/socket_wrapper')
33 opt.RECURSE('../lib/uid_wrapper')
34 opt.RECURSE('../pidl')
36 gr = opt.option_group('developer options')
37 gr.add_option('--enable-build-farm',
38 help='enable special build farm options',
39 action='store_true', dest='BUILD_FARM')
42 def configure(conf):
43 conf.DEFINE('PACKAGE_NAME', 'samba', quote=True)
44 conf.DEFINE('PACKAGE_STRING', 'Samba ' + version.STRING, quote=True)
45 conf.DEFINE('PACKAGE_TARNAME', 'samba', quote=True)
46 conf.DEFINE('PACKAGE_URL', "http://www.samba.org/", quote=True)
47 conf.DEFINE('PACKAGE_VERSION', version.STRING, quote=True)
48 conf.DEFINE('PACKAGE_BUGREPORT', 'http://bugzilla.samba.org/', quote=True)
50 conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
51 conf.DEFINE('_SAMBA_BUILD_', version.MAJOR, add_to_cflags=True)
52 conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
54 if Options.options.developer:
55 conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
57 # this enables smbtorture.static for s3 in the build farm
58 conf.env.BUILD_FARM = Options.options.BUILD_FARM or os.environ.get('RUN_FROM_BUILD_FARM')
60 # set a lower limit on recursing in waf preprocessor
61 conf.env.preprocessor_recursion_limit = 10
63 conf.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include')
65 conf.RECURSE('../lib/replace')
67 conf.find_program('python', var='PYTHON', mandatory=True)
68 conf.find_program('perl', var='PERL', mandatory=True)
70 # enable tool to build python extensions
71 conf.check_tool('python')
72 conf.check_python_version((2,4,2))
73 conf.check_python_headers(mandatory=True)
75 conf.RECURSE('dynconfig')
76 conf.RECURSE('scripting/python')
77 conf.RECURSE('lib/ldb')
78 conf.RECURSE('heimdal_build')
79 conf.RECURSE('lib/tls')
80 conf.RECURSE('ntvfs/sysdep')
81 conf.RECURSE('../lib/util')
82 conf.RECURSE('../lib/zlib')
83 conf.RECURSE('../lib/util/charset')
84 conf.RECURSE('auth')
85 conf.RECURSE('../lib/nss_wrapper')
86 conf.RECURSE('../nsswitch')
87 conf.RECURSE('../lib/socket_wrapper')
88 conf.RECURSE('../lib/uid_wrapper')
89 conf.RECURSE('../lib/popt')
90 conf.RECURSE('lib/smbreadline')
91 conf.RECURSE('../pidl')
92 conf.RECURSE('selftest')
94 # we don't want PYTHONDIR in config.h, as otherwise changing
95 # --prefix causes a complete rebuild
96 del(conf.env.defines['PYTHONDIR'])
97 conf.SAMBA_CONFIG_H('include/config.h')
100 def etags(ctx):
101 '''build TAGS file using etags'''
102 import Utils
103 source_root = os.path.dirname(Utils.g_module.root_path)
104 cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root
105 print("Running: %s" % cmd)
106 os.system(cmd)
108 def ctags(ctx):
109 "build 'tags' file using ctags"
110 import Utils
111 source_root = os.path.dirname(Utils.g_module.root_path)
112 cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
113 print("Running: %s" % cmd)
114 os.system(cmd)
116 # putting this here enabled build in the list
117 # of commands in --help
118 def build(bld):
119 '''build all targets'''
120 pass
123 def pydoctor(ctx):
124 '''build python apidocs'''
125 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'
126 print("Running: %s" % cmd)
127 os.system(cmd)
129 def wafdocs(ctx):
130 '''build wafsamba apidocs'''
131 from samba_utils import recursive_dirlist
132 os.system('pwd')
133 list = recursive_dirlist('../buildtools/wafsamba', '.', pattern='*.py')
135 cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
136 print(list)
137 for f in list:
138 cmd += ' --add-module %s' % f
139 print("Running: %s" % cmd)
140 os.system(cmd)
143 def dist():
144 '''makes a tarball for distribution'''
145 samba_dist.dist()
147 def distcheck():
148 '''test that distribution tarball builds and installs'''
149 import Scripting
150 d = Scripting.distcheck
151 d(subdir='source4')
153 def wildcard_cmd(cmd):
154 '''called on a unknown command'''
155 from samba_wildcard import run_named_build_task
156 run_named_build_task(cmd)
158 def main():
159 from samba_wildcard import wildcard_main
160 wildcard_main(wildcard_cmd)
161 Scripting.main = main
163 def reconfigure(ctx):
164 '''reconfigure if config scripts have changed'''
165 import samba_utils
166 samba_utils.reconfigure(ctx)