summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-01 09:49:46 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:21 +1000
commitd06df81df21adfaa10497369f06e5d4f51b57611 (patch)
tree1e26c0b28db8924dd63e7c963635f42e4b235de5
parent375277beee2e7ea118cccefa771e97251ad1b285 (diff)
downloadsamba-d06df81df21adfaa10497369f06e5d4f51b57611.tar.gz
samba-d06df81df21adfaa10497369f06e5d4f51b57611.tar.bz2
samba-d06df81df21adfaa10497369f06e5d4f51b57611.zip
build: fixed the dependencies of the install targets
we want the install targets to have identical calculated dependencies to the build targets.
-rw-r--r--buildtools/wafsamba/samba_deps.py50
-rw-r--r--buildtools/wafsamba/wafsamba.py14
2 files changed, 56 insertions, 8 deletions
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 31062e71a8..19cd451161 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -310,6 +310,13 @@ def add_samba_attributes(bld, tgt_list):
t.samba_deps_extended = t.samba_deps[:]
t.samba_includes_extended = TO_LIST(t.samba_includes)[:]
t.ccflags = getattr(t, 'samba_cflags', '')
+ install_target = getattr(t, 'install_target', None)
+ if install_target:
+ t2 = bld.name_to_obj(install_target, bld.env)
+ t2.sname = install_target
+ t2.samba_type = t.samba_type
+ t2.samba_abspath = t2.path.abspath(bld.env)
+ t2.ccflags = t.ccflags
def build_direct_deps(bld, tgt_list):
@@ -621,6 +628,7 @@ def calculate_final_deps(bld, tgt_list, loops):
if t.sname in t.final_objects:
t.final_objects.remove(t.sname)
+
# find any library loops
for t in tgt_list:
if t.samba_type in ['LIBRARY', 'PYTHON']:
@@ -674,7 +682,6 @@ def calculate_final_deps(bld, tgt_list, loops):
debug('deps: removed duplicate dependencies')
-
######################################################################
# this provides a way to save our dependency calculations between runs
savedeps_version = 3
@@ -734,6 +741,7 @@ def save_samba_deps(bld, tgt_list):
denv.store(depsfile)
+
def load_samba_deps(bld, tgt_list):
'''load a previous set of build dependencies if possible'''
depsfile = os.path.join(bld.bdir, "sambadeps")
@@ -775,15 +783,22 @@ def load_samba_deps(bld, tgt_list):
#print '%s: \ntdeps=%s \nodeps=%s' % (t.sname, tdeps, olddeps)
return False
- # put outputs in place
+ tgt_list_extended = tgt_list[:]
for t in tgt_list:
+ install_target = getattr(t, 'install_target', None)
+ if install_target:
+ t2 = bld.name_to_obj(install_target, bld.env)
+ tgt_list_extended.append(t2)
+
+ # put outputs in place
+ for t in tgt_list_extended:
if not t.sname in denv.output: continue
tdeps = denv.output[t.sname]
for a in tdeps:
setattr(t, a, tdeps[a])
# put output env vars in place
- for t in tgt_list:
+ for t in tgt_list_extended:
if not t.sname in denv.outenv: continue
tdeps = denv.outenv[t.sname]
for a in tdeps:
@@ -793,6 +808,30 @@ def load_samba_deps(bld, tgt_list):
return True
+
+def add_install_deps(bld, tgt_list):
+ '''add attributes for install libs/binaries
+
+ This ensures that all the install targets have identical dependencies
+ to the build targets.
+ '''
+ for t in tgt_list[:]:
+ install_target = getattr(t, 'install_target', None)
+ if install_target:
+ t2 = bld.name_to_obj(install_target, bld.env)
+ if not t2:
+ print('install_target %s not found for %s' % (install_target, t.sname))
+ sys.exit(1)
+ tgt_list.append(t2)
+ for attr in savedeps_outputs:
+ v = getattr(t, attr, None)
+ if v:
+ setattr(t2, attr, v)
+ for attr in savedeps_outenv:
+ if attr in t.env:
+ t2.env[attr] = t.env[attr]
+
+
def check_project_rules(bld):
'''check the project rules - ensuring the targets are sane'''
@@ -803,6 +842,8 @@ def check_project_rules(bld):
# build a list of task generators we are interested in
tgt_list = []
for tgt in targets:
+ if tgt.endswith('.inst'):
+ continue
type = targets[tgt]
if not type in ['SUBSYSTEM', 'MODULE', 'BINARY', 'LIBRARY', 'ASN1', 'PYTHON']:
continue
@@ -815,6 +856,7 @@ def check_project_rules(bld):
add_samba_attributes(bld, tgt_list)
if load_samba_deps(bld, tgt_list):
+ add_install_deps(bld, tgt_list)
return
print "Checking project rules ..."
@@ -846,6 +888,8 @@ def check_project_rules(bld):
save_samba_deps(bld, tgt_list)
+ add_install_deps(bld, tgt_list)
+
print "Project rules pass"
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 2fc7eceee5..5a48cb4ba1 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -162,16 +162,18 @@ def SAMBA_LIBRARY(bld, libname, source,
if link_name:
t.link_name = link_name
- if install_path is None:
- install_path = '${LIBDIR}'
- install_path = SUBST_VARS_RECURSIVE(install_path, bld.env)
-
# we don't need the double libraries if rpath is off
if (bld.env.RPATH_ON_INSTALL == False and
bld.env.RPATH_ON_BUILD == False):
install_target = bundled_name
else:
install_target = bundled_name + '.inst'
+ if install:
+ t.install_target = install_target
+
+ if install_path is None:
+ install_path = '${LIBDIR}'
+ install_path = SUBST_VARS_RECURSIVE(install_path, bld.env)
if install and install_target != bundled_name:
# create a separate install library, which may have
@@ -277,7 +279,7 @@ def SAMBA_BINARY(bld, binname, source,
deps = TO_LIST(deps)
deps.append(obj_target)
- bld(
+ t = bld(
features = features + ' symlink_bin',
source = [],
target = binname,
@@ -302,6 +304,8 @@ def SAMBA_BINARY(bld, binname, source,
install_target = binname
else:
install_target = binname + '.inst'
+ if install:
+ t.install_target = install_target
if install and install_target != binname:
# we create a separate 'install' binary, which