summaryrefslogtreecommitdiffstats
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
commit6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch)
tree850c71039563c16a5d563c47e7ba2ab645baf198 /buildtools
parent6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff)
parent2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff)
downloadsamba-4.0.0alpha16.tar.gz
samba-4.0.0alpha16.tar.xz
samba-4.0.0alpha16.zip
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16samba-4.0.0alpha16
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/scripts/Makefile.waf2
-rw-r--r--buildtools/wafsamba/pkgconfig.py1
-rw-r--r--buildtools/wafsamba/samba3.py14
-rw-r--r--buildtools/wafsamba/samba_autoconf.py2
-rw-r--r--buildtools/wafsamba/samba_deps.py4
-rw-r--r--buildtools/wafsamba/samba_install.py4
-rw-r--r--buildtools/wafsamba/samba_patterns.py3
-rw-r--r--buildtools/wafsamba/samba_version.py15
-rw-r--r--buildtools/wafsamba/samba_wildcard.py35
-rw-r--r--buildtools/wafsamba/symbols.py2
-rw-r--r--buildtools/wafsamba/wafsamba.py29
11 files changed, 72 insertions, 39 deletions
diff --git a/buildtools/scripts/Makefile.waf b/buildtools/scripts/Makefile.waf
index 716ab932706..5fc939c99e0 100644
--- a/buildtools/scripts/Makefile.waf
+++ b/buildtools/scripts/Makefile.waf
@@ -62,7 +62,7 @@ ctags:
$(WAF) ctags
bin/%:: FORCE
- $(WAF) --targets=`basename $@`
+ $(WAF) --targets=$@
FORCE:
configure: autogen-waf.sh BUILDTOOLS/scripts/configure.waf
diff --git a/buildtools/wafsamba/pkgconfig.py b/buildtools/wafsamba/pkgconfig.py
index 09bfcb9c6be..8a3f807dc55 100644
--- a/buildtools/wafsamba/pkgconfig.py
+++ b/buildtools/wafsamba/pkgconfig.py
@@ -53,6 +53,7 @@ def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
rule=subst_at_vars,
source=f+'.in',
target=f)
+ bld.add_manual_dependency(bld.path.find_or_declare(f), bld.env['PREFIX'])
t.vars = []
if t.env.RPATH_ON_INSTALL:
t.env.LIB_RPATH = t.env.RPATH_ST % t.env.LIBDIR
diff --git a/buildtools/wafsamba/samba3.py b/buildtools/wafsamba/samba3.py
index cb459ad115a..d77cd4d41e9 100644
--- a/buildtools/wafsamba/samba3.py
+++ b/buildtools/wafsamba/samba3.py
@@ -51,14 +51,18 @@ def s3_fix_kwargs(bld, kwargs):
s3reldir = os_path_relpath(s3dir, bld.curdir)
# the extra_includes list is relative to the source3 directory
- extra_includes = [ '.', 'include', 'lib' ]
+ extra_includes = [ '.', 'include', 'lib', '../lib/tdb_compat' ]
if bld.env.use_intree_heimdal:
extra_includes += [ '../source4/heimdal/lib/com_err',
'../source4/heimdal/lib/gssapi',
'../source4/heimdal_build' ]
- if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
- extra_includes += [ '../lib/tdb/include' ]
+ if bld.CONFIG_SET('BUILD_TDB2'):
+ if not bld.CONFIG_SET('USING_SYSTEM_TDB2'):
+ extra_includes += [ '../lib/tdb2' ]
+ else:
+ if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
+ extra_includes += [ '../lib/tdb/include' ]
if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
extra_includes += [ '../lib/tevent' ]
@@ -89,13 +93,13 @@ def s3_fix_kwargs(bld, kwargs):
def SAMBA3_LIBRARY(bld, name, *args, **kwargs):
s3_fix_kwargs(bld, kwargs)
- kwargs['allow_undefined_symbols'] = True
return bld.SAMBA_LIBRARY(name, *args, **kwargs)
Build.BuildContext.SAMBA3_LIBRARY = SAMBA3_LIBRARY
def SAMBA3_MODULE(bld, name, *args, **kwargs):
s3_fix_kwargs(bld, kwargs)
- kwargs['allow_undefined_symbols'] = True
+ if not 'allow_undefined_symbols' in kwargs:
+ kwargs['allow_undefined_symbols'] = True
return bld.SAMBA_MODULE(name, *args, **kwargs)
Build.BuildContext.SAMBA3_MODULE = SAMBA3_MODULE
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 174ca142102..207d7320b95 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -597,7 +597,7 @@ def SAMBA_CONFIG_H(conf, path=None):
if Options.options.developer:
# we add these here to ensure that -Wstrict-prototypes is not set during configure
- conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes',
+ conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes -fno-common',
testflags=True)
if os.getenv('TOPLEVEL_BUILD'):
conf.ADD_CFLAGS('-Wcast-qual', testflags=True)
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index adeb3645ce1..0bd2c6cf67b 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -89,6 +89,10 @@ def build_dependencies(self):
for f in self.env.undefined_ldflags:
self.ldflags.remove(f)
+ if getattr(self, 'allow_undefined_symbols', False) and self.env.undefined_ignore_ldflags:
+ for f in self.env.undefined_ignore_ldflags:
+ self.ldflags.append(f)
+
debug('deps: computed dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
self.sname, self.uselib, self.uselib_local, self.add_objects)
diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py
index d755d010784..26d0a371e6d 100644
--- a/buildtools/wafsamba/samba_install.py
+++ b/buildtools/wafsamba/samba_install.py
@@ -137,9 +137,9 @@ def install_library(self):
os.path.join(self.path.abspath(bld.env), inst_name))
if install_link and install_link != install_name:
# and the symlink if needed
- bld.symlink_as(os.path.join(install_path, install_link), install_name)
+ bld.symlink_as(os.path.join(install_path, install_link), os.path.basename(install_name))
if dev_link:
- bld.symlink_as(os.path.join(install_path, dev_link), install_name)
+ bld.symlink_as(os.path.join(install_path, dev_link), os.path.basename(install_name))
@feature('cshlib')
diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index 37ef4198a68..f064608f3a3 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -10,7 +10,7 @@ def write_version_header(task):
src = task.inputs[0].srcpath(task.env)
tgt = task.outputs[0].bldpath(task.env)
- version = samba_version_file(src, task.env.srcdir, env=task.env)
+ version = samba_version_file(src, task.env.srcdir, env=task.env, is_install=task.env.is_install)
string = str(version)
f = open(tgt, 'w')
@@ -26,4 +26,5 @@ def SAMBA_MKVERSION(bld, target):
source= 'VERSION',
target=target,
always=True)
+ t.env.is_install = bld.is_install
Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index 0b0c159f55f..0c39ed44ecd 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -90,7 +90,7 @@ def git_version_summary(path, env=None):
class SambaVersion(object):
- def __init__(self, version_dict, path, env=None):
+ def __init__(self, version_dict, path, env=None, is_install=True):
'''Determine the version number of samba
See VERSION for the format. Entries on that file are
@@ -152,7 +152,10 @@ also accepted as dictionary entries here
SAMBA_VERSION_STRING += ("rc%u" % self.RC_RELEASE)
if self.IS_SNAPSHOT:
- if os.path.exists(os.path.join(path, ".git")):
+ if not is_install:
+ suffix = "DEVELOPERBUILD"
+ self.vcs_fields = {}
+ elif os.path.exists(os.path.join(path, ".git")):
suffix, self.vcs_fields = git_version_summary(path, env=env)
elif os.path.exists(os.path.join(path, ".bzr")):
suffix, self.vcs_fields = bzr_version_summary(path)
@@ -234,7 +237,7 @@ also accepted as dictionary entries here
return string
-def samba_version_file(version_file, path, env=None):
+def samba_version_file(version_file, path, env=None, is_install=True):
'''Parse the version information from a VERSION file'''
f = open(version_file, 'r')
@@ -254,16 +257,16 @@ def samba_version_file(version_file, path, env=None):
print("Failed to parse line %s from %s" % (line, version_file))
raise
- return SambaVersion(version_dict, path, env=env)
+ return SambaVersion(version_dict, path, env=env, is_install=is_install)
-def load_version(env=None):
+def load_version(env=None, is_install=True):
'''load samba versions either from ./VERSION or git
return a version object for detailed breakdown'''
if not env:
env = samba_utils.LOAD_ENVIRONMENT()
- version = samba_version_file("./VERSION", ".", env)
+ version = samba_version_file("./VERSION", ".", env, is_install=is_install)
Utils.g_module.VERSION = version.STRING
return version
diff --git a/buildtools/wafsamba/samba_wildcard.py b/buildtools/wafsamba/samba_wildcard.py
index 5bf12672a95..75ab5defcdc 100644
--- a/buildtools/wafsamba/samba_wildcard.py
+++ b/buildtools/wafsamba/samba_wildcard.py
@@ -17,7 +17,7 @@ def run_task(t, k):
def run_named_build_task(cmd):
'''run a named build task, matching the cmd name using fnmatch
wildcards against inputs and outputs of all build tasks'''
- bld = fake_build_environment()
+ bld = fake_build_environment(info=False)
found = False
cwd_node = bld.root.find_dir(os.getcwd())
top_node = bld.root.find_dir(bld.srcnode.abspath())
@@ -50,6 +50,28 @@ def run_named_build_task(cmd):
raise Utils.WafError("Unable to find build target matching %s" % cmd)
+def rewrite_compile_targets():
+ '''cope with the bin/ form of compile target'''
+ if not Options.options.compile_targets:
+ return
+
+ bld = fake_build_environment(info=False)
+ targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+ tlist = []
+
+ for t in Options.options.compile_targets.split(','):
+ if not os.path.islink(t):
+ tlist.append(t)
+ continue
+ link = os.readlink(t)
+ list = link.split('/')
+ for name in [list[-1], '/'.join(list[-2:])]:
+ if name in targets:
+ tlist.append(name)
+ continue
+ Options.options.compile_targets = ",".join(tlist)
+
+
def wildcard_main(missing_cmd_fn):
'''this replaces main from Scripting, allowing us to override the
@@ -60,6 +82,9 @@ def wildcard_main(missing_cmd_fn):
'''
Scripting.commands = Options.arg_line[:]
+ # rewrite the compile targets to cope with the bin/xx form
+ rewrite_compile_targets()
+
while Scripting.commands:
x = Scripting.commands.pop(0)
@@ -99,7 +124,7 @@ def wildcard_main(missing_cmd_fn):
-def fake_build_environment():
+def fake_build_environment(info=True, flush=False):
"""create all the tasks for the project, but do not run the build
return the build context in use"""
bld = getattr(Utils.g_module, 'build_context', Utils.Context)()
@@ -119,10 +144,12 @@ def fake_build_environment():
bld.load_dirs(proj[SRCDIR], proj[BLDDIR])
bld.load_envs()
- Logs.info("Waf: Entering directory `%s'" % bld.bldnode.abspath())
+ if info:
+ Logs.info("Waf: Entering directory `%s'" % bld.bldnode.abspath())
bld.add_subdirs([os.path.split(Utils.g_module.root_path)[0]])
bld.pre_build()
- bld.flush()
+ if flush:
+ bld.flush()
return bld
diff --git a/buildtools/wafsamba/symbols.py b/buildtools/wafsamba/symbols.py
index ed195176e65..dfab71c2c43 100644
--- a/buildtools/wafsamba/symbols.py
+++ b/buildtools/wafsamba/symbols.py
@@ -447,7 +447,7 @@ def check_dependencies(bld, t):
deps = set(t.samba_deps)
for d in t.samba_deps:
- if targets[d] in [ 'EMPTY', 'DISABLED', 'SYSLIB' ]:
+ if targets[d] in [ 'EMPTY', 'DISABLED', 'SYSLIB', 'GENERATOR' ]:
continue
bld.ASSERT(d in bld.env.public_symbols, "Failed to find symbol list for dependency '%s'" % d)
diff = remaining.intersection(bld.env.public_symbols[d])
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 2a1c82a3077..d76afc49847 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -628,17 +628,6 @@ def ENABLE_TIMESTAMP_DEPENDENCIES(conf):
Utils.h_file = h_file
-
-t = Task.simple_task_type('copy_script', 'rm -f "${LINK_TARGET}" && ln -s "${SRC[0].abspath(env)}" ${LINK_TARGET}',
- shell=True, color='PINK', ext_in='.bin')
-t.quiet = True
-
-@feature('copy_script')
-@before('apply_link')
-def copy_script(self):
- tsk = self.create_task('copy_script', self.allnodes[0])
- tsk.env.TARGET = self.target
-
def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None):
'''used to copy scripts from the source tree into the build directory
for use by selftest'''
@@ -653,15 +642,17 @@ def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None):
target = os.path.join(installdir, iname)
tgtdir = os.path.dirname(os.path.join(bld.srcnode.abspath(bld.env), '..', target))
mkdir_p(tgtdir)
- t = bld(features='copy_script',
- source = s,
- target = target,
- always = True,
- install_path = None)
- t.env.LINK_TARGET = target
-
+ link_src = os.path.normpath(os.path.join(bld.curdir, s))
+ link_dst = os.path.join(tgtdir, os.path.basename(iname))
+ if os.path.islink(link_dst) and os.readlink(link_dst) == link_src:
+ continue
+ if os.path.exists(link_dst):
+ os.unlink(link_dst)
+ Logs.info("symlink: %s -> %s/%s" % (s, installdir, iname))
+ os.symlink(link_src, link_dst)
Build.BuildContext.SAMBA_SCRIPT = SAMBA_SCRIPT
+
def copy_and_fix_python_path(task):
pattern='sys.path.insert(0, "bin/python")'
if task.env["PYTHONARCHDIR"] in sys.path and task.env["PYTHONDIR"] in sys.path:
@@ -701,6 +692,8 @@ def install_file(bld, destdir, file, chmod=MODE_644, flat=False,
rule=copy_and_fix_python_path,
source=file,
target=inst_file)
+ bld.add_manual_dependency(bld.path.find_or_declare(inst_file), bld.env["PYTHONARCHDIR"])
+ bld.add_manual_dependency(bld.path.find_or_declare(inst_file), bld.env["PYTHONDIR"])
file = inst_file
if base_name:
file = os.path.join(base_name, file)