2010-03-17 13:46:38 +03:00
#! /usr/bin/env python
2010-03-17 12:26:03 +03:00
srcdir = '..'
blddir = 'bin'
2010-04-04 03:57:33 +04:00
APPNAME='samba'
VERSION='4.0.0-alpha13'
2010-03-18 05:17:43 +03:00
import sys, os
2010-02-26 14:21:50 +03:00
sys.path.insert(0, srcdir+"/buildtools/wafsamba")
2010-04-04 03:57:33 +04:00
import wafsamba, Options, samba_dist
2010-03-17 12:26:03 +03:00
2010-04-04 05:00:42 +04:00
samba_dist.DIST_DIRS('.')
2010-03-29 15:05:54 +04:00
# install in /usr/local/samba by default
Options.default_prefix = '/usr/local/samba'
2010-03-17 12:26:03 +03:00
def set_options(opt):
2010-03-28 08:42:28 +04:00
opt.BUILTIN_DEFAULT('NONE')
2010-03-28 10:46:59 +04:00
opt.BUNDLED_EXTENSION_DEFAULT('samba4')
2010-04-04 07:08:05 +04:00
opt.RECURSE('../lib/replace')
opt.RECURSE('dynconfig')
opt.RECURSE('scripting/python')
opt.RECURSE('lib/ldb')
opt.RECURSE('selftest')
opt.RECURSE('lib/tls')
opt.RECURSE('../lib/nss_wrapper')
opt.RECURSE('../lib/socket_wrapper')
opt.RECURSE('../lib/uid_wrapper')
opt.RECURSE('../pidl')
2010-03-17 12:38:03 +03:00
2010-03-17 12:26:03 +03:00
def configure(conf):
2010-03-28 07:10:15 +04:00
conf.DEFINE('PACKAGE_NAME', 'samba', quote=True)
conf.DEFINE('PACKAGE_STRING', 'samba 4', quote=True)
conf.DEFINE('PACKAGE_TARNAME', 'samba', quote=True)
conf.DEFINE('PACKAGE_URL', "http://www.samba.org/", quote=True)
conf.DEFINE('PACKAGE_VERSION', "4", quote=True)
conf.DEFINE('PACKAGE_BUGREPORT', 'http://bugzilla.samba.org/', quote=True)
2010-03-07 16:25:22 +03:00
2010-03-20 08:27:48 +03:00
conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
conf.DEFINE('_SAMBA_BUILD_', 4, add_to_cflags=True)
conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
2010-03-28 07:10:15 +04:00
2010-03-20 08:27:48 +03:00
if Options.options.developer:
conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
# set a lower limit on recursing in waf preprocessor
conf.env.preprocessor_recursion_limit = 10
2010-03-28 07:16:12 +04:00
conf.ADD_EXTRA_INCLUDES('#source4 #lib #source4/lib #source4/include')
2010-03-20 08:27:48 +03:00
2010-04-04 07:08:05 +04:00
conf.RECURSE('../lib/replace')
2010-03-20 08:27:48 +03:00
2010-03-17 13:46:38 +03:00
conf.find_program('python', var='PYTHON', mandatory=True)
2010-03-17 13:53:29 +03:00
conf.find_program('perl', var='PERL', mandatory=True)
2010-03-20 08:27:48 +03:00
# enable tool to build python extensions
conf.check_tool('python')
conf.check_python_version((2,4,2))
conf.check_python_headers()
2010-04-04 07:08:05 +04:00
conf.RECURSE('dynconfig')
conf.RECURSE('scripting/python')
conf.RECURSE('lib/ldb')
conf.RECURSE('heimdal_build')
conf.RECURSE('lib/tls')
conf.RECURSE('ntvfs/sysdep')
conf.RECURSE('../lib/util')
conf.RECURSE('../lib/zlib')
conf.RECURSE('../lib/util/charset')
conf.RECURSE('auth')
conf.RECURSE('../lib/nss_wrapper')
conf.RECURSE('../nsswitch')
conf.RECURSE('../lib/socket_wrapper')
conf.RECURSE('../lib/uid_wrapper')
conf.RECURSE('../lib/popt')
conf.RECURSE('lib/smbreadline')
conf.RECURSE('../pidl')
2010-03-17 12:26:03 +03:00
2010-03-31 11:05:57 +04:00
# we don't want PYTHONDIR in config.h, as otherwise changing
# --prefix causes a complete rebuild
del(conf.env.defines['PYTHONDIR'])
2010-02-23 00:09:46 +03:00
conf.SAMBA_CONFIG_H('include/config.h')
2010-03-17 02:58:07 +03:00
2010-03-18 05:17:43 +03:00
def etags(ctx):
'''build TAGS file using etags'''
import Utils
source_root = os.path.dirname(Utils.g_module.root_path)
cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root
print "Running: %s" % cmd
os.system(cmd)
2010-03-19 12:10:36 +03:00
def ctags(ctx):
2010-03-19 12:30:14 +03:00
"build 'tags' file using ctags"
2010-03-19 12:10:36 +03:00
import Utils
source_root = os.path.dirname(Utils.g_module.root_path)
cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
2010-03-19 12:30:14 +03:00
print "Running: %s" % cmd
2010-03-19 12:10:36 +03:00
os.system(cmd)
2010-03-19 01:10:59 +03:00
# putting this here enabled build in the list
# of commands in --help
def build(bld):
'''build all targets'''
pass
2010-03-29 10:12:04 +04:00
def pydoctor(ctx):
'''build python apidocs'''
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'
print "Running: %s" % cmd
os.system(cmd)
def wafdocs(ctx):
'''build wafsamba apidocs'''
from samba_utils import recursive_dirlist
os.system('pwd')
list = recursive_dirlist('../buildtools/wafsamba', '.', pattern='*.py')
cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
print list
for f in list:
cmd += ' --add-module %s' % f
print "Running: %s" % cmd
os.system(cmd)
2010-04-04 03:57:33 +04:00
def dist():
'''makes a tarball for distribution'''
samba_dist.dist()
2010-04-05 05:26:24 +04:00
def distcheck():
'''test that distribution tarball builds and installs'''
import Scripting
d = Scripting.distcheck
d(subdir='source4')